diff options
author | Tim Beale <timbeale@catalyst.net.nz> | 2018-11-20 17:30:37 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-11-23 05:00:22 +0100 |
commit | 1a45e5b136bedfed1fa3a8b87b79da759c3958c4 (patch) | |
tree | 28fa23c0c2ea74a7fbda9ace0e1b71d2782e621a /source4 | |
parent | b8ff4a0881bd6a12ba43ece27b8d3d9e5750b81f (diff) | |
download | samba-1a45e5b136bedfed1fa3a8b87b79da759c3958c4.tar.gz |
tests: Fix flappiness in DRS tests due to RID Set changing
The test_link_utdv_hwm test case in getnc_exop has started getting
slightly flappy (8 failures in the last 2 weeks). The problem is the
test case creates a new computer, which can occasionally result in a new
RID pool being allocated.
The problem can be reproduced by running the test case repeatedly (it
usually fails after ~250 times).
This patch updates the _check_ctr6() assertion to filter out the 'CN=RID
Set' object, if it happens to be present.
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/drs/python/drs_base.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index 77abd439794..d19e625021b 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -384,9 +384,20 @@ class DrsBaseTestCase(SambaToolCmdTest): """ Check that a ctr6 matches the specified parameters. """ - ctr6_dns = self._get_ctr6_dn_list(ctr6) - self.assertEqual(ctr6.object_count, len(expected_dns), + ctr6_raw_dns = self._get_ctr6_dn_list(ctr6) + + # filter out changes to the RID Set objects, as these can happen + # intermittently and mess up the test assertions + ctr6_dns = [] + for dn in ctr6_raw_dns: + if "CN=RID Set," in dn or "CN=RID Manager$," in dn: + print("Removing {0} from GetNCChanges reply".format(dn)) + else: + ctr6_dns.append(dn) + + self.assertEqual(len(ctr6_dns), len(expected_dns), "Received unexpected objects (%s)" % ctr6_dns) + self.assertEqual(ctr6.object_count, len(ctr6_raw_dns)) self.assertEqual(ctr6.linked_attributes_count, len(expected_links)) self.assertEqual(ctr6.more_data, more_data) self.assertEqual(ctr6.nc_object_count, nc_object_count) |