From be79b0884eb7ba91836c5296aec92cf6066be767 Mon Sep 17 00:00:00 2001 From: gholt Date: Wed, 27 Jun 2012 05:01:55 +0000 Subject: [PATCH] Fixes for probe tests Updated the imports and added a head_account to the "is the cluster started yet?" checks. Hopefully this fixes the notorious timing issues of these tests where auth answers requests just a bit before the rest of the cluster is ready. Fixes bug 1014931 Change-Id: Iea1d62db2317560371da49af5e94a0279b646294 --- test/probe/common.py | 3 ++- test/probe/test_account_failures.py | 3 ++- test/probe/test_container_failures.py | 3 ++- test/probe/test_object_async_update.py | 3 ++- test/probe/test_object_failures.py | 3 ++- test/probe/test_object_handoff.py | 3 ++- test/probe/test_running_with_each_type_down.py | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/test/probe/common.py b/test/probe/common.py index d11fdfcd9c..a978966418 100644 --- a/test/probe/common.py +++ b/test/probe/common.py @@ -19,7 +19,7 @@ from subprocess import call, Popen from time import sleep from swift.common.bufferedhttp import http_connect_raw as http_connect -from swiftclient import get_auth +from swiftclient import get_auth, head_account from swift.common.ring import Ring @@ -54,6 +54,7 @@ def reset_environment(): url, token = get_auth('http://127.0.0.1:8080/auth/v1.0', 'test:tester', 'testing') account = url.split('/')[-1] + head_account(url, token) break except Exception, err: if attempt > 9: diff --git a/test/probe/test_account_failures.py b/test/probe/test_account_failures.py index 33320ec7a5..2458ef03c9 100755 --- a/test/probe/test_account_failures.py +++ b/test/probe/test_account_failures.py @@ -20,7 +20,8 @@ from signal import SIGTERM from subprocess import Popen from time import sleep -from swift.common import client, direct_client +from swiftclient import client +from swift.common import direct_client from test.probe.common import get_to_final_state, kill_pids, reset_environment diff --git a/test/probe/test_container_failures.py b/test/probe/test_container_failures.py index 7be2ab3a17..33b587a318 100755 --- a/test/probe/test_container_failures.py +++ b/test/probe/test_container_failures.py @@ -24,7 +24,8 @@ from uuid import uuid4 import eventlet import sqlite3 -from swift.common import client, direct_client +from swiftclient import client +from swift.common import direct_client from swift.common.utils import hash_path, readconf from test.probe.common import get_to_final_state, kill_pids, reset_environment diff --git a/test/probe/test_object_async_update.py b/test/probe/test_object_async_update.py index f1ca69da3a..79429ba46f 100755 --- a/test/probe/test_object_async_update.py +++ b/test/probe/test_object_async_update.py @@ -21,7 +21,8 @@ from subprocess import Popen from time import sleep from uuid import uuid4 -from swift.common import client, direct_client +from swiftclient import client +from swift.common import direct_client from test.probe.common import kill_pids, reset_environment diff --git a/test/probe/test_object_failures.py b/test/probe/test_object_failures.py index 64b3bc43b0..b106cb5530 100755 --- a/test/probe/test_object_failures.py +++ b/test/probe/test_object_failures.py @@ -18,7 +18,8 @@ import unittest import os from uuid import uuid4 -from swift.common import client, direct_client +from swiftclient import client +from swift.common import direct_client from swift.common.utils import hash_path, readconf from swift.obj.server import write_metadata, read_metadata from test.probe.common import kill_pids, reset_environment diff --git a/test/probe/test_object_handoff.py b/test/probe/test_object_handoff.py index 47ff8a4fad..fa30fe324d 100755 --- a/test/probe/test_object_handoff.py +++ b/test/probe/test_object_handoff.py @@ -21,7 +21,8 @@ from subprocess import call, Popen from time import sleep from uuid import uuid4 -from swift.common import client, direct_client +from swiftclient import client +from swift.common import direct_client from test.probe.common import kill_pids, reset_environment diff --git a/test/probe/test_running_with_each_type_down.py b/test/probe/test_running_with_each_type_down.py index 394c42da10..0b9ba43afc 100755 --- a/test/probe/test_running_with_each_type_down.py +++ b/test/probe/test_running_with_each_type_down.py @@ -20,7 +20,7 @@ from signal import SIGTERM from subprocess import Popen from time import sleep -from swift.common import client +from swiftclient import client from test.probe.common import get_to_final_state, kill_pids, reset_environment