diff options
author | Arnstein Ressem <aressem@yahoo-inc.com> | 2016-09-13 09:10:06 +0200 |
---|---|---|
committer | Arnstein Ressem <aressem@yahoo-inc.com> | 2016-09-13 09:10:06 +0200 |
commit | 266d63198443580a9f9cbe040738850f2ea3dc3e (patch) | |
tree | aaa9e6350139f01f9dcfa4fafbf8dbef32c7a9a8 /messagebus_test/src/tests/error | |
parent | 783bad638168ee3e64505037c75fa2028ab71c00 (diff) |
More tests fixed.
Diffstat (limited to 'messagebus_test/src/tests/error')
-rwxr-xr-x | messagebus_test/src/tests/error/ctl.sh | 8 | ||||
-rw-r--r-- | messagebus_test/src/tests/error/error.cpp | 16 | ||||
-rw-r--r-- | messagebus_test/src/tests/error/progdefs.sh | 2 |
3 files changed, 18 insertions, 8 deletions
diff --git a/messagebus_test/src/tests/error/ctl.sh b/messagebus_test/src/tests/error/ctl.sh index 864be4290ed..d018444c499 100755 --- a/messagebus_test/src/tests/error/ctl.sh +++ b/messagebus_test/src/tests/error/ctl.sh @@ -1,4 +1,10 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -exec ../../binref/progctl.sh progdefs.sh "$@" +if [ -z "$SOURCE_DIRECTORY" ]; then + SOURCE_DIRECTORY="." +fi + +. ../../binref/env.sh + +exec $BINREF/progctl.sh $SOURCE_DIRECTORY/progdefs.sh "$@" diff --git a/messagebus_test/src/tests/error/error.cpp b/messagebus_test/src/tests/error/error.cpp index 9b01e5d61d0..63991b34a95 100644 --- a/messagebus_test/src/tests/error/error.cpp +++ b/messagebus_test/src/tests/error/error.cpp @@ -3,6 +3,7 @@ #include <vespa/log/log.h> LOG_SETUP("error_test"); #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/testkit/test_kit.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/vespalib/util/stringfmt.h> @@ -16,6 +17,9 @@ Test::Main() { TEST_INIT("error_test"); Slobrok slobrok; + const std::string routing_template = TEST_PATH("routing-template.cfg"); + const std::string ctl_script = TEST_PATH("ctl.sh"); + { // Make slobrok config EXPECT_TRUE(system("echo slobrok[1] > slobrok.cfg") == 0); EXPECT_TRUE(system(make_string("echo 'slobrok[0].connectionspec tcp/localhost:%d' " @@ -23,23 +27,23 @@ Test::Main() } { // CPP SERVER { // Make routing config - EXPECT_TRUE(system("cat routing-template.cfg | sed 's#session#cpp/session#' > routing.cfg") == 0); + EXPECT_TRUE(system(("cat " + routing_template + " | sed 's#session#cpp/session#' > routing.cfg").c_str()) == 0); } fprintf(stderr, "STARTING CPP-SERVER\n"); - EXPECT_TRUE(system("sh ctl.sh start server cpp") == 0); + EXPECT_TRUE(system((ctl_script + " start server cpp").c_str()) == 0); EXPECT_TRUE(system("./messagebus_test_cpp-client-error_app") == 0); EXPECT_TRUE(system("../../binref/runjava JavaClient") == 0); - EXPECT_TRUE(system("sh ctl.sh stop server cpp") == 0); + EXPECT_TRUE(system((ctl_script + " stop server cpp").c_str()) == 0); } { // JAVA SERVER { // Make routing config - EXPECT_TRUE(system("cat routing-template.cfg | sed 's#session#java/session#' > routing.cfg") == 0); + EXPECT_TRUE(system("cat " + routing_tesmplate + " | sed 's#session#java/session#' > routing.cfg").c_str()) == 0); } fprintf(stderr, "STARTING JAVA-SERVER\n"); - EXPECT_TRUE(system("sh ctl.sh start server java") == 0); + EXPECT_TRUE(system((ctl_script + " start server java").c_str()) == 0); EXPECT_TRUE(system("./messagebus_test_cpp-client-error_app") == 0); EXPECT_TRUE(system("../../binref/runjava JavaClient") == 0); - EXPECT_TRUE(system("sh ctl.sh stop server java") == 0); + EXPECT_TRUE(system((ctl_script + " stop server java").c_str()) == 0); } TEST_DONE(); } diff --git a/messagebus_test/src/tests/error/progdefs.sh b/messagebus_test/src/tests/error/progdefs.sh index 2f6f37a9425..47d02d95b93 100644 --- a/messagebus_test/src/tests/error/progdefs.sh +++ b/messagebus_test/src/tests/error/progdefs.sh @@ -1,3 +1,3 @@ # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. prog server cpp "" "./messagebus_test_cpp-server-error_app" -prog server java "" "../../binref/runjava JavaServer" +prog server java "" "$BINREF/runjava JavaServer" |