From 0f71b7604d4dbebfd6ef461e33e39e44e3f2dc64 Mon Sep 17 00:00:00 2001 From: ttgump Date: Mon, 16 Sep 2013 11:12:18 -0400 Subject: [PATCH] fix of connection refused --- tests/integration/test_indefinite_freeze_attack.py | 6 +++--- tests/integration/test_mix_and_match_attack.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_indefinite_freeze_attack.py b/tests/integration/test_indefinite_freeze_attack.py index bb1a4a8c..2ad23f3c 100755 --- a/tests/integration/test_indefinite_freeze_attack.py +++ b/tests/integration/test_indefinite_freeze_attack.py @@ -130,11 +130,11 @@ def test_indefinite_freeze_attack(TUF=False): # Try downloading again, this should raise an error. try: - _download(url=url_to_repo, filename=downloaded_file, using_tuf=TUF) + _download(url=url_to_repo, filename=downloaded_file, using_tuf=TUF) except tuf.ExpiredMetadataError, error: - print('Caught an expiration error!') + print('Caught an expiration error!') else: - raise IndefiniteFreezeAttackAlert(ERROR_MSG) + raise IndefiniteFreezeAttackAlert(ERROR_MSG) finally: util_test_tools.cleanup(root_repo, server_proc) diff --git a/tests/integration/test_mix_and_match_attack.py b/tests/integration/test_mix_and_match_attack.py index 5bf98db9..db62a727 100755 --- a/tests/integration/test_mix_and_match_attack.py +++ b/tests/integration/test_mix_and_match_attack.py @@ -38,6 +38,7 @@ import shutil import urllib import tempfile +import time import tuf import tuf.interposition @@ -125,6 +126,8 @@ def test_mix_and_match_attack(TUF=False): url_to_file = 'http://localhost:9999/'+file_basename + # Wait for some time to let program set up local http server + time.sleep(1) # Client's initial download. _download(url=url_to_file, filename=downloaded_file, using_tuf=TUF)