]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests/krb5: let check_device_info() allow an empty rid array
authorStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2025 13:14:51 +0000 (14:14 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 3 Apr 2025 09:36:31 +0000 (09:36 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
python/samba/tests/krb5/raw_testcase.py

index e1de6b23d9030fb9fc44458f665a467ebd92c6dc..e5f155fd55c900bb59cce90ccad94426c15929ca 100644 (file)
@@ -4569,7 +4569,8 @@ class RawKerberosTest(TestCase):
 
         # Collect the groups.
         if device_info.groups.rids is not None:
-            self.assertTrue(device_info.groups.rids, 'got empty RIDs')
+            self.assertEqual(len(device_info.groups.rids),
+                             device_info.groups.count)
 
             for group in device_info.groups.rids:
                 got_sid = f'{device_domain_sid}-{group.rid}'
@@ -4581,6 +4582,8 @@ class RawKerberosTest(TestCase):
                         continue
                 self.assertNotIn(device_sid, got_sids, 'got duplicated SID')
                 got_sids.add(device_sid)
+        else:
+            self.assertEqual(device_info.groups.count, 0)
 
         # Collect the SIDs.
         if device_info.sids is not None: