diff options
author | Alan Conway <aconway@apache.org> | 2010-01-06 17:01:50 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-01-06 17:01:50 +0000 |
commit | e7c824871a7238697e5c534aafffee99078975cd (patch) | |
tree | 8fe2f397beb8f3b2e2fe94386dfee7aa168b2376 /cpp/src/tests/cluster_tests.py | |
parent | de23cb5942844463a237cff18c30e5f43ea5d5d0 (diff) | |
download | qpid-python-e7c824871a7238697e5c534aafffee99078975cd.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/qpid@896538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cluster_tests.py')
-rwxr-xr-x | cpp/src/tests/cluster_tests.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py index 4bfbca415a..089d42fd91 100755 --- a/cpp/src/tests/cluster_tests.py +++ b/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 |