diff options
author | Alan Conway <aconway@apache.org> | 2010-08-04 19:25:28 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-08-04 19:25:28 +0000 |
commit | 194a3ce1ab546d8897c8532be4d9eace121f4191 (patch) | |
tree | d822d491915f6d32e184da51ab69645d803085f1 /cpp/src/tests | |
parent | 4bbc8dabfd217f70cd085702f15075a92cdb8e42 (diff) | |
download | qpid-python-194a3ce1ab546d8897c8532be4d9eace121f4191.tar.gz |
Fix ClusterFailover.cpp and ForkedBroker.cpp to avoid using the default data directory.
Was causing tests to fail because of a pre-existing lock file in the default data dir.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@982374 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r-- | cpp/src/tests/ClusterFailover.cpp | 12 | ||||
-rw-r--r-- | cpp/src/tests/ForkedBroker.cpp | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/tests/ClusterFailover.cpp b/cpp/src/tests/ClusterFailover.cpp index 06fc1c06be..bf5c147f19 100644 --- a/cpp/src/tests/ClusterFailover.cpp +++ b/cpp/src/tests/ClusterFailover.cpp @@ -50,9 +50,15 @@ using boost::shared_ptr; // Timeout for tests that wait for messages const sys::Duration TIMEOUT=sys::TIME_SEC/4; -ClusterFixture::Args getArgs() { +ClusterFixture::Args getArgs(bool durable=std::getenv("STORE_LIB")) +{ ClusterFixture::Args args; - args += "--auth", "no", "--no-module-dir", "--load-module", getLibPath("CLUSTER_LIB"); + args += "--auth", "no", "--no-module-dir", + "--load-module", getLibPath("CLUSTER_LIB"); + if (durable) + args += "--load-module", getLibPath("STORE_LIB"), "TMP_DATA_DIR"; + else + args += "--no-data-dir"; return args; } @@ -87,7 +93,7 @@ QPID_AUTO_TEST_CASE(testReconnectExclusiveQueue) { // Regression: core dump on exit if unacked messages were left in // a session with a timeout. - cluster.kill(0); + cluster.killWithSilencer(0, c0.connection); // Regression: session timeouts prevented re-connecting to // exclusive queue. diff --git a/cpp/src/tests/ForkedBroker.cpp b/cpp/src/tests/ForkedBroker.cpp index 0aedb50ec1..9ff301e29d 100644 --- a/cpp/src/tests/ForkedBroker.cpp +++ b/cpp/src/tests/ForkedBroker.cpp @@ -42,6 +42,7 @@ namespace tests { ForkedBroker::ForkedBroker(const Args& constArgs) : running(false), exitStatus(0) { Args args(constArgs); + // Substitute the special value "TMP_DATA_DIR" with a temporary data dir. Args::iterator i = find(args.begin(), args.end(), string("TMP_DATA_DIR")); if (i != args.end()) { args.erase(i); @@ -52,6 +53,11 @@ ForkedBroker::ForkedBroker(const Args& constArgs) : running(false), exitStatus(0 args.push_back("--data-dir"); args.push_back(dataDir); } + // Never use the default data directory, set --no-data-dir if no other data-dir arg. + Args::iterator j = find(args.begin(), args.end(), string("--data-dir")); + Args::iterator k = find(args.begin(), args.end(), string("--no-data-dir")); + if (j == args.end() && k == args.end()) + args.push_back("--no-data-dir"); init(args); } |