Tomas Bzatek 6c6835
commit 1bf172603e4cc77da70d8fd13b6ba6c8b8c91600
Tomas Bzatek 6c6835
Author: Tomas Bzatek <tbzatek@redhat.com>
Tomas Bzatek 6c6835
Date:   Thu Oct 20 17:53:20 2022 +0200
Tomas Bzatek 6c6835
Tomas Bzatek 6c6835
    tests: Test iscsi noauth in test_login_chap_auth
Tomas Bzatek 6c6835
    
Tomas Bzatek 6c6835
    The other way is already tested in test_login_noauth_badauth.
Tomas Bzatek 6c6835
Tomas Bzatek 6c6835
diff --git a/src/tests/dbus-tests/test_30_iscsi.py b/src/tests/dbus-tests/test_30_iscsi.py
Tomas Bzatek 6c6835
index 2b75462a..f2594d99 100644
Tomas Bzatek 6c6835
--- a/src/tests/dbus-tests/test_30_iscsi.py
Tomas Bzatek 6c6835
+++ b/src/tests/dbus-tests/test_30_iscsi.py
Tomas Bzatek 6c6835
@@ -151,8 +151,14 @@ class UdisksISCSITest(udiskstestcase.UdisksTestCase):
Tomas Bzatek 6c6835
         options = dbus.Dictionary(signature='sv')
Tomas Bzatek 6c6835
         options['username'] = self.initiator
Tomas Bzatek 6c6835
 
Tomas Bzatek 6c6835
+        msg = 'Login failed: initiator reported error \(24 - iSCSI login failed due to authorization failure\)'
Tomas Bzatek 6c6835
+        # missing auth info
Tomas Bzatek 6c6835
+        with six.assertRaisesRegex(self, dbus.exceptions.DBusException, msg):
Tomas Bzatek 6c6835
+            manager.Login(iqn, tpg, host, port, iface, self.no_options,
Tomas Bzatek 6c6835
+                          dbus_interface=self.iface_prefix + '.Manager.ISCSI.Initiator',
Tomas Bzatek 6c6835
+                          timeout=self.iscsi_timeout)
Tomas Bzatek 6c6835
+
Tomas Bzatek 6c6835
         # wrong password
Tomas Bzatek 6c6835
-        msg = 'Login failed: initiator reported error'
Tomas Bzatek 6c6835
         with six.assertRaisesRegex(self, dbus.exceptions.DBusException, msg):
Tomas Bzatek 6c6835
             options['password'] = '12345'
Tomas Bzatek 6c6835
             manager.Login(iqn, tpg, host, port, iface, options,
Tomas Bzatek 6c6835
@@ -318,7 +324,7 @@ class UdisksISCSITest(udiskstestcase.UdisksTestCase):
Tomas Bzatek 6c6835
         # first attempt - wrong password
Tomas Bzatek 6c6835
         options = dbus.Dictionary(signature='sv')
Tomas Bzatek 6c6835
         options['username'] = self.initiator
Tomas Bzatek 6c6835
-        msg = 'Login failed: initiator reported error'
Tomas Bzatek 6c6835
+        msg = r'Login failed: initiator reported error \((19 - encountered non-retryable iSCSI login failure|24 - iSCSI login failed due to authorization failure)\)'
Tomas Bzatek 6c6835
         with six.assertRaisesRegex(self, dbus.exceptions.DBusException, msg):
Tomas Bzatek 6c6835
             options['password'] = '12345'
Tomas Bzatek 6c6835
             manager.Login(iqn, tpg, host, port, iface, options,