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
This commit is contained in:
Chris Leech 2021-04-13 12:06:29 -07:00
parent 06df70a3c7
commit ee5dab0d53
16 changed files with 343 additions and 99 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

@ -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

@ -1,4 +1,4 @@
From 3770c9a12d85bd4a990430faa7889b7692d5c6ac Mon Sep 17 00:00:00 2001
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
@ -17,8 +17,8 @@ The following are started automatically as needed:
---
etc/systemd/iscsi-init.service | 1 +
etc/systemd/iscsi.service | 2 +-
etc/systemd/iscsid.service | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
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
@ -46,22 +46,23 @@ index 175cb2c..6c542d2 100644
[Service]
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
index 28402fb..8b7434f 100644
index 324c593..df0bd83 100644
--- a/etc/systemd/iscsid.service
+++ b/etc/systemd/iscsid.service
@@ -4,6 +4,7 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
@@ -4,7 +4,7 @@ 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
-Requires=iscsi-init.service
+Requires=iscsi-init.service iscsi-shutdown.service
[Service]
Type=notify
@@ -14,4 +15,3 @@ Restart=on-failure
@@ -15,4 +15,3 @@ Restart=on-failure
[Install]
WantedBy=multi-user.target
-Also=iscsid.socket
--
2.26.2
2.26.3

View File

@ -1,4 +1,18 @@
--- !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

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: 8.git%{shortcommit0}%{?dist}
Release: 1.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
@ -250,7 +250,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
@ -302,6 +303,10 @@ fi
%{python3_sitearch}/*
%changelog
* 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

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