summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2012-05-01 13:58:06 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2012-05-01 13:58:06 +0000
commit608cc9a199f31487ac290b03dfbc6d90dfaf9e06 (patch)
tree4417b9eeb8708223b66081121a35ac45aecead8a
parent9b29a602435ffb85517a2b6989dc0018b86c10b9 (diff)
downloadqpid-python-608cc9a199f31487ac290b03dfbc6d90dfaf9e06.tar.gz
QPID-3963: fix test, add cluster log filters for link and broker state
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1332659 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/src/tests/cluster_test_logs.py6
-rwxr-xr-xqpid/cpp/src/tests/cluster_tests.py33
2 files changed, 22 insertions, 17 deletions
diff --git a/qpid/cpp/src/tests/cluster_test_logs.py b/qpid/cpp/src/tests/cluster_test_logs.py
index 3c7e8e8020..003d82c619 100755
--- a/qpid/cpp/src/tests/cluster_test_logs.py
+++ b/qpid/cpp/src/tests/cluster_test_logs.py
@@ -60,11 +60,13 @@ def filter_log(log):
'task late',
'task overran',
'warning CLOSING .* unsent data',
- 'Inter-broker link ',
+ 'Inter-broker link ', # ignore link state changes
+ 'Updated link key from ', # ignore link state changes
'Running in a cluster, marking store',
'debug Sending keepalive signal to watchdog', # Watchdog timer thread
'last broker standing joined by 1 replicas, updating queue policies.',
- 'Connection .* timed out: closing' # heartbeat connection close
+ 'Connection .* timed out: closing', # heartbeat connection close
+ "org.apache.qpid.broker:bridge:" # ignore bridge index
])
# Regex to match a UUID
uuid='\w\w\w\w\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w\w\w\w\w\w\w\w\w'
diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py
index 28dbe62666..8952f5de7b 100755
--- a/qpid/cpp/src/tests/cluster_tests.py
+++ b/qpid/cpp/src/tests/cluster_tests.py
@@ -810,10 +810,10 @@ acl deny all all
self.assertTrue(active, "Bridge failed to become active")
- # 1 node cluster source, 1 node cluster destination
- src_cluster = self.cluster(1, expect=EXPECT_EXIT_FAIL)
+ # 2 node cluster source, 2 node cluster destination
+ src_cluster = self.cluster(2, expect=EXPECT_EXIT_FAIL)
src_cluster.ready();
- dst_cluster = self.cluster(1, expect=EXPECT_EXIT_FAIL)
+ dst_cluster = self.cluster(2, expect=EXPECT_EXIT_FAIL)
dst_cluster.ready();
cmd = self.popen(["qpid-config",
@@ -850,36 +850,39 @@ acl deny all all
# check that traffic passes
verify(src_cluster[0], "srcQ", dst_cluster[0], "destQ")
- # add src[1] and src[2] brokers to source cluster
- src_cluster.start(expect=EXPECT_EXIT_FAIL);
- src_cluster.ready();
+ # add src[2] broker to source cluster
src_cluster.start(expect=EXPECT_EXIT_FAIL);
src_cluster.ready();
verify(src_cluster[2], "srcQ", dst_cluster[0], "destQ")
- # Kill src[0]. dst[0] should've learned about src[1,2]
+ # Kill src[0]. dst[0] should fail over to src[1]
src_cluster[0].kill()
for b in src_cluster[1:]: b.ready()
verify(src_cluster[1], "srcQ", dst_cluster[0], "destQ")
- # Kill src[1], dst[0] should still be connected
+ # Kill src[1], dst[0] should fail over to src[2]
src_cluster[1].kill()
for b in src_cluster[2:]: b.ready()
verify(src_cluster[2], "srcQ", dst_cluster[0], "destQ")
- # Add dest[1]
- # dest[0] syncs dest[1] to current remote state
- dst_cluster.start(expect=EXPECT_EXIT_FAIL);
- dst_cluster.ready();
- verify(src_cluster[2], "srcQ", dst_cluster[1], "destQ")
-
# Kill dest[0], force failover to dest[1]
dst_cluster[0].kill()
for b in dst_cluster[1:]: b.ready()
verify(src_cluster[2], "srcQ", dst_cluster[1], "destQ")
+ # Add dest[2]
+ # dest[1] syncs dest[2] to current remote state
+ dst_cluster.start(expect=EXPECT_EXIT_FAIL);
+ for b in dst_cluster[1:]: b.ready()
+ verify(src_cluster[2], "srcQ", dst_cluster[1], "destQ")
+
+ # Kill dest[1], force failover to dest[2]
+ dst_cluster[1].kill()
+ for b in dst_cluster[2:]: b.ready()
+ verify(src_cluster[2], "srcQ", dst_cluster[2], "destQ")
+
for i in range(2, len(src_cluster)): src_cluster[i].kill()
- for i in range(1, len(dst_cluster)): dst_cluster[i].kill()
+ for i in range(2, len(dst_cluster)): dst_cluster[i].kill()
# Some utility code for transaction tests