summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2018-05-15 12:26:03 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-05-15 23:58:17 +0200
commit5ebe3183fded1ab060ed60baeedeac859d0c137e (patch)
tree021f081aea1bb66edb849114695f1213808b26e9 /python
parent72e18d671c48045cbc162e0650926e4038fcbb3f (diff)
downloadsamba-5ebe3183fded1ab060ed60baeedeac859d0c137e.tar.gz
samba-5ebe3183fded1ab060ed60baeedeac859d0c137e.tar.bz2
samba-5ebe3183fded1ab060ed60baeedeac859d0c137e.zip
selftest: Make setexpiry test much more reliable
Rather than setting all the expiries and expecting that they will be done within 5 seconds, measure and check the time individually for each record. This should make this test much less prone to flapping. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue May 15 23:58:17 CEST 2018 on sn-devel-144
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/samba_tool/user.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py
index aaeafee71cd..f99288a7cb8 100644
--- a/python/samba/tests/samba_tool/user.py
+++ b/python/samba/tests/samba_tool/user.py
@@ -306,9 +306,9 @@ class UserCmdTestCase(SambaToolCmdTest):
def test_setexpiry(self):
- twodays = time.time() + (2 * 24 * 60 * 60)
-
for user in self.users:
+ twodays = time.time() + (2 * 24 * 60 * 60)
+
(result, out, err) = self.runsubcmd("user", "setexpiry", user["name"],
"--days=2",
"-H", "ldap://%s" % os.environ["DC_SERVER"],
@@ -316,7 +316,6 @@ class UserCmdTestCase(SambaToolCmdTest):
self.assertCmdSuccess(result, out, err, "Can we run setexpiry with names")
self.assertIn("Expiry for user '%s' set to 2 days." % user["name"], out)
- for user in self.users:
found = self._find_user(user["name"])
expires = nttime2unix(int("%s" % found.get("accountExpires")))