summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-01-06 17:01:50 +0000
committerAlan Conway <aconway@apache.org>2010-01-06 17:01:50 +0000
commit4aeeb47e405771fc081f29f5fc3ec28aa9ffc569 (patch)
tree348ec36bf515d9f124b209268df275f7e3d22175 /qpid/cpp/src/tests
parentd7530cec59b22c2c8bf3b7f2096c3bac4de992a3 (diff)
downloadqpid-python-4aeeb47e405771fc081f29f5fc3ec28aa9ffc569.tar.gz
Added config-seq counter to track config changes since cluster init.
Config-seq is recorded persitently to help identify best store when recovering from total failure. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@896538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rw-r--r--qpid/cpp/src/tests/InitialStatusMap.cpp7
-rwxr-xr-xqpid/cpp/src/tests/cluster_tests.py25
2 files changed, 27 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/InitialStatusMap.cpp b/qpid/cpp/src/tests/InitialStatusMap.cpp
index 82450eac22..63214ee395 100644
--- a/qpid/cpp/src/tests/InitialStatusMap.cpp
+++ b/qpid/cpp/src/tests/InitialStatusMap.cpp
@@ -37,15 +37,15 @@ QPID_AUTO_TEST_SUITE(InitialStatusMapTestSuite)
typedef InitialStatusMap::Status Status;
Status activeStatus(const Uuid& id=Uuid()) {
- return Status(ProtocolVersion(), 0, true, id, STORE_STATE_NO_STORE, Uuid());
+ return Status(ProtocolVersion(), 0, true, id, STORE_STATE_NO_STORE, Uuid(), 0);
}
Status newcomerStatus(const Uuid& id=Uuid()) {
- return Status(ProtocolVersion(), 0, false, id, STORE_STATE_NO_STORE, Uuid());
+ return Status(ProtocolVersion(), 0, false, id, STORE_STATE_NO_STORE, Uuid(), 0);
}
Status storeStatus(bool active, StoreState state, Uuid start=Uuid(), Uuid stop=Uuid()) {
- return Status(ProtocolVersion(), 0, active, start, state, stop);
+ return Status(ProtocolVersion(), 0, active, start, state, stop, 0);
}
QPID_AUTO_TEST_CASE(testFirstInCluster) {
@@ -241,7 +241,6 @@ QPID_AUTO_TEST_CASE(testEmptyAlone) {
}
// FIXME aconway 2009-11-20: consistency tests for mixed stores,
-// tests for manual intervention case.
QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py
index 4bfbca415a..089d42fd91 100755
--- a/qpid/cpp/src/tests/cluster_tests.py
+++ b/qpid/cpp/src/tests/cluster_tests.py
@@ -85,6 +85,29 @@ class ShortTests(BrokerTest):
os.remove("direct.dump")
os.remove("updatee.dump")
+ def test_config_change_seq(self):
+ """Check that cluster members have the correct config change sequence numbers"""
+ cluster = self.cluster(0)
+ cluster.start()
+ cluster.start(expect=EXPECT_EXIT_OK)
+ cluster[1].terminate(); cluster[1].wait()
+ cluster.start()
+
+ update_re = re.compile(r"member update: (.*) frameSeq=[0-9]+ configSeq=([0-9]+)")
+ matches = [ update_re.search(file(b.log).read()) for b in cluster ]
+ sequences = [ m.group(2) for m in matches]
+ self.assertEqual(sequences, ["0", "1", "3"])
+
+ # Check that configurations with same seq. number match
+ configs={}
+ for b in cluster:
+ matches = update_re.findall(file(b.log).read())
+ for m in matches:
+ seq=m[1]
+ config=re.sub("\((member|unknown)\)", "", m[0])
+ if not seq in configs: configs[seq] = config
+ else: self.assertEqual(configs[seq], config)
+
class LongTests(BrokerTest):
"""Tests that can run for a long time if -DDURATION=<minutes> is set"""
def duration(self):
@@ -234,7 +257,7 @@ class StoreTests(BrokerTest):
msg = re.compile("critical.*no clean store")
assert a.search_log(msg)
assert b.search_log(msg)
- # FIXME aconway 2009-12-03: verify correct store ID in log message
+
# FIXME aconway 2009-12-03: verify manual restore procedure