From 43a6e116c9576c649c19df86cdf61894b83a455d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 1 Nov 2022 17:30:40 +0100 Subject: [PATCH] * Tue Nov 01 2022 Tomas Bzatek - 2.9.4-7 - Fix iscsi test auth failures (#1958932) Resolves: #1958932 --- ...-2.10.0-iscsi_test_05_restart_iscsid.patch | 42 +++++++++++++++++++ udisks2.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 udisks-2.10.0-iscsi_test_05_restart_iscsid.patch diff --git a/udisks-2.10.0-iscsi_test_05_restart_iscsid.patch b/udisks-2.10.0-iscsi_test_05_restart_iscsid.patch new file mode 100644 index 0000000..eeb5e19 --- /dev/null +++ b/udisks-2.10.0-iscsi_test_05_restart_iscsid.patch @@ -0,0 +1,42 @@ +From fbe970add68e6d9d998fb7f78377368c403e200d Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Mon, 31 Oct 2022 15:15:31 +0100 +Subject: [PATCH] tests: Restart iscsid on every InitiatorName change + +The test LIO target config expects a specific initiator name as set +by the ACLs. However the iscsid daemon only seems to be reading +the InitiatorName string on startup and in case the service is running +with a different name, the auth tests will fail. + +As a workaround, restart the iscsid service after each change. +A proper way through libiscsi or libopeniscsiusr would be nice -> TODO. +--- + src/tests/dbus-tests/test_30_iscsi.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/tests/dbus-tests/test_30_iscsi.py b/src/tests/dbus-tests/test_30_iscsi.py +index f2594d992..09e975f30 100644 +--- a/src/tests/dbus-tests/test_30_iscsi.py ++++ b/src/tests/dbus-tests/test_30_iscsi.py +@@ -48,9 +48,21 @@ def _force_lougout(self, target): + def _set_initiator_name(self): + manager = self.get_object('/Manager') + ++ # make backup of INITIATOR_FILE and restore it at the end ++ try: ++ initiatorname_backup = self.read_file(INITIATOR_FILE) ++ self.addCleanup(self.write_file, INITIATOR_FILE, initiatorname_backup) ++ except FileNotFoundError as e: ++ # no existing file, simply remove it once finished ++ self.addCleanup(self.remove_file, INITIATOR_FILE, True) ++ + manager.SetInitiatorName(self.initiator, self.no_options, + dbus_interface=self.iface_prefix + '.Manager.ISCSI.Initiator') + ++ # running iscsid needs to be restarted to reflect the change ++ self.run_command('systemctl try-reload-or-restart iscsid.service') ++ # ignore the return code in case of non-systemd distros ++ + init = manager.GetInitiatorName(self.no_options, + dbus_interface=self.iface_prefix + '.Manager.ISCSI.Initiator') + self.assertEqual(init, self.initiator) diff --git a/udisks2.spec b/udisks2.spec index 256de29..aa3913a 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -48,7 +48,7 @@ Name: udisks2 Summary: Disk Manager Version: 2.9.4 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: https://github.com/storaged-project/udisks Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2 @@ -69,6 +69,8 @@ Patch10: udisks-2.10.0-iscsi_test_01_badauth.patch Patch11: udisks-2.10.0-iscsi_test_02_lio_target_conf.patch Patch12: udisks-2.10.0-iscsi_test_03_iscsid_cache_clean.patch Patch13: udisks-2.10.0-iscsi_test_04_fix_test_login_chap_auth.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1958932 +Patch14: udisks-2.10.0-iscsi_test_05_restart_iscsid.patch BuildRequires: make BuildRequires: glib2-devel >= %{glib2_version} @@ -444,6 +446,9 @@ fi %endif %changelog +* Tue Nov 01 2022 Tomas Bzatek - 2.9.4-7 +- Fix iscsi test auth failures (#1958932) + * Fri Oct 21 2022 Tomas Bzatek - 2.9.4-6 - Fix iscsi test LIO target config (#2136557)