diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-15 18:06:37 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-17 14:38:14 +0000 |
commit | 6f26d4daad46da0aa3ccae312da522d203a21585 (patch) | |
tree | d0bb08ec17ed6e37e0b8673fbbe11b53c65f6194 | |
parent | ed8fa0954399f92b38d6332ca48b24105e83b833 (diff) |
rename SlaveProc -> ChildProc
23 files changed, 143 insertions, 143 deletions
diff --git a/fnet/src/tests/examples/examples_test.cpp b/fnet/src/tests/examples/examples_test.cpp index c704c58abc9..1dd3169986f 100644 --- a/fnet/src/tests/examples/examples_test.cpp +++ b/fnet/src/tests/examples/examples_test.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/thread.h> #include <atomic> @@ -10,9 +10,9 @@ static const int PORT0 = 18570; static const int PORT1 = 18571; -using vespalib::SlaveProc; +using vespalib::ChildProc; -bool runProc(SlaveProc &proc, std::atomic<bool> &done) { +bool runProc(ChildProc &proc, std::atomic<bool> &done) { char buf[4096]; proc.close(); // close stdin while (proc.running() && !done) { @@ -38,7 +38,7 @@ bool runProc(const std::string &cmd) { vespalib::Thread::sleep(500); } std::atomic<bool> done(false); - SlaveProc proc(cmd.c_str()); + ChildProc proc(cmd.c_str()); ok = runProc(proc, done); } return ok; @@ -47,60 +47,60 @@ bool runProc(const std::string &cmd) { TEST("usage") { std::atomic<bool> done(false); { - SlaveProc proc("exec ../../examples/proxy/fnet_proxy_app"); + ChildProc proc("exec ../../examples/proxy/fnet_proxy_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/ping/fnet_pingserver_app"); + ChildProc proc("exec ../../examples/ping/fnet_pingserver_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/ping/fnet_pingclient_app"); + ChildProc proc("exec ../../examples/ping/fnet_pingclient_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/fnet_rpc_client_app"); + ChildProc proc("exec ../../examples/frt/rpc/fnet_rpc_client_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/fnet_rpc_server_app"); + ChildProc proc("exec ../../examples/frt/rpc/fnet_rpc_server_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/fnet_echo_client_app"); + ChildProc proc("exec ../../examples/frt/rpc/fnet_echo_client_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/vespa-rpc-info"); + ChildProc proc("exec ../../examples/frt/rpc/vespa-rpc-info"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/vespa-rpc-invoke-bin"); + ChildProc proc("exec ../../examples/frt/rpc/vespa-rpc-invoke-bin"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app"); + ChildProc proc("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/fnet_rpc_callback_client_app"); + ChildProc proc("exec ../../examples/frt/rpc/fnet_rpc_callback_client_app"); EXPECT_FALSE(runProc(proc, done)); } { - SlaveProc proc("exec ../../examples/frt/rpc/vespa-rpc-proxy"); + ChildProc proc("exec ../../examples/frt/rpc/vespa-rpc-proxy"); EXPECT_FALSE(runProc(proc, done)); } } TEST("timeout") { std::string out; - EXPECT_TRUE(SlaveProc::run("exec ../../examples/timeout/fnet_timeout_app", out)); + EXPECT_TRUE(ChildProc::run("exec ../../examples/timeout/fnet_timeout_app", out)); fprintf(stderr, "%s\n", out.c_str()); } TEST_MT_F("ping", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/ping/fnet_pingserver_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/ping/fnet_pingserver_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -114,7 +114,7 @@ TEST_MT_F("ping", 2, std::atomic<bool>()) { TEST_MT_F("ping times out", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -128,12 +128,12 @@ TEST_MT_F("ping times out", 2, std::atomic<bool>()) { TEST_MT_F("ping with proxy", 3, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/ping/fnet_pingserver_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/ping/fnet_pingserver_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); } else if (thread_id == 1) { - SlaveProc proc(vespalib::make_string("exec ../../examples/proxy/fnet_proxy_app tcp/%d tcp/localhost:%d", + ChildProc proc(vespalib::make_string("exec ../../examples/proxy/fnet_proxy_app tcp/%d tcp/localhost:%d", PORT1, PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -147,7 +147,7 @@ TEST_MT_F("ping with proxy", 3, std::atomic<bool>()) { TEST_MT_F("rpc client server", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -161,7 +161,7 @@ TEST_MT_F("rpc client server", 2, std::atomic<bool>()) { TEST_MT_F("rpc echo client", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -175,7 +175,7 @@ TEST_MT_F("rpc echo client", 2, std::atomic<bool>()) { TEST_MT_F("rpc info", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -191,7 +191,7 @@ TEST_MT_F("rpc info", 2, std::atomic<bool>()) { TEST_MT_F("rpc invoke", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -206,7 +206,7 @@ TEST_MT_F("rpc invoke", 2, std::atomic<bool>()) { TEST_MT_F("rpc callback client server", 2, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); @@ -220,12 +220,12 @@ TEST_MT_F("rpc callback client server", 2, std::atomic<bool>()) { TEST_MT_F("rpc callback client server with proxy", 3, std::atomic<bool>()) { if (thread_id == 0) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app tcp/%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app tcp/%d", PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); } else if (thread_id == 1) { - SlaveProc proc(vespalib::make_string("exec ../../examples/frt/rpc/vespa-rpc-proxy tcp/%d tcp/localhost:%d", + ChildProc proc(vespalib::make_string("exec ../../examples/frt/rpc/vespa-rpc-proxy tcp/%d tcp/localhost:%d", PORT1, PORT0).c_str()); TEST_BARRIER(); EXPECT_TRUE(runProc(proc, f1)); diff --git a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp index 7488fc633fd..008221e6854 100644 --- a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp +++ b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp @@ -13,7 +13,7 @@ #include <vespa/messagebus/network/rpcnetworkparams.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/signalhandler.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/config/common/exceptions.h> @@ -207,7 +207,7 @@ App::Main() route.c_str(), feedFile.c_str())); fprintf(stderr, "running feed command: %s\n", feedCmd.c_str()); std::string feederOutput; - bool feedingOk = vespalib::SlaveProc::run(feedCmd.c_str(), feederOutput); + bool feedingOk = vespalib::ChildProc::run(feedCmd.c_str(), feederOutput); if (!feedingOk) { fprintf(stderr, "error: feed command failed\n"); fprintf(stderr, "feed command output:\n-----\n%s\n-----\n", feederOutput.c_str()); diff --git a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp index fd7069c618a..6569575e856 100644 --- a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp +++ b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/searchcommon/common/schema.h> #include <vespa/searchlib/fef/indexproperties.h> @@ -154,7 +154,7 @@ struct Model { } bool verify() { generate(); - return vespalib::SlaveProc::run(vespalib::make_string("%s dir:%s", prog, gen_dir.c_str()).c_str()); + return vespalib::ChildProc::run(vespalib::make_string("%s dir:%s", prog, gen_dir.c_str()).c_str()); } void verify_valid(std::initializer_list<std::string> features) { for (const std::string &f: features) { @@ -207,12 +207,12 @@ struct ShadowModel : Model { }; TEST_F("print usage", Model()) { - EXPECT_TRUE(!vespalib::SlaveProc::run(vespalib::make_string("%s", prog).c_str())); + EXPECT_TRUE(!vespalib::ChildProc::run(vespalib::make_string("%s", prog).c_str())); } TEST_F("setup output directory", Model()) { - ASSERT_TRUE(vespalib::SlaveProc::run(vespalib::make_string("rm -rf %s", gen_dir.c_str()).c_str())); - ASSERT_TRUE(vespalib::SlaveProc::run(vespalib::make_string("mkdir %s", gen_dir.c_str()).c_str())); + ASSERT_TRUE(vespalib::ChildProc::run(vespalib::make_string("rm -rf %s", gen_dir.c_str()).c_str())); + ASSERT_TRUE(vespalib::ChildProc::run(vespalib::make_string("mkdir %s", gen_dir.c_str()).c_str())); } //----------------------------------------------------------------------------- @@ -317,7 +317,7 @@ TEST_F("require that imported attribute field can be used by rank feature", Simp //----------------------------------------------------------------------------- TEST_F("cleanup files", Model()) { - ASSERT_TRUE(vespalib::SlaveProc::run(vespalib::make_string("rm -rf %s", gen_dir.c_str()).c_str())); + ASSERT_TRUE(vespalib::ChildProc::run(vespalib::make_string("rm -rf %s", gen_dir.c_str()).c_str())); } TEST_MAIN_WITH_PROCESS_PROXY() { TEST_RUN_ALL(); } diff --git a/staging_vespalib/src/tests/state_server/state_server_test.cpp b/staging_vespalib/src/tests/state_server/state_server_test.cpp index e61d3d216cd..59011cb4bc3 100644 --- a/staging_vespalib/src/tests/state_server/state_server_test.cpp +++ b/staging_vespalib/src/tests/state_server/state_server_test.cpp @@ -12,7 +12,7 @@ #include <vespa/vespalib/net/simple_metrics_producer.h> #include <vespa/vespalib/net/simple_component_config_producer.h> #include <vespa/vespalib/util/stringfmt.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/net/state_explorer.h> #include <vespa/vespalib/net/slime_explorer.h> #include <vespa/vespalib/net/generic_state_handler.h> @@ -40,7 +40,7 @@ std::map<vespalib::string,vespalib::string> empty_params; vespalib::string run_cmd(const vespalib::string &cmd) { std::string out; - ASSERT_TRUE(SlaveProc::run(cmd.c_str(), out)); + ASSERT_TRUE(ChildProc::run(cmd.c_str(), out)); return out; } diff --git a/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp b/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp index 0b4a83bf714..e59803c71c8 100644 --- a/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp +++ b/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp @@ -1,11 +1,11 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/testapp.h> #include <vbench/test/all.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/net/crypto_engine.h> using namespace vbench; -using vespalib::SlaveProc; +using vespalib::ChildProc; using InputReader = vespalib::InputReader; using OutputWriter = vespalib::OutputWriter; @@ -32,7 +32,7 @@ void readUntil(Input &input, SimpleBuffer &buffer, const string &end) { TEST("dumpurl usage") { std::string out; - EXPECT_FALSE(SlaveProc::run("../../apps/dumpurl/vbench_dumpurl_app", out)); + EXPECT_FALSE(ChildProc::run("../../apps/dumpurl/vbench_dumpurl_app", out)); fprintf(stderr, "%s\n", out.c_str()); } @@ -48,7 +48,7 @@ TEST_MT_F("run dumpurl", 2, ServerSocket()) { out.write("data"); } else { std::string out; - EXPECT_TRUE(SlaveProc::run(strfmt("../../apps/dumpurl/vbench_dumpurl_app localhost %d /foo", + EXPECT_TRUE(ChildProc::run(strfmt("../../apps/dumpurl/vbench_dumpurl_app localhost %d /foo", f1.port()).c_str(), out)); fprintf(stderr, "%s\n", out.c_str()); } diff --git a/vbench/src/tests/app_vbench/app_vbench_test.cpp b/vbench/src/tests/app_vbench/app_vbench_test.cpp index 8b5bb71425d..37f549ece22 100644 --- a/vbench/src/tests/app_vbench/app_vbench_test.cpp +++ b/vbench/src/tests/app_vbench/app_vbench_test.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/testapp.h> #include <vbench/test/all.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/net/crypto_engine.h> #include <vespa/vespalib/net/tls/tls_crypto_engine.h> #include <vespa/vespalib/test/make_tls_options_for_testing.h> @@ -11,7 +11,7 @@ #include <fcntl.h> using namespace vbench; -using vespalib::SlaveProc; +using vespalib::ChildProc; using InputReader = vespalib::InputReader; using OutputWriter = vespalib::OutputWriter; @@ -32,7 +32,7 @@ void write_file(const vespalib::string &file_name, const vespalib::string &conte TEST("vbench usage") { std::string out; - EXPECT_FALSE(SlaveProc::run("../../apps/vbench/vbench_app", out)); + EXPECT_FALSE(ChildProc::run("../../apps/vbench/vbench_app", out)); fprintf(stderr, "%s\n", out.c_str()); } @@ -69,14 +69,14 @@ struct Servers { TEST_MT_F("run vbench", 2, Servers()) { if (thread_id == 0) { std::string out; - EXPECT_TRUE(SlaveProc::run(strfmt("sed 's/_LOCAL_PORT_/%d/' vbench.cfg.template > vbench.cfg", f1.portal->listen_port()).c_str())); - EXPECT_TRUE(SlaveProc::run("../../apps/vbench/vbench_app run vbench.cfg 2> vbench.out", out)); + EXPECT_TRUE(ChildProc::run(strfmt("sed 's/_LOCAL_PORT_/%d/' vbench.cfg.template > vbench.cfg", f1.portal->listen_port()).c_str())); + EXPECT_TRUE(ChildProc::run("../../apps/vbench/vbench_app run vbench.cfg 2> vbench.out", out)); fprintf(stderr, "null crypto: %s\n", out.c_str()); EXPECT_GREATER(f1.my_get.cnt, 10u); } else { std::string tls_out; - EXPECT_TRUE(SlaveProc::run(strfmt("sed 's/_LOCAL_PORT_/%d/' vbench.tls.cfg.template > vbench.tls.cfg", f1.tls_portal->listen_port()).c_str())); - EXPECT_TRUE(SlaveProc::run("../../apps/vbench/vbench_app run vbench.tls.cfg 2> vbench.tls.out", tls_out)); + EXPECT_TRUE(ChildProc::run(strfmt("sed 's/_LOCAL_PORT_/%d/' vbench.tls.cfg.template > vbench.tls.cfg", f1.tls_portal->listen_port()).c_str())); + EXPECT_TRUE(ChildProc::run("../../apps/vbench/vbench_app run vbench.tls.cfg 2> vbench.tls.out", tls_out)); fprintf(stderr, "tls crypto: %s\n", tls_out.c_str()); EXPECT_GREATER(f1.my_tls_get.cnt, 10u); } diff --git a/vespalib/CMakeLists.txt b/vespalib/CMakeLists.txt index 1ca9816a921..80c789ba379 100644 --- a/vespalib/CMakeLists.txt +++ b/vespalib/CMakeLists.txt @@ -97,7 +97,7 @@ vespa_define_module( src/tests/sharedptr src/tests/signalhandler src/tests/simple_thread_bundle - src/tests/slaveproc + src/tests/child_proc src/tests/slime src/tests/slime/external_data_value src/tests/slime/summary-feature-benchmark diff --git a/vespalib/src/tests/assert/assert_test.cpp b/vespalib/src/tests/assert/assert_test.cpp index 860f56304ff..bdd9f5785dd 100644 --- a/vespalib/src/tests/assert/assert_test.cpp +++ b/vespalib/src/tests/assert/assert_test.cpp @@ -1,6 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/assert.h> #include <vespa/vespalib/io/fileutil.h> @@ -16,19 +16,19 @@ TEST("that it borks the first time.") { vespalib::rmdir("var", true); ASSERT_TRUE(vespalib::mkdir(assertDir, true)); { - SlaveProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); } { - SlaveProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.readLine(assertName); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 0); } ASSERT_EQUAL(0, unlink(assertName.c_str())); { - SlaveProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); } diff --git a/vespalib/src/tests/child_proc/.gitignore b/vespalib/src/tests/child_proc/.gitignore new file mode 100644 index 00000000000..8b43b2b332e --- /dev/null +++ b/vespalib/src/tests/child_proc/.gitignore @@ -0,0 +1,4 @@ +.depend +Makefile +child_proc_test +vespalib_child_proc_test_app diff --git a/vespalib/src/tests/child_proc/CMakeLists.txt b/vespalib/src/tests/child_proc/CMakeLists.txt new file mode 100644 index 00000000000..45f0ae8f9a9 --- /dev/null +++ b/vespalib/src/tests/child_proc/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(vespalib_child_proc_test_app TEST + SOURCES + child_proc_test.cpp + DEPENDS + vespalib +) +vespa_add_test(NAME vespalib_child_proc_test_app COMMAND vespalib_child_proc_test_app) diff --git a/vespalib/src/tests/slaveproc/slaveproc_test.cpp b/vespalib/src/tests/child_proc/child_proc_test.cpp index 547da991211..d485ef75432 100644 --- a/vespalib/src/tests/slaveproc/slaveproc_test.cpp +++ b/vespalib/src/tests/child_proc/child_proc_test.cpp @@ -1,57 +1,57 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> -using vespalib::SlaveProc; +using vespalib::ChildProc; TEST("simple run, ignore output") { - EXPECT_TRUE(SlaveProc::run("echo foo")); + EXPECT_TRUE(ChildProc::run("echo foo")); } TEST("simple run, ignore output, failure") { - EXPECT_TRUE(!SlaveProc::run("false")); + EXPECT_TRUE(!ChildProc::run("false")); } TEST("simple run, ignore output, timeout") { - EXPECT_TRUE(!SlaveProc::run("exec sleep 60", 10)); + EXPECT_TRUE(!ChildProc::run("exec sleep 60", 10)); } TEST("simple run") { std::string out; - EXPECT_TRUE(SlaveProc::run("/bin/echo -n foo", out)); + EXPECT_TRUE(ChildProc::run("/bin/echo -n foo", out)); EXPECT_EQUAL(out, "foo"); } TEST("simple run, strip single-line trailing newline") { std::string out; - EXPECT_TRUE(SlaveProc::run("echo foo", out)); + EXPECT_TRUE(ChildProc::run("echo foo", out)); EXPECT_EQUAL(out, "foo"); } TEST("simple run, don't strip multi-line output") { std::string out; - EXPECT_TRUE(SlaveProc::run("perl -e 'print \"foo\\n\\n\"'", out)); + EXPECT_TRUE(ChildProc::run("perl -e 'print \"foo\\n\\n\"'", out)); EXPECT_EQUAL(out, "foo\n\n"); } TEST("simple run with input") { std::string in = "bar"; std::string out; - EXPECT_TRUE(SlaveProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProc::run(in, "cat", out)); EXPECT_EQUAL(out, "bar"); } TEST("simple run with input, strip single-line trailing newline") { std::string in = "bar\n"; std::string out; - EXPECT_TRUE(SlaveProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProc::run(in, "cat", out)); EXPECT_EQUAL(out, "bar"); } TEST("simple run with input, don't strip multi-line output") { std::string in = "bar\n\n"; std::string out; - EXPECT_TRUE(SlaveProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProc::run(in, "cat", out)); EXPECT_EQUAL("bar\n\n", out); } @@ -64,11 +64,11 @@ TEST_MT("simple run, partial output due to timeout", 2) { (thread_id == 0) ? "out" : "", timeout); if (thread_id == 0) { out.clear(); - EXPECT_TRUE(!SlaveProc::run(my_cmd, out, timeout)); + EXPECT_TRUE(!ChildProc::run(my_cmd, out, timeout)); } else { out.clear(); std::string in = "ignored\n"; - EXPECT_TRUE(!SlaveProc::run(in, my_cmd, out, timeout)); + EXPECT_TRUE(!ChildProc::run(in, my_cmd, out, timeout)); } if (out == "foo") { break; @@ -78,7 +78,7 @@ TEST_MT("simple run, partial output due to timeout", 2) { } TEST("proc failure") { - SlaveProc proc("false"); + ChildProc proc("false"); // read with length 0 will wait for output EXPECT_TRUE(proc.read(NULL, 0) == 0); EXPECT_TRUE(proc.wait(60000)); @@ -90,7 +90,7 @@ TEST("basic read/write") { int x; int read; char buf[64]; - SlaveProc proc("cat"); + ChildProc proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -117,7 +117,7 @@ TEST("basic read/write") { TEST("continuos run, readLine") { std::string str; - SlaveProc proc("cat"); + ChildProc proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -142,7 +142,7 @@ TEST("continuos run, readLine") { TEST("readLine, eof flushes last line") { std::string str; - SlaveProc proc("cat"); + ChildProc proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -166,7 +166,7 @@ TEST("readLine, eof flushes last line") { TEST("long continuos run, readLine") { std::string in; std::string out; - SlaveProc proc("cat"); + ChildProc proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); diff --git a/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp index 63defa58c41..17cb977631c 100644 --- a/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp +++ b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp @@ -1,23 +1,23 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> -using vespalib::SlaveProc; +using vespalib::ChildProc; TEST("no arguments") { - SlaveProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache"); + ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache"); drop.wait(); EXPECT_EQUAL(1, drop.getExitCode()); } TEST("file does not exist") { - SlaveProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache not_exist"); + ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache not_exist"); drop.wait(); EXPECT_EQUAL(2, drop.getExitCode()); } TEST("All is well") { - SlaveProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache vespalib_drop_file_from_cache_test_app"); + ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache vespalib_drop_file_from_cache_test_app"); drop.wait(); EXPECT_EQUAL(0, drop.getExitCode()); } diff --git a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp index 8d81d9e0821..7177a195fa3 100644 --- a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp +++ b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/exception.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> using namespace vespalib; @@ -14,32 +14,32 @@ using namespace vespalib; #endif TEST("that uncaught exception causes negative exitcode.") { - SlaveProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught"); + ChildProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that uncaught silenced exception causes exitcode 66") { - SlaveProc proc("exec ./vespalib_caught_uncaught_app silenced_and_uncaught"); + ChildProc proc("exec ./vespalib_caught_uncaught_app silenced_and_uncaught"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 66); } TEST("that caught silenced exception followed by an uncaught causes negative exitcode.") { - SlaveProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught_after_silenced_and_caught"); + ChildProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught_after_silenced_and_caught"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that caught silenced exception causes exitcode 0") { - SlaveProc proc("exec ./vespalib_caught_uncaught_app silenced_and_caught"); + ChildProc proc("exec ./vespalib_caught_uncaught_app silenced_and_caught"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 0); } #ifndef __SANITIZE_ADDRESS__ TEST("that mmap within limits are fine cause exitcode 0") { - SlaveProc proc("exec ./vespalib_mmap_app 150000000 10485760 1"); + ChildProc proc("exec ./vespalib_mmap_app 150000000 10485760 1"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 0); } @@ -48,13 +48,13 @@ TEST("that mmap within limits are fine cause exitcode 0") { // setrlimit with RLIMIT_AS is broken on Darwin #else TEST("that mmap beyond limits cause negative exitcode.") { - SlaveProc proc("ulimit -c 0 && exec ./vespalib_mmap_app 100000000 10485760 10"); + ChildProc proc("ulimit -c 0 && exec ./vespalib_mmap_app 100000000 10485760 10"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that mmap beyond limits with set VESPA_SILENCE_CORE_ON_OOM cause exitcode 66.") { - SlaveProc proc("VESPA_SILENCE_CORE_ON_OOM=1 exec ./vespalib_mmap_app 100000000 10485760 10"); + ChildProc proc("VESPA_SILENCE_CORE_ON_OOM=1 exec ./vespalib_mmap_app 100000000 10485760 10"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 66); } diff --git a/vespalib/src/tests/host_name/host_name_test.cpp b/vespalib/src/tests/host_name/host_name_test.cpp index 4e0c59d836d..21a8a571119 100644 --- a/vespalib/src/tests/host_name/host_name_test.cpp +++ b/vespalib/src/tests/host_name/host_name_test.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/host_name.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> using namespace vespalib; diff --git a/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp b/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp index a7509014b00..8ae808839db 100644 --- a/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp +++ b/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp @@ -1,12 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> using namespace vespalib; bool runPrint(const char *cmd) { std::string out; - bool res = SlaveProc::run(cmd, out); + bool res = ChildProc::run(cmd, out); fprintf(stderr, "%s", out.c_str()); return res; } diff --git a/vespalib/src/tests/slaveproc/.gitignore b/vespalib/src/tests/slaveproc/.gitignore deleted file mode 100644 index 8851e99df13..00000000000 --- a/vespalib/src/tests/slaveproc/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.depend -Makefile -slaveproc_test -vespalib_slaveproc_test_app diff --git a/vespalib/src/tests/slaveproc/CMakeLists.txt b/vespalib/src/tests/slaveproc/CMakeLists.txt deleted file mode 100644 index 58211d671bc..00000000000 --- a/vespalib/src/tests/slaveproc/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(vespalib_slaveproc_test_app TEST - SOURCES - slaveproc_test.cpp - DEPENDS - vespalib -) -vespa_add_test(NAME vespalib_slaveproc_test_app COMMAND vespalib_slaveproc_test_app) diff --git a/vespalib/src/tests/tutorial/make_tutorial.cpp b/vespalib/src/tests/tutorial/make_tutorial.cpp index 4890b0db62a..25398490318 100644 --- a/vespalib/src/tests/tutorial/make_tutorial.cpp +++ b/vespalib/src/tests/tutorial/make_tutorial.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <vespa/vespalib/util/stringfmt.h> #include <sys/mman.h> #include <sys/stat.h> @@ -20,7 +20,7 @@ std::string readFile(const std::string &filename) { std::string runCommand(const std::string &cmd) { std::string out; - ASSERT_TRUE(SlaveProc::run(cmd.c_str(), out)); + ASSERT_TRUE(ChildProc::run(cmd.c_str(), out)); return out; } diff --git a/vespalib/src/vespa/vespalib/util/CMakeLists.txt b/vespalib/src/vespa/vespalib/util/CMakeLists.txt index 4029c4881c4..65b6f508d72 100644 --- a/vespalib/src/vespa/vespalib/util/CMakeLists.txt +++ b/vespalib/src/vespa/vespalib/util/CMakeLists.txt @@ -46,7 +46,7 @@ vespa_add_library(vespalib_vespalib_util OBJECT sig_catch.cpp signalhandler.cpp simple_thread_bundle.cpp - slaveproc.cpp + child_proc.cpp stash.cpp string_hash.cpp stringfmt.cpp diff --git a/vespalib/src/vespa/vespalib/util/slaveproc.cpp b/vespalib/src/vespa/vespalib/util/child_proc.cpp index 6f40aa9a4d7..37a0a905d27 100644 --- a/vespalib/src/vespa/vespalib/util/slaveproc.cpp +++ b/vespalib/src/vespa/vespalib/util/child_proc.cpp @@ -1,17 +1,17 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "guard.h" -#include "slaveproc.h" +#include "child_proc.h" #include <cstring> namespace vespalib { -namespace slaveproc { +namespace child_proc { using namespace std::chrono; /** - * @brief SlaveProc internal timeout management. + * @brief ChildProc internal timeout management. **/ class Timer { @@ -54,14 +54,14 @@ public: } }; -} // namespace slaveproc +} // namespace child_proc -using slaveproc::Timer; +using child_proc::Timer; //----------------------------------------------------------------------------- void -SlaveProc::Reader::OnReceiveData(const void *data, size_t length) +ChildProc::Reader::OnReceiveData(const void *data, size_t length) { const char *buf = (const char *) data; MonitorGuard lock(_cond); @@ -80,7 +80,7 @@ SlaveProc::Reader::OnReceiveData(const void *data, size_t length) bool -SlaveProc::Reader::hasData() +ChildProc::Reader::hasData() { // NB: caller has lock on _cond return (!_data.empty() || !_queue.empty()); @@ -88,7 +88,7 @@ SlaveProc::Reader::hasData() bool -SlaveProc::Reader::waitForData(Timer &timer, MonitorGuard &lock) +ChildProc::Reader::waitForData(Timer &timer, MonitorGuard &lock) { // NB: caller has lock on _cond CounterGuard count(_waitCnt); @@ -100,7 +100,7 @@ SlaveProc::Reader::waitForData(Timer &timer, MonitorGuard &lock) void -SlaveProc::Reader::updateEOF() +ChildProc::Reader::updateEOF() { // NB: caller has lock on _cond if (_data.empty() && _queue.empty() && _gotEOF) { @@ -109,7 +109,7 @@ SlaveProc::Reader::updateEOF() } -SlaveProc::Reader::Reader() +ChildProc::Reader::Reader() : _cond(), _queue(), _data(), @@ -120,13 +120,13 @@ SlaveProc::Reader::Reader() } -SlaveProc::Reader::~Reader() +ChildProc::Reader::~Reader() { } uint32_t -SlaveProc::Reader::read(char *buf, uint32_t len, int msTimeout) +ChildProc::Reader::read(char *buf, uint32_t len, int msTimeout) { if (eof()) { return 0; @@ -156,7 +156,7 @@ SlaveProc::Reader::read(char *buf, uint32_t len, int msTimeout) bool -SlaveProc::Reader::readLine(std::string &line, int msTimeout) +ChildProc::Reader::readLine(std::string &line, int msTimeout) { line.clear(); if (eof()) { @@ -193,7 +193,7 @@ SlaveProc::Reader::readLine(std::string &line, int msTimeout) //----------------------------------------------------------------------------- void -SlaveProc::checkProc() +ChildProc::checkProc() { if (_running) { bool stillRunning; @@ -205,7 +205,7 @@ SlaveProc::checkProc() } -SlaveProc::SlaveProc(const char *cmd) +ChildProc::ChildProc(const char *cmd) : _reader(), _proc(cmd, true, &_reader), _running(false), @@ -217,11 +217,11 @@ SlaveProc::SlaveProc(const char *cmd) } -SlaveProc::~SlaveProc() = default; +ChildProc::~ChildProc() = default; bool -SlaveProc::write(const char *buf, uint32_t len) +ChildProc::write(const char *buf, uint32_t len) { if (len == 0) { return true; @@ -231,28 +231,28 @@ SlaveProc::write(const char *buf, uint32_t len) bool -SlaveProc::close() +ChildProc::close() { return _proc.WriteStdin(nullptr, 0); } uint32_t -SlaveProc::read(char *buf, uint32_t len, int msTimeout) +ChildProc::read(char *buf, uint32_t len, int msTimeout) { return _reader.read(buf, len, msTimeout); } bool -SlaveProc::readLine(std::string &line, int msTimeout) +ChildProc::readLine(std::string &line, int msTimeout) { return _reader.readLine(line, msTimeout); } bool -SlaveProc::wait(int msTimeout) +ChildProc::wait(int msTimeout) { bool done = true; checkProc(); @@ -273,7 +273,7 @@ SlaveProc::wait(int msTimeout) bool -SlaveProc::running() +ChildProc::running() { checkProc(); return _running; @@ -281,24 +281,24 @@ SlaveProc::running() bool -SlaveProc::failed() +ChildProc::failed() { checkProc(); return _failed; } int -SlaveProc::getExitCode() +ChildProc::getExitCode() { return _exitCode; } bool -SlaveProc::run(const std::string &input, const char *cmd, +ChildProc::run(const std::string &input, const char *cmd, std::string &output, int msTimeout) { - SlaveProc proc(cmd); + ChildProc proc(cmd); Timer timer(msTimeout); char buf[4096]; proc.write(input.data(), input.length()); @@ -317,7 +317,7 @@ SlaveProc::run(const std::string &input, const char *cmd, bool -SlaveProc::run(const char *cmd, std::string &output, int msTimeout) +ChildProc::run(const char *cmd, std::string &output, int msTimeout) { std::string input; // empty input return run(input, cmd, output, msTimeout); @@ -325,7 +325,7 @@ SlaveProc::run(const char *cmd, std::string &output, int msTimeout) bool -SlaveProc::run(const char *cmd, int msTimeout) +ChildProc::run(const char *cmd, int msTimeout) { std::string input; // empty input std::string output; // ignore output diff --git a/vespalib/src/vespa/vespalib/util/slaveproc.h b/vespalib/src/vespa/vespalib/util/child_proc.h index c08a13f0b1d..16846dcb80a 100644 --- a/vespalib/src/vespa/vespalib/util/slaveproc.h +++ b/vespalib/src/vespa/vespalib/util/child_proc.h @@ -8,17 +8,17 @@ #include <queue> #include "sync.h" -namespace vespalib::slaveproc { class Timer; } +namespace vespalib::child_proc { class Timer; } namespace vespalib { /** - * @brief Slave Process utility class for running external programs + * @brief Child Process utility class for running external programs * * Designed for use in unit tests and other places * where you need to run, control and communicate with * some external program. **/ -class SlaveProc +class ChildProc { private: class Reader : public FastOS_ProcessRedirectListener @@ -33,7 +33,7 @@ private: void OnReceiveData(const void *data, size_t length) override; bool hasData(); - bool waitForData(slaveproc::Timer &timer, MonitorGuard &lock); + bool waitForData(child_proc::Timer &timer, MonitorGuard &lock); void updateEOF(); public: @@ -54,19 +54,19 @@ private: void checkProc(); public: - SlaveProc(const SlaveProc &) = delete; - SlaveProc &operator=(const SlaveProc &) = delete; + ChildProc(const ChildProc &) = delete; + ChildProc &operator=(const ChildProc &) = delete; /** - * @brief Run a slave process + * @brief Run a child process * * Starts a process running the given command * @param cmd A shell command line to run **/ - explicit SlaveProc(const char *cmd); + explicit ChildProc(const char *cmd); /** @brief destructor doing cleanup if needed */ - ~SlaveProc(); + ~ChildProc(); /** * @return process id diff --git a/vespamalloc/src/tests/doubledelete/expectsignal.cpp b/vespamalloc/src/tests/doubledelete/expectsignal.cpp index 9ac93da014d..dbfca5722ef 100644 --- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp +++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <sys/wait.h> using namespace vespalib; @@ -25,7 +25,7 @@ int Test::Main() fprintf(stderr, "argc=%d : Running '%s' expecting signal %d\n", _argc, _argv[2], retval); - SlaveProc cmd(_argv[2]); + ChildProc cmd(_argv[2]); for(std::string line; cmd.readLine(line, 60000);) { fprintf(stdout, "%s\n", line.c_str()); } diff --git a/vespamalloc/src/tests/overwrite/expectsignal.cpp b/vespamalloc/src/tests/overwrite/expectsignal.cpp index e78f1b7b181..cba5cb2002b 100644 --- a/vespamalloc/src/tests/overwrite/expectsignal.cpp +++ b/vespamalloc/src/tests/overwrite/expectsignal.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/slaveproc.h> +#include <vespa/vespalib/util/child_proc.h> #include <sys/wait.h> using namespace vespalib; @@ -24,7 +24,7 @@ int Test::Main() fprintf(stderr, "argc=%d : Running '%s' expecting signal %d\n", _argc, _argv[2], retval); - SlaveProc cmd(_argv[2]); + ChildProc cmd(_argv[2]); for(std::string line; cmd.readLine(line, 60000);) { fprintf(stdout, "%s\n", line.c_str()); } |