summaryrefslogtreecommitdiff
path: root/cpp/src/tests/cluster_tests.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-01-07 16:32:34 +0000
committerAlan Conway <aconway@apache.org>2011-01-07 16:32:34 +0000
commit97ec99f115c5190be04963e2853d0315d9a75a52 (patch)
tree23eca9f137946af8e857c44a435126dc687322cd /cpp/src/tests/cluster_tests.py
parentbda33c5b69189bf645ff818d8315bb8fc3288b7a (diff)
downloadqpid-python-97ec99f115c5190be04963e2853d0315d9a75a52.tar.gz
QPID-2982: Improved cluster/management logging and automated test for log consistency.
The cluster_tests.py test_management test is augmented to compare broker logs after the test completes. Any inconsistency in the logs causes the test to fail. This check is currently disabled as it is failing due to known issues. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1056378 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cluster_tests.py')
-rwxr-xr-xcpp/src/tests/cluster_tests.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py
index daa47a6322..03913356ca 100755
--- a/cpp/src/tests/cluster_tests.py
+++ b/cpp/src/tests/cluster_tests.py
@@ -18,7 +18,7 @@
# under the License.
#
-import os, signal, sys, time, imp, re, subprocess
+import os, signal, sys, time, imp, re, subprocess, glob, cluster_test_logs
from qpid import datatypes, messaging
from qpid.brokertest import *
from qpid.harness import Skipped
@@ -35,7 +35,7 @@ log = getLogger("qpid.cluster_tests")
# a non-0 code. Hence the apparently inconsistent use of EXPECT_EXIT_OK
# and EXPECT_EXIT_FAIL in some of the tests below.
-# FIXME aconway 2010-03-11: resolve this - ideally any exit due to an error
+# TODO aconway 2010-03-11: resolve this - ideally any exit due to an error
# should give non-0 exit status.
# Import scripts as modules
@@ -299,7 +299,10 @@ class LongTests(BrokerTest):
for i in range(i, len(cluster)): cluster[i].kill()
def test_management(self, args=[]):
- """Stress test: Run management clients and other clients concurrently."""
+ """
+ Stress test: Run management clients and other clients concurrently
+ while killing and restarting brokers.
+ """
class ClientLoop(StoppableThread):
"""Run a client executable in a loop."""
@@ -352,9 +355,9 @@ class LongTests(BrokerTest):
finally: self.lock.release()
StoppableThread.stop(self)
- # def test_management
- args += ["--mgmt-pub-interval", 1] # Publish management information every second.
- # FIXME aconway 2010-12-15: extra debugging
+ # body of test_management()
+
+ args += ["--mgmt-pub-interval", 1]
args += ["--log-enable=trace+:management"]
# Use store if present.
if BrokerTest.store_lib: args +=["--load-module", BrokerTest.store_lib]
@@ -403,6 +406,10 @@ class LongTests(BrokerTest):
start_mclients(cluster[alive])
for c in chain(mclients, *clients):
c.stop()
+ # Verify that logs are consistent
+ # FIXME aconway 2010-12-21: this is currently expected to fail due to
+ # known bugs, see https://issues.apache.org/jira/browse/QPID-2982
+ self.assertRaises(Exception, cluster_test_logs.verify_logs, glob.glob("*.log"))
def test_management_qmf2(self):
self.test_management(args=["--mgmt-qmf2=yes"])
@@ -506,7 +513,7 @@ class StoreTests(BrokerTest):
self.assertEqual(a.wait(), 0)
self.assertEqual(c.wait(), 0)
# Mix members from both shutdown events, they should fail
- # FIXME aconway 2010-03-11: can't predict the exit status of these
+ # TODO aconway 2010-03-11: can't predict the exit status of these
# as it depends on the order of delivery of initial-status messages.
# See comment at top of this file.
a = cluster.start("a", expect=EXPECT_UNKNOWN, wait=False)