Compare commits

...

10 Commits

Author SHA1 Message Date
Chris Leech 9279c31db8 fix libiscsi regression causing udisksd faults with firmware discovery 2023-05-18 13:40:00 +00:00
Chris Leech 1e5bb6dd55 iscsi-init.service modified to work in initramfs
Resolves: #2016482
2021-11-01 16:13:33 -07:00
Chris Leech ee5dab0d53 Sync with Fedora 6.2.1.4-1
rebase to upstream 2.1.4
iscsiuio fixes for newer upstream bnx2x driver having version removed
match ghosted lock file modes to tmpfiles configuration

Resolves: #1961620
Resolves: #1876449
Resolves: #1910569
Resolves: #1910570
Resolves: #1910572
2021-08-12 10:42:44 -07:00
Aleksandra Fedorova 06df70a3c7 Add RHEL gating configuration 2021-08-10 15:28:35 +00:00
Mohan Boddu 25e2eb9501 Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-08-09 21:00:20 +00:00
Mohan Boddu 324bce8dde Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-06-16 03:26:50 +00:00
Mohan Boddu 5f99542d75 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-04-16 00:38:24 +00:00
DistroBaker ee00ad4799 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/iscsi-initiator-utils.git#c055794bdad05bd5c9ea9f1757440a8fd837cf52
2021-02-19 08:50:34 +00:00
DistroBaker 9b82b423c1 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/iscsi-initiator-utils.git#eecc7a5c5ec5f234c591e17548d6c087dae68654
2021-02-04 05:54:10 +01:00
DistroBaker b0e65d7cad Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/iscsi-initiator-utils.git#9f9048a6db543bc42b92ba64e019a267fdea1f43
2020-11-06 00:55:13 +00:00
19 changed files with 521 additions and 138 deletions

2
.gitignore vendored
View File

@ -10,3 +10,5 @@
/open-iscsi-802688d.tar.gz
/open-iscsi-13e7f58.tar.gz
/open-iscsi-a8fcb37.tar.gz
/open-iscsi-095f59c.tar.gz
/open-iscsi-2a8f9d8.tar.gz

View File

@ -0,0 +1 @@
548252927c20ea605def18014cbafa377b1b104d open-iscsi-2a8f9d8.tar.gz

View File

@ -0,0 +1,28 @@
From 432bbf979ee66ee29bb92e35fd6e3ffb948563e3 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 29 Sep 2021 11:48:16 -0700
Subject: [PATCH] Remove dependences from iscsi-init.service
Since iscsid.service depends on it but disables
default dependencies, iscsi-init.service must
also disable default dependencies, or a dependency
loop can be created.
---
etc/systemd/iscsi-init.service | 1 +
1 file changed, 1 insertion(+)
diff --git a/etc/systemd/iscsi-init.service b/etc/systemd/iscsi-init.service
index e058ff0..eab4ff2 100644
--- a/etc/systemd/iscsi-init.service
+++ b/etc/systemd/iscsi-init.service
@@ -1,6 +1,7 @@
[Unit]
Description=One time configuration for iscsi.service
ConditionPathExists=!/etc/iscsi/initiatorname.iscsi
+DefaultDependencies=no
Before=iscsid.service
[Service]
--
2.33.0

View File

@ -0,0 +1,40 @@
From 47dd191ab5c48932df4c0c219fca19fcedba6cd2 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 2 Jun 2022 11:37:20 -0700
Subject: [PATCH 1/1] fix libiscsi firmware discovery issue with NULL drec
argument
---
libiscsi/libiscsi.c | 2 +-
usr/idbm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index c598aee..bddf9fc 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -258,7 +258,7 @@ int libiscsi_discover_firmware(struct libiscsi_context *context,
struct libiscsi_node *new_node = new_nodes;
/* in one loop, add nodes to idbm and create libiscsi_node entries */
list_for_each_entry(rec, &rec_list, list) {
- CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */));
+ CHECK(idbm_add_node(rec, &drec, 1 /* overwrite */));
strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN);
new_node->tpgt = rec->tpgt;
diff --git a/usr/idbm.c b/usr/idbm.c
index e9025bf..9cc9c40 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2536,7 +2536,7 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
if (rc)
goto unlock;
- if (drec->type == DISCOVERY_TYPE_FW) {
+ if (drec && drec->type == DISCOVERY_TYPE_FW) {
log_debug(8, "setting firmware node 'startup' to 'onboot'");
newrec->startup = ISCSI_STARTUP_ONBOOT;
newrec->conn[0].startup = ISCSI_STARTUP_ONBOOT;
--
2.36.1

View File

@ -1,7 +1,7 @@
From 0a6af5e7283ed2733753998043adac090ef12dd0 Mon Sep 17 00:00:00 2001
From fd538429be486d057b092e3b9c148add2c5ea9c2 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 4 Jun 2019 13:23:32 -0700
Subject: [PATCH] unit file tweaks
Subject: [PATCH 1/1] unit file tweaks
---
etc/systemd/iscsi-mark-root-nodes | 34 ++++++++++++++++++++++++++++++
@ -98,7 +98,7 @@ index 0000000..caee933
+ExecStart=-/usr/bin/true
+ExecStop=-/usr/sbin/iscsiadm -m node --logoutall=all
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
index 2f2bf81..175cb2c 100644
index 5e394b9..175cb2c 100644
--- a/etc/systemd/iscsi.service
+++ b/etc/systemd/iscsi.service
@@ -1,18 +1,18 @@
@ -106,9 +106,9 @@ index 2f2bf81..175cb2c 100644
Description=Login and scanning of iSCSI devices
Documentation=man:iscsiadm(8) man:iscsid(8)
-Before=remote-fs.target
-After=network.target network-online.target
-After=iscsid.service iscsi-init.service
-After=network-online.target iscsid.service
-Requires=iscsid.socket iscsi-init.service
-Wants=network-online.target
+DefaultDependencies=no
+Before=remote-fs-pre.target
+After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service
@ -117,7 +117,7 @@ index 2f2bf81..175cb2c 100644
[Service]
Type=oneshot
-ExecStart=/sbin/iscsiadm -m node --loginall=automatic
-ExecStart=/sbin/iscsiadm -m node --loginall=automatic -W
-ExecStop=/sbin/iscsiadm -m node --logoutall=automatic
-ExecStop=/sbin/iscsiadm -m node --logoutall=manual
-SuccessExitStatus=21 15
@ -129,14 +129,15 @@ index 2f2bf81..175cb2c 100644
[Install]
WantedBy=remote-fs.target
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
index 648ceea..28402fb 100644
index 3fd7dd3..324c593 100644
--- a/etc/systemd/iscsid.service
+++ b/etc/systemd/iscsid.service
@@ -4,12 +4,11 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
@@ -4,13 +4,12 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
DefaultDependencies=no
After=network.target iscsiuio.service
After=network-online.target iscsiuio.service iscsi-init.service
Before=remote-fs-pre.target
-Wants=remote-fs-pre.target
Requires=iscsi-init.service
[Service]
Type=notify
@ -170,5 +171,5 @@ index 923e019..fc0be93 100644
Restart=on-failure
--
2.26.2
2.26.3

View File

@ -1,7 +1,7 @@
From cfd9fc81e11c462b682ead4e05721772b20f7546 Mon Sep 17 00:00:00 2001
From 0bb22b50dbaa7ac44e8eb244a73a66efbd98632c Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 13 Aug 2013 11:34:31 -0700
Subject: [PATCH] idbm_rec_write, seperate old and new style writes
Subject: [PATCH 1/1] idbm_rec_write, seperate old and new style writes
Duplicates a small bit of code, but easier to understand and extened.
---
@ -9,10 +9,10 @@ Duplicates a small bit of code, but easier to understand and extened.
1 file changed, 86 insertions(+), 43 deletions(-)
diff --git a/usr/idbm.c b/usr/idbm.c
index e6ede85..bc51388 100644
index efdda75..307a01a 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2130,12 +2130,7 @@ mkdir_portal:
@@ -2152,12 +2152,7 @@ mkdir_portal:
return f;
}
@ -26,13 +26,13 @@ index e6ede85..bc51388 100644
{
struct stat statb;
FILE *f;
@@ -2148,39 +2143,8 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
@@ -2170,39 +2165,8 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
return ISCSI_ERR_NOMEM;
}
- snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR);
- if (access(portal, F_OK) != 0) {
- if (mkdir(portal, 0660) != 0) {
- if (mkdir(portal, 0770) != 0) {
- log_error("Could not make %s: %s", portal,
- strerror(errno));
- rc = ISCSI_ERR_IDBM;
@ -42,7 +42,7 @@ index e6ede85..bc51388 100644
-
- snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name);
- if (access(portal, F_OK) != 0) {
- if (mkdir(portal, 0660) != 0) {
- if (mkdir(portal, 0770) != 0) {
- log_error("Could not make %s: %s", portal,
- strerror(errno));
- rc = ISCSI_ERR_IDBM;
@ -66,7 +66,7 @@ index e6ede85..bc51388 100644
rc = stat(portal, &statb);
if (rc) {
@@ -2201,11 +2165,11 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
@@ -2223,11 +2187,11 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
log_error("Could not convert %s: %s", portal,
strerror(errno));
rc = ISCSI_ERR_IDBM;
@ -80,7 +80,7 @@ index e6ede85..bc51388 100644
}
mkdir_portal:
@@ -2216,24 +2180,103 @@ mkdir_portal:
@@ -2238,24 +2202,103 @@ mkdir_portal:
log_error("Could not make dir %s: %s",
portal, strerror(errno));
rc = ISCSI_ERR_IDBM;
@ -189,5 +189,5 @@ index e6ede85..bc51388 100644
idbm_unlock();
free_portal:
--
2.26.2
2.26.3

View File

@ -1,7 +1,7 @@
From b2af45f06a9b4d78c5dbb9421ac94f62d5e6f884 Mon Sep 17 00:00:00 2001
From f7c6a7381a38ca59fd7a9a64e5f54cf5c16995ad Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:38:45 -0800
Subject: [PATCH] use var for config
Subject: [PATCH 1/1] use var for config
---
README | 33 ++++++++++++++++-----------------
@ -13,7 +13,7 @@ Subject: [PATCH] use var for config
6 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/README b/README
index c05814a..326c3b0 100644
index b62a14e..1875e3d 100644
--- a/README
+++ b/README
@@ -172,8 +172,7 @@ Usage: iscsid [OPTION]
@ -26,7 +26,7 @@ index c05814a..326c3b0 100644
Configuration is contained in directories for:
@@ -561,7 +560,7 @@ a scsi_host per HBA port).
@@ -573,7 +572,7 @@ a scsi_host per HBA port).
To manage both types of initiator stacks, iscsiadm uses the interface (iface)
structure. For each HBA port or for software iscsi for each network
device (ethX) or NIC, that you wish to bind sessions to you must create
@ -35,7 +35,7 @@ index c05814a..326c3b0 100644
Prep
----
@@ -594,7 +593,7 @@ Running
@@ -606,7 +605,7 @@ Running
The command
iscsiadm -m iface
@ -44,7 +44,7 @@ index c05814a..326c3b0 100644
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
@@ -604,10 +603,10 @@ The format is:
@@ -616,10 +615,10 @@ The format is:
For software iscsi, you can create the iface configs by hand, but it is
recommended that you use iscsiadm's iface mode. There is an iface.example in
@ -57,7 +57,7 @@ index c05814a..326c3b0 100644
must have a unique name which is less than or equal to 64 characters.
Example
@@ -615,12 +614,12 @@ Example
@@ -627,12 +626,12 @@ Example
If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with
MAC address 00:C0:DD:08:63:E7, and you wanted to do software iscsi over
@ -72,7 +72,7 @@ index c05814a..326c3b0 100644
iface.transport_name = tcp
iface.hwaddress = 00:C0:DD:08:63:E7
@@ -662,7 +661,7 @@ port. The iface name will be of the form:
@@ -674,7 +673,7 @@ port. The iface name will be of the form:
Running the following command:
iscsiadm -m iface
@ -81,7 +81,7 @@ index c05814a..326c3b0 100644
default tcp,<empty>,<empty>,<empty>,<empty>
iser iser,<empty>,<empty>,<empty>,<empty>
@@ -742,7 +741,7 @@ need a separate network connection to the target for discovery purposes.
@@ -754,7 +753,7 @@ need a separate network connection to the target for discovery purposes.
*This will be fixed in the next version of open-iscsi*
For compatibility reasons, when you run iscsiadm to do discovery, it
@ -90,7 +90,7 @@ index c05814a..326c3b0 100644
tcp for the iface.transport, and it will bind the portals that are discovered
so that they will be logged in through those ifaces. This behavior can also
be overridden by passing in the interfaces you want to use. For the case
@@ -757,7 +756,7 @@ If you had defined interfaces but wanted the old behavior, where we do not
@@ -769,7 +768,7 @@ If you had defined interfaces but wanted the old behavior, where we do not
bind a session to an iface, then you can use the special iface "default":
iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
@ -99,7 +99,7 @@ index c05814a..326c3b0 100644
not pass anything into iscsiadm, running iscsiadm will do the default
behavior, allowing the network subsystem to decide which device to use.
@@ -793,7 +792,7 @@ Discovery mode
@@ -805,7 +804,7 @@ Discovery mode
ID [192.168.1.1:3260]:
iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
@ -108,7 +108,7 @@ index c05814a..326c3b0 100644
ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
will perform discovery using the settings stored in the record.
If a record does not exist, it will be created using the iscsid.conf
@@ -802,7 +801,7 @@ Discovery mode
@@ -814,7 +813,7 @@ Discovery mode
The argument to -p may also be a hostname instead of an address:
iscsiadm -m discoverydb -t st -p somehost --discover
@ -117,7 +117,7 @@ index c05814a..326c3b0 100644
interfaces using software iscsi. If any are found then nodes found
during discovery will be setup so that they can logged in through
those interfaces. To specify a specific iface, pass the
@@ -853,7 +852,7 @@ Discovery mode
@@ -865,7 +864,7 @@ Discovery mode
- SendTargets iSCSI Discovery with a specific interface.
If you wish to only use a subset of the interfaces in
@ -126,7 +126,7 @@ index c05814a..326c3b0 100644
iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
--interface=iface0 --interface=iface1 --discover
@@ -1223,8 +1222,8 @@ where targetname is the name of the target and ip_address:port is the address
@@ -1232,8 +1231,8 @@ where targetname is the name of the target and ip_address:port is the address
and port of the portal. tpgt is the Target Portal Group Tag of
the portal, and is not used in iscsiadm commands except for static
record creation. ifacename is the name of the iscsi interface
@ -137,7 +137,7 @@ index c05814a..326c3b0 100644
Default here is iscsi_tcp/tcp to be used over whichever NIC the
network layer decides is best.
@@ -1336,7 +1335,7 @@ If set, iscsid will perform discovery to the address every
@@ -1353,7 +1352,7 @@ If set, iscsid will perform discovery to the address every
discovery.isns.discoveryd_poll_inval or
discovery.sendtargets.discoveryd_poll_inval seconds,
and it will log into any portals found from the discovery source using
@ -147,10 +147,10 @@ index c05814a..326c3b0 100644
Note that for iSNS the poll_interval does not have to be set. If not set,
iscsid will only perform rediscovery when it gets a SCN from the server.
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 22263eb..f47afac 100644
index 3729a72..9f84a81 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -229,7 +229,7 @@ This option is only valid for ping submode.
@@ -228,7 +228,7 @@ This option is only valid for ping submode.
.TP
\fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
The interface argument specifies the iSCSI interface to use for the operation.
@ -159,7 +159,7 @@ index 22263eb..f47afac 100644
iSCSI (qla4xxx) the iface config must have the hardware address
(iface.hwaddress = port's MAC address)
and the driver/transport_name (iface.transport_name). The iface's name is
@@ -309,7 +309,7 @@ If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and
@@ -318,7 +318,7 @@ If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and
\fInode\fR, all of their respective records are displayed; for \fIsession\fR,
all active sessions and connections are displayed; for \fIfw\fR, all boot
firmware values are displayed; for \fIhost\fR, all iSCSI hosts are displayed;
@ -168,7 +168,7 @@ index 22263eb..f47afac 100644
.TP
\fB\-n\fR, \fB\-\-name=\fIname\fR
In node mode, specify a field \fIname\fR in a record. In flashnode submode
@@ -648,10 +648,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
@@ -681,10 +681,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
The file containing the iSCSI InitiatorName and InitiatorAlias read by
\fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP
@ -182,10 +182,10 @@ index 22263eb..f47afac 100644
.SH "SEE ALSO"
.BR iscsid (8)
diff --git a/doc/iscsid.8 b/doc/iscsid.8
index 6f9218f..0da0551 100644
index db996b4..eaa9c3b 100644
--- a/doc/iscsid.8
+++ b/doc/iscsid.8
@@ -65,7 +65,7 @@ and
@@ -70,7 +70,7 @@ and
.B iscsiadm
on startup.
.TP
@ -195,24 +195,24 @@ index 6f9218f..0da0551 100644
.SH "SEE ALSO"
diff --git a/usr/idbm.c b/usr/idbm.c
index 0f0f17a..27cad0a 100644
index 7c63c04..779d052 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -3068,9 +3068,9 @@ free_info:
@@ -3104,9 +3104,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn)
{
/* make sure root db dir is there */
- if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) {
- if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) {
- if (mkdir(ISCSI_CONFIG_ROOT, 0770) != 0) {
- log_error("Could not make %s %d", ISCSI_CONFIG_ROOT,
+ if (access(ISCSIVAR, F_OK) != 0) {
+ if (mkdir(ISCSIVAR, 0660) != 0) {
+ if (mkdir(ISCSIVAR, 0770) != 0) {
+ log_error("Could not make %s %d", ISCSIVAR,
errno);
return errno;
}
diff --git a/usr/idbm.h b/usr/idbm.h
index 46cd82a..ce098b7 100644
index 7496f1d..db3048b 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -30,12 +30,13 @@
@ -251,5 +251,5 @@ index 6c06f7f..c8b9de9 100644
struct iface_rec;
struct list_head;
--
2.26.2
2.26.3

View File

@ -1,7 +1,7 @@
From 0c300716226027d75afa2b9e5f052fa4868204ae Mon Sep 17 00:00:00 2001
From 6de09f82e86db0500a59017a473c944877a80516 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 5 Jun 2019 09:08:39 -0700
Subject: [PATCH] Coverity scan fixes
Subject: [PATCH 1/1] Coverity scan fixes
---
iscsiuio/src/unix/libs/qedi.c | 2 +-
@ -12,10 +12,10 @@ Subject: [PATCH] Coverity scan fixes
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c
index 3414cb5..a359700 100644
index 1af8d1b..9a814c6 100644
--- a/iscsiuio/src/unix/libs/qedi.c
+++ b/iscsiuio/src/unix/libs/qedi.c
@@ -1023,7 +1023,7 @@ static int qedi_read(nic_t *nic, packet_t *pkt)
@@ -1030,7 +1030,7 @@ static int qedi_read(nic_t *nic, packet_t *pkt)
LOG_DEBUG(PFX "%s:hw_prod %d bd_prod %d, rx_pkt_idx %d, rxlen %d",
nic->log_name, hw_prod, bd_prod, rx_bd->rx_pkt_index, len);
@ -39,7 +39,7 @@ index 0c9ad49..f83f305 100644
/* Spin off the signal handling thread */
pthread_attr_init(&attr);
diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
index 7bc2381..7d4c338 100644
index 0910c63..6213e62 100644
--- a/libopeniscsiusr/idbm.c
+++ b/libopeniscsiusr/idbm.c
@@ -321,12 +321,11 @@ int _idbm_lock(struct iscsi_context *ctx)
@ -47,12 +47,12 @@ index 7bc2381..7d4c338 100644
}
- if (access(LOCK_DIR, F_OK) != 0) {
- if (mkdir(LOCK_DIR, 0660) != 0) {
- if (mkdir(LOCK_DIR, 0770) != 0) {
- _error(ctx, "Could not open %s: %d %s", LOCK_DIR, errno,
- _strerror(errno, strerr_buff));
- return LIBISCSI_ERR_IDBM;
- }
+ if (((mkdir(LOCK_DIR, 0660) != 0) && (errno != EEXIST)) ||
+ if (((mkdir(LOCK_DIR, 0770) != 0) && (errno != EEXIST)) ||
+ (access(LOCK_DIR, F_OK) != 0)) {
+ _error(ctx, "Could not open %s: %d %s", LOCK_DIR, errno,
+ _strerror(errno, strerr_buff));
@ -61,20 +61,20 @@ index 7bc2381..7d4c338 100644
fd = open(LOCK_FILE, O_RDWR | O_CREAT, 0666);
diff --git a/usr/idbm.c b/usr/idbm.c
index 2498a03..a4bc745 100644
index b33ae42..1ac0b73 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1439,12 +1439,10 @@ int idbm_lock(void)
@@ -1461,12 +1461,10 @@ int idbm_lock(void)
return 0;
}
- if (access(LOCK_DIR, F_OK) != 0) {
- if (mkdir(LOCK_DIR, 0660) != 0) {
- if (mkdir(LOCK_DIR, 0770) != 0) {
- log_error("Could not open %s: %s", LOCK_DIR,
- strerror(errno));
- return ISCSI_ERR_IDBM;
- }
+ if (((mkdir(LOCK_DIR, 0660) != 0) && (errno != EEXIST)) ||
+ if (((mkdir(LOCK_DIR, 0770) != 0) && (errno != EEXIST)) ||
+ (access(LOCK_DIR, F_OK) != 0)) {
+ log_error("Could not open %s: %s", LOCK_DIR, strerror(errno));
+ return ISCSI_ERR_IDBM;
@ -82,10 +82,10 @@ index 2498a03..a4bc745 100644
fd = open(LOCK_FILE, O_RDWR | O_CREAT, 0666);
diff --git a/usr/iscsid.c b/usr/iscsid.c
index e501498..dd94a16 100644
index dc54fec..fde8894 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -495,8 +495,8 @@ int main(int argc, char *argv[])
@@ -510,8 +510,8 @@ int main(int argc, char *argv[])
log_close(log_pid);
exit(ISCSI_ERR);
}
@ -96,5 +96,5 @@ index e501498..dd94a16 100644
if ((control_fd = ipc->ctldev_open()) < 0) {
log_close(log_pid);
--
2.26.2
2.26.3

View File

@ -1,29 +1,25 @@
From c852ca6300bc3fcf765744506222ff6da4296127 Mon Sep 17 00:00:00 2001
From b50ab4a08a12593985b14aece5f689e485647b1c Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Wed, 16 Oct 2019 23:17:20 -0700
Subject: [PATCH] fix upstream build breakage of iscsiuio LDFLAGS
Subject: [PATCH 1/1] fix upstream build breakage of iscsiuio LDFLAGS
---
iscsiuio/configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
iscsiuio/configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
index 8099f09..733214d 100644
index 9b85448..5dc188b 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
@@ -67,10 +67,10 @@ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
AC_ARG_WITH([systemd],
AS_HELP_STRING([--without-systemd], [Build without systemd]),
[case "${withval}" in
- yes) LDFLAGS="`pkg-config --libs libsystemd`" ;;
+ yes) LDFLAGS="${LDFLAGS} `pkg-config --libs libsystemd`" ;;
no) CFLAGS="${CFLAGS} -DNO_SYSTEMD" ;;
@@ -72,7 +72,7 @@ AC_ARG_WITH([systemd],
*) AC_MSG_ERROR([bad value $withval for --with-systemd]) ;;
- esac],[LDFLAGS="`pkg-config --libs libsystemd`"])
+ esac],[LDFLAGS="${LDFLAGS} `pkg-config --libs libsystemd`"])
AC_CONFIG_COMMANDS([default],[[
if [ -n "$SOURCE_DATE_EPOCH" ] ; then
esac],[with_libsystemd=auto])
AS_IF([test "$with_libsystemd" != no],[
- PKG_CHECK_MODULES([LIBSYSTEMD],[libsystemd],[LDFLAGS=$LIBSYSTEMD_LIBS],[
+ PKG_CHECK_MODULES([LIBSYSTEMD],[libsystemd],[LDFLAGS="$LDFLAGS $LIBSYSTEMD_LIBS"],[
if test "$with_libsystemd" = yes; then
AC_MSG_ERROR([could not find libsystemd using pkg-config])
else
--
2.26.2
2.26.3

View File

@ -1,25 +1,25 @@
From d7b7bd54b7d99ee865f629fac5f0b622d46e2c95 Mon Sep 17 00:00:00 2001
From 53886d75a93ee1747d84187a0498abcf6cebd210 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 21 Jan 2013 15:43:36 -0800
Subject: [PATCH] use Red Hat version string to match RPM package version
Subject: [PATCH 1/1] use Red Hat version string to match RPM package version
---
usr/version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/version.h b/usr/version.h
index 115a11c..1214f3b 100644
index 3c68989..8af23a4 100644
--- a/usr/version.h
+++ b/usr/version.h
@@ -6,7 +6,7 @@
* This may not be the same value as the kernel versions because
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.1.2"
+#define ISCSI_VERSION_STR "6.2.1.2"
-#define ISCSI_VERSION_STR "2.1.4"
+#define ISCSI_VERSION_STR "6.2.1.4"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif
--
2.26.2
2.26.3

View File

@ -0,0 +1,68 @@
From b8c6c1f3bed0e5fcc0d02c56834fa60850a11b5f Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Thu, 18 Feb 2021 14:04:32 -0800
Subject: [PATCH 1/1] minor service file updates
Intended use is with system presets to enable the following:
iscsi.service - login of automatic node records
iscsid.socket - start iscsid as needed for all iSCSI sessions
iscsiuio.socket - start iscsiuio as needed for bnx2i or qedi
iscsi-onboot.service - special handling of initramfs sessions
The following are started automatically as needed:
iscsid.service - needed for all iSCSI sessions
iscsiuio.service - needed for bnx2i or qedi offload
iscsi-init.service - create an iSCSI name if missing before starting iscsid
iscsi-shutdown.service - ensure all non-boot sessions logout at shutdown
---
etc/systemd/iscsi-init.service | 1 +
etc/systemd/iscsi.service | 2 +-
etc/systemd/iscsid.service | 3 +--
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/etc/systemd/iscsi-init.service b/etc/systemd/iscsi-init.service
index e058ff0..c3370ec 100644
--- a/etc/systemd/iscsi-init.service
+++ b/etc/systemd/iscsi-init.service
@@ -1,6 +1,7 @@
[Unit]
Description=One time configuration for iscsi.service
ConditionPathExists=!/etc/iscsi/initiatorname.iscsi
+Before=iscsid.service
[Service]
Type=oneshot
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
index 175cb2c..6c542d2 100644
--- a/etc/systemd/iscsi.service
+++ b/etc/systemd/iscsi.service
@@ -4,7 +4,7 @@ Documentation=man:iscsiadm(8) man:iscsid(8)
DefaultDependencies=no
Before=remote-fs-pre.target
After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service
-Wants=remote-fs-pre.target iscsi-shutdown.service
+Wants=remote-fs-pre.target
ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes
[Service]
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
index 324c593..df0bd83 100644
--- a/etc/systemd/iscsid.service
+++ b/etc/systemd/iscsid.service
@@ -4,7 +4,7 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
DefaultDependencies=no
After=network-online.target iscsiuio.service iscsi-init.service
Before=remote-fs-pre.target
-Requires=iscsi-init.service
+Requires=iscsi-init.service iscsi-shutdown.service
[Service]
Type=notify
@@ -15,4 +15,3 @@ Restart=on-failure
[Install]
WantedBy=multi-user.target
-Also=iscsid.socket
--
2.26.3

20
gating.yaml Normal file
View File

@ -0,0 +1,20 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,6 +1,6 @@
%global open_iscsi_version 2.1
%global open_iscsi_build 2
%global commit0 a8fcb3737cabcf79a3a3663f43930a158d606782
%global open_iscsi_build 4
%global commit0 2a8f9d81d0d6b5094c3fe9c686e2afb2ec27058a
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
# Disable python2 build by default
@ -9,9 +9,9 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
Release: 2.git%{shortcommit0}%{?dist}
Release: 3.git%{shortcommit0}%{?dist}
License: GPLv2+
URL: http://www.open-iscsi.org
URL: https://github.com/open-iscsi/open-iscsi
Source0: https://github.com/open-iscsi/open-iscsi/archive/%{commit0}.tar.gz#/open-iscsi-%{shortcommit0}.tar.gz
Source4: 04-iscsi
Source5: iscsi-tmpfiles.conf
@ -39,6 +39,9 @@ Patch0020: 0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch
Patch0021: 0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
Patch0022: 0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch
Patch0023: 0023-stop-using-Werror-for-now.patch
Patch0024: 0024-minor-service-file-updates.patch
Patch0025: 0001-Remove-dependences-from-iscsi-init.service.patch
Patch0026: 0001-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch
BuildRequires: flex bison doxygen kmod-devel systemd-units
BuildRequires: autoconf automake libtool libmount-devel openssl-devel
@ -61,27 +64,6 @@ as well as the utility programs used to manage it. iSCSI is a protocol
for distributed disk access using SCSI commands sent over Internet
Protocol networks.
# I don't think we're ready to expose these just yet
# For now just add the needed library to the base package
#%%package -n libopeniscsiusr
#Summary: library providing access to Open-iSCSI initiator functionality
#Group: Development/Libraries
#License: BSD
#%%description -n libopeniscsiusr
#The libopeniscsiusr library provides a C API for access to the Open-iSCSI
#initiator. It is used by the Open-iSCSI command line tools.
#%%package -n libopeniscsiusr-devel
#Summary: Development files for libopeniscsiusr
#Group: Development/Libraries
#Requires: libopeniscsiusr = %%{version}-%%{release}
#%%description -n libopeniscsiusr-devel
#The libopeniscsiusr-devel package contains libraries and header files for
#developing applications that use libopeniscsiusr.
%package iscsiuio
Summary: Userspace configuration daemon required for some iSCSI hardware
License: BSD
@ -119,6 +101,7 @@ Summary: Python %{python3_version} bindings to %{name}
Requires: %{name} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: make
%description -n python3-%{name}
The %{name}-python3 package contains Python %{python3_version} bindings to the
@ -217,20 +200,20 @@ popd
%post
%systemd_post iscsi.service iscsi-shutdown.service iscsid.service iscsid.socket
%systemd_post iscsi.service iscsid.service iscsid.socket iscsi-onboot.service iscsi-init.service iscsi-shutdown.service
%preun
%systemd_preun iscsi.service iscsid.service iscsid.socket iscsi-onboot.service iscsi-init.service iscsi-shutdown.service
%postun
%systemd_postun iscsi.service iscsid.service iscsid.socket iscsi-onboot.service iscsi-init.service iscsi-shutdown.service
%post iscsiuio
%systemd_post iscsiuio.service iscsiuio.socket
%preun
%systemd_preun iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
%preun iscsiuio
%systemd_preun iscsiuio.service iscsiuio.socket
%postun
%systemd_postun iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
%postun iscsiuio
%systemd_postun iscsiuio.service iscsiuio.socket
@ -269,7 +252,8 @@ fi
%dir %{_sharedstatedir}/iscsi/slp
%dir %{_sharedstatedir}/iscsi/ifaces
%dir %{_sharedstatedir}/iscsi/send_targets
%ghost %{_rundir}/lock/iscsi
%ghost %attr(0700, root, root) %{_rundir}/lock/iscsi
%ghost %attr(0600, root, root) %{_rundir}/lock/iscsi/lock
%{_unitdir}/iscsi.service
%{_unitdir}/iscsi-onboot.service
%{_unitdir}/iscsi-init.service
@ -290,26 +274,7 @@ fi
%{_mandir}/man8/iscsiadm.8.gz
%{_mandir}/man8/iscsid.8.gz
%{_mandir}/man8/iscsistart.8.gz
# until we decide to setup libopeniscsiusr as a subpkg for real
%{_libdir}/libopeniscsiusr.so.*
%exclude %{_libdir}/libopeniscsiusr.so
%exclude %{_includedir}/libopeniscsiusr.h
%exclude %{_includedir}/libopeniscsiusr_common.h
%exclude %{_includedir}/libopeniscsiusr_iface.h
%exclude %{_includedir}/libopeniscsiusr_node.h
%exclude %{_includedir}/libopeniscsiusr_session.h
%exclude %{_libdir}/pkgconfig/libopeniscsiusr.pc
# %%files -n libopeniscsiusr
# %%{_libdir}/libopeniscsiusr.so.*
#
# %%files -n libopeniscsiusr-devel
# %%{_libdir}/libopeniscsiusr.so
# %%{_includedir}/libopeniscsiusr.h
# %%{_includedir}/libopeniscsiusr_common.h
# %%{_includedir}/libopeniscsiusr_iface.h
# %%{_includedir}/libopeniscsiusr_session.h
# %%{_libdir}/pkgconfig/libopeniscsiusr.pc
%files iscsiuio
%{_sbindir}/iscsiuio
@ -322,6 +287,13 @@ fi
%doc libiscsi/html
%{_libdir}/libiscsi.so
%{_includedir}/libiscsi.h
%{_libdir}/libopeniscsiusr.so
%{_includedir}/libopeniscsiusr.h
%{_includedir}/libopeniscsiusr_common.h
%{_includedir}/libopeniscsiusr_iface.h
%{_includedir}/libopeniscsiusr_node.h
%{_includedir}/libopeniscsiusr_session.h
%{_libdir}/pkgconfig/libopeniscsiusr.pc
%if %{with python2}
%files -n python2-%{name}
@ -333,6 +305,36 @@ fi
%{python3_sitearch}/*
%changelog
* Wed Jun 15 2022 Chris Leech <cleech@redhat.com> - 6.2.1.4-3.git2a8f9d8
- 2016611 fix libiscsi regression causing udisksd faults with firmware discovery
* Mon Nov 01 2021 Chris Leech <cleech@redhat.com> - 6.2.1.4-2.git2a8f9d8
- 2016482: iscsi-init.service modified to work in initramfs
* Wed Aug 11 2021 Chris Leech <cleech@redhat.com> - 6.2.1.4-1.git2a8f9d8
- new upstream
- iscsiuio fixes for newer upstream bnx2x driver having version removed
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 6.2.1.2-8.gita8fcb37
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.2.1.2-7.gita8fcb37
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.2.1.2-6.gita8fcb37
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Feb 18 2021 Chris Leech <cleech@redhat.com> - 6.2.1.2-5.gita8fcb37
- unit file changes
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.1.2-4.gita8fcb37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 05 2020 Chris Leech <cleech@redhat.com> - 6.2.1.2-3.gita8fcb37
- add libopeniscsiusr content to iscsi-initiator-utils-devel
* Mon Sep 21 2020 Chris Leech <cleech@redhat.com> - 6.2.1.2-1.git13e7f58
- iscsiadm overflow regression when discovering many targets at once
- check for invalid session id during stop connection

View File

@ -1 +1 @@
SHA512 (open-iscsi-a8fcb37.tar.gz) = 56f41e3fcc9f5b14adc5288c420361e1be57c1a235035f343760208d2c0c5d31f6c53478d0438e16475d2afcb5148ca7c334e97b37f715961815edd4846ef439
SHA512 (open-iscsi-2a8f9d8.tar.gz) = dd405c1463315b712e9dc3065c00778d117505f1ca7127ce469d9ff85e3f73009000ab26f5ec4cd9554e87b728fae4e48811fe4e7ab20ac59acee443779e617e

View File

@ -0,0 +1,62 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /kernel/test_beakertask/Sanity/beaker_nvr_test
# Description: Install VDO
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/beaker_nvr_test
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Andy Walsh <awalsh@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Creates iSCSI target/initiator, and logs it in locally" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: test_beakertask" >> $(METADATA)
@echo "Requires: test_beakertask" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE Create an iSCSI target/initiator environment
Description: Set up and Log into an iSCSI target locally.
Author: Andy Walsh <awalsh@redhat.com>

View File

@ -0,0 +1,118 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh for iSCSI target/initiator test
# Description: Set up and Log into an iSCSI target locally.
# Author: Andy Walsh <awalsh@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
# Set up a target IQN to use through the test.
targetIQN=iqn.2019-03.com.redhat.test:testtargetname
targetIP=127.0.0.1
# Minimum size required for loopback device. Sometimes software (like VDO)
# needs more than ~10G.
minimumSize=15
rlJournalStart
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
# Determine the size of the loopback device we're going to use
# (Free space on rootfs minus 1G)
loopbackSize=$(($(df --sync --output=avail / | tail -1) * 1024 - 1024*1024*1024))
if [ ${loopbackSize} -lt $((1024*1024*1024*${minimumSize})) ]; then
rlDie "Not enough space to create the loopback device"
fi
# Create the backing store and then set up the loopback device.
rlRun "truncate -s ${loopbackSize} $TmpDir/loop0.bin" 0 "Laying out loopfile backing"
rlRun "losetup /dev/loop0 $TmpDir/loop0.bin" 0 "Creating loopdevice"
# Check whether we have the iscsi utilities installed, and if we don't,
# then install them. If this is being tested in OSCI, I believe that
# the package will be pre-installed when we get to this point.
if ! rlCheckRpm iscsi-initiator-utils; then
yum install -y iscsi-initiator-utils
fi
if ! rlCheckRpm targetcli; then
yum install -y targetcli
fi
if [ -f /etc/iscsi/initiatorname.iscsi ]; then
. /etc/iscsi/initiatorname.iscsi
else
echo "InitiatorName=`/usr/sbin/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi
. /etc/iscsi/initiatorname.iscsi
fi
# Make sure the target service is running.
rlRun "systemctl start target"
rlPhaseEnd
rlPhaseStartTest
# Gather some system information for debug purposes
rlRun "uname -a"
rlPhaseEnd
rlPhaseStartTest "Set up target"
rlRun "targetcli backstores/block create name=loopback_device dev=/dev/loop0"
rlRun "targetcli iscsi/ create ${targetIQN}"
rlRun "targetcli iscsi/${targetIQN}/tpg1/acls create ${InitiatorName}"
rlRun "targetcli iscsi/${targetIQN}/tpg1/luns create lun=100 /backstores/block/loopback_device"
rlPhaseEnd
rlPhaseStartTest "Set up initiator (Log into target)"
rlRun "iscsiadm --mode discovery --type sendtargets --portal ${targetIP}"
rlRun "iscsiadm --mode node --target ${targetIQN} -l"
# Occasionally logging into the iSCSI target and checking for the LUNs
# being presented and handled by udev seems to falsely cause the next check
# to fail. Adding a short sleep seems to fix that.
sleep 1
if [ ! -L /dev/disk/by-path/ip-${targetIP}\:3260-iscsi-${targetIQN}-lun-100 ]; then
rlFail "iSCSI LUN not found"
fi
rlPhaseEnd
rlPhaseStartCleanup
# Log out of the target and tear down the iSCSI target configuration
rlRun "iscsiadm --mode node -u"
rlRun "targetcli iscsi/ delete ${targetIQN}"
rlRun "targetcli backstores/block delete loopback_device"
rlRun "losetup -d /dev/loop0" 0 "Deleting loopdevice"
rlRun "rm -f $TmpDir/loop0.bin" 0 "Removing loopfile backing"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

5
tests/provision.fmf Normal file
View File

@ -0,0 +1,5 @@
---
standard-inventory-qcow2:
qemu:
m: 2G

37
tests/tests.yml Normal file
View File

@ -0,0 +1,37 @@
---
# Tests suitable to run in classic environment
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- iscsi-target-initiator-restraint
required_packages:
- targetcli
- hosts: localhost
roles:
- role: standard-test-basic
# python-stqe cannot be installed on 'atomic', no need to run on 'container'
tags:
- classic
repositories:
- repo: "https://gitlab.com/rh-kernel-stqe/python-stqe.git"
dest: "python-stqe"
version: 535ecebf5611e158079d806b6232e3d2c68f0d93
tests:
# Install python-stqe first
# make sure we use same version of libsan
- install_stqe:
dir: python-stqe
run: pip3 install libsan==0.3.0 && python3 setup.py install --prefix=
- iscsi-initiator-utils:
dir: ./
run: stqe-test run -t iscsi/iscsi_params.py
required_packages:
# required for python-stqe
- python3-pyyaml
- python3-netifaces
- python3-augeas
- python3-pip