selftest: Fix flapping samba.dsdb test
authorAndrew Bartlett <abartlet@samba.org>
Wed, 13 Dec 2017 01:46:00 +0000 (14:46 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 13 Dec 2017 03:47:37 +0000 (04:47 +0100)
The check for the final digit in the SID was wrong, any domain SID
ending with a zero would fail the test.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/dsdb.py

index 34a9435ea445a7d0e24c2e230bced757285663e4..0b3c1927504e4d82f657c296fefb2a1542260e27 100644 (file)
@@ -207,7 +207,7 @@ class DsdbTests(TestCase):
         # i.e a  SID not in the current domain.
         #
         dom_sid = self.samdb.get_domain_sid()
         # i.e a  SID not in the current domain.
         #
         dom_sid = self.samdb.get_domain_sid()
-        if str(dom_sid)[:-1] == "0":
+        if str(dom_sid).endswith("0"):
             c = "9"
         else:
             c = "0"
             c = "9"
         else:
             c = "0"