diff options
-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); } |