BIND 10 master, updated. 50b124aea4fc6c367ee64acb81041384c169906e [master] Fix test: remove sleep, use fake mtime

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 12 11:34:30 UTC 2013


The branch, master has been updated
       via  50b124aea4fc6c367ee64acb81041384c169906e (commit)
      from  e8e45c21b3a6a6c8169259ea5d66d8d475bfbfa6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 50b124aea4fc6c367ee64acb81041384c169906e
Author: Jelte Jansen <jelte at isc.org>
Date:   Tue Mar 12 11:34:09 2013 +0000

    [master] Fix test: remove sleep, use fake mtime

-----------------------------------------------------------------------

Summary of changes:
 src/bin/cmdctl/tests/cmdctl_test.py |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/cmdctl/tests/cmdctl_test.py b/src/bin/cmdctl/tests/cmdctl_test.py
index 16d76c2..dd1a6f2 100644
--- a/src/bin/cmdctl/tests/cmdctl_test.py
+++ b/src/bin/cmdctl/tests/cmdctl_test.py
@@ -580,12 +580,11 @@ class TestSecureHTTPServer(unittest.TestCase):
             self.server._create_user_info(accounts_file)
             self.assertEqual(fake_users_val, self.server._user_infos)
 
-        # Yes sleep sucks, but in this case we need it to check for
-        # a changed mtime, not for some thread to do its work
-        # (do we run these tests on systems with 1+ secs mtimes?)
-        time.sleep(0.1)
         # create the file again, this time read should not be a noop
         with TmpTextFile(accounts_file, ['otherroot,foo,bar']):
+            # Set mtime in future
+            stat = os.stat(accounts_file)
+            os.utime(accounts_file, (stat.st_atime, stat.st_mtime + 10))
             self.server._create_user_info(accounts_file)
             self.assertEqual(1, len(self.server._user_infos))
             self.assertTrue('otherroot' in self.server._user_infos)



More information about the bind10-changes mailing list