From ab4cbdde528a4eff071610290f6320e7d074d422 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 14 Mar 2016 18:08:24 -0400 Subject: [PATCH] guaranteed test failure: unprintable on 3, printable on 2 --- tests/test_indefinite_freeze_attack.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_indefinite_freeze_attack.py b/tests/test_indefinite_freeze_attack.py index b6b1cd03..b4251ba8 100755 --- a/tests/test_indefinite_freeze_attack.py +++ b/tests/test_indefinite_freeze_attack.py @@ -295,9 +295,9 @@ def test_with_tuf(self): time.sleep(0.1) - # Expire snapshot in 3s + # Expire snapshot in 0s datetime_object = tuf.formats.unix_timestamp_to_datetime(int(time.time() + - 3)) + 0)) repository.snapshot.expiration = datetime_object # Now write to the repository @@ -313,11 +313,11 @@ def test_with_tuf(self): logger.info('Test: Refreshing #1 - Initial metadata refresh occurring.') self.repository_updater.refresh() logger.info("Test: Refreshed #1 - Initial metadata refresh completed " - "successfully. Now sleeping 3s so snapshot metadata expires.") + "successfully. Now sleeping 6s so snapshot metadata expires.") - # Sleep for at least 7 seconds to ensure 'repository.snapshot.expiration' + # Sleep for at least 2 seconds to ensure 'repository.snapshot.expiration' # is reached. - time.sleep(3) + time.sleep(2) logger.info("Test: Refreshing #2 - Now trying to refresh again after local " "snapshot expiry.") try: @@ -361,8 +361,8 @@ def test_with_tuf(self): repository.timestamp.load_signing_key(timestamp_private) - # expire in 3 seconds. - datetime_object = tuf.formats.unix_timestamp_to_datetime(int(time.time() + 3)) + # expire in 2 seconds. + datetime_object = tuf.formats.unix_timestamp_to_datetime(int(time.time() + 2)) repository.timestamp.expiration = datetime_object repository.write() @@ -374,7 +374,7 @@ def test_with_tuf(self): # Verify that the TUF client detects outdated metadata and refuses to # continue the update process. Sleep for at least 3 seconds to ensure # 'repository.timestamp.expiration' is reached. - time.sleep(3) + time.sleep(2) try: self.repository_updater.refresh()