diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-05-16 12:57:07 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-05-16 12:57:07 +0000 |
commit | b377a3c28efec6dae55a33cea1e536cc8b7117e7 (patch) | |
tree | a7b7d16233375ba3961c7a04faab059ead4e892e /storageserver | |
parent | 9a3ef654bfe4dda2a3c0d74928a29d8e75e35ae9 (diff) |
Remove vdstestlib module
Was only used by `DirConfig`.
Diffstat (limited to 'storageserver')
-rw-r--r-- | storageserver/src/tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | storageserver/src/tests/storageservertest.cpp | 4 | ||||
-rw-r--r-- | storageserver/src/tests/testhelper.cpp | 118 | ||||
-rw-r--r-- | storageserver/src/tests/testhelper.h | 24 |
4 files changed, 2 insertions, 146 deletions
diff --git a/storageserver/src/tests/CMakeLists.txt b/storageserver/src/tests/CMakeLists.txt index db272ccc795..e845c652c87 100644 --- a/storageserver/src/tests/CMakeLists.txt +++ b/storageserver/src/tests/CMakeLists.txt @@ -3,12 +3,10 @@ vespa_add_executable(storageserver_gtest_runner_app TEST SOURCES storageservertest.cpp - testhelper.cpp gtest_runner.cpp DEPENDS storageserver_storageapp storage_testcommon - vdstestlib GTest::GTest ) diff --git a/storageserver/src/tests/storageservertest.cpp b/storageserver/src/tests/storageservertest.cpp index 3e5edc23464..58edcac0c7d 100644 --- a/storageserver/src/tests/storageservertest.cpp +++ b/storageserver/src/tests/storageservertest.cpp @@ -1,12 +1,12 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <tests/testhelper.h> #include <tests/common/storage_config_set.h> +#include <vespa/messagebus/testlib/slobrok.h> +#include <vespa/messagebus/message.h> #include <vespa/storage/storageserver/distributornode.h> #include <vespa/storage/storageserver/servicelayernode.h> #include <vespa/storageserver/app/distributorprocess.h> #include <vespa/storageserver/app/dummyservicelayerprocess.h> -#include <vespa/messagebus/message.h> #include <vespa/vespalib/gtest/gtest.h> #include <vespa/log/log.h> diff --git a/storageserver/src/tests/testhelper.cpp b/storageserver/src/tests/testhelper.cpp deleted file mode 100644 index e3b047ddfd1..00000000000 --- a/storageserver/src/tests/testhelper.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <tests/testhelper.h> - -#include <vespa/log/log.h> -LOG_SETUP(".testhelper"); - -namespace storage { - -void addStorageDistributionConfig(vdstestlib::DirConfig& dc) -{ - vdstestlib::DirConfig::Config* config; - config = &dc.getConfig("stor-distribution", true); - config->clear(); - config->set("group[1]"); - config->set("group[0].name", "invalid"); - config->set("group[0].index", "invalid"); - config->set("group[0].nodes[50]"); - - for (uint32_t i = 0; i < 50; i++) { - std::ostringstream key; key << "group[0].nodes[" << i << "].index"; - std::ostringstream val; val << i; - config->set(key.str(), val.str()); - } -} - -vdstestlib::DirConfig getStandardConfig(bool storagenode) { - vdstestlib::DirConfig dc; - vdstestlib::DirConfig::Config* config; - config = &dc.addConfig("upgrading"); - config = &dc.addConfig("load-type"); - config = &dc.addConfig("bucket"); - config = &dc.addConfig("messagebus"); - config = &dc.addConfig("stor-prioritymapping"); - config = &dc.addConfig("stor-bucketdbupdater"); - config = &dc.addConfig("metricsmanager"); - config->set("consumer[1]"); - config->set("consumer[0].name", "\"status\""); - config->set("consumer[0].addedmetrics[1]"); - config->set("consumer[0].addedmetrics[0]", "\"*\""); - config = &dc.addConfig("stor-communicationmanager"); - config->set("rpcport", "0"); - config->set("mbusport", "0"); - config = &dc.addConfig("stor-distributormanager"); - config = &dc.addConfig("stor-filestor"); - // Easier to see what goes wrong with only 1 thread per disk. - config->set("threads[1]"); - config->set("threads[0].lowestpri 255"); - config->set("maximum_versions_of_single_document_stored", "0"); - //config->set("enable_slotfile_cache", "false"); - // Unit tests typically use fake low time values, so don't complain - // about them or compact/delete them by default. Override in tests testing that - // behavior - config->set("keep_remove_time_period", "2000000000"); - config->set("revert_time_period", "2000000000"); - config = &dc.addConfig("persistence"); - config->set("keep_remove_time_period", "2000000000"); - config->set("revert_time_period", "2000000000"); - config = &dc.addConfig("stor-bouncer"); - config = &dc.addConfig("stor-integritychecker"); - config = &dc.addConfig("stor-server"); - config->set("enable_dead_lock_detector", "false"); - config->set("enable_dead_lock_detector_warnings", "false"); - config->set("max_merges_per_node", "25"); - config->set("max_merge_queue_size", "20"); - config->set("root_folder", (storagenode ? "vdsroot" : "vdsroot.distributor")); - config->set("is_distributor", (storagenode ? "false" : "true")); - config->set("write_pid_file_on_startup", "false"); - config = &dc.addConfig("stor-devices"); - config->set("root_folder", (storagenode ? "vdsroot" : "vdsroot.distributor")); - config = &dc.addConfig("stor-status"); - config->set("httpport", "0"); - config = &dc.addConfig("stor-visitor"); - config->set("defaultdocblocksize", "8192"); - // By default, need "old" behaviour of maxconcurrent - config->set("maxconcurrentvisitors_fixed", "4"); - config->set("maxconcurrentvisitors_variable", "0"); - dc.addConfig("stor-visitordispatcher"); - config = &dc.addConfig("bucketspaces"); - config->set("documenttype[1]"); - config->set("documenttype[0].name", "testdoctype1"); - config->set("documenttype[0].bucketspace", "default"); - addFileConfig(dc, "documenttypes", "config-doctypes.cfg"); - addStorageDistributionConfig(dc); - return dc; -} - -void addSlobrokConfig(vdstestlib::DirConfig& dc, const mbus::Slobrok& slobrok) -{ - std::ostringstream ost; - ost << "tcp/localhost:" << slobrok.port(); - vdstestlib::DirConfig::Config* config; - config = &dc.getConfig("slobroks", true); - config->clear(); - config->set("slobrok[1]"); - config->set("slobrok[0].connectionspec", ost.str()); -} - -void addFileConfig(vdstestlib::DirConfig& dc, - const std::string& configDefName, - const std::string& fileName) -{ - vdstestlib::DirConfig::Config* config; - config = &dc.getConfig(configDefName, true); - config->clear(); - std::ifstream in(fileName.c_str()); - std::string line; - while (std::getline(in, line, '\n')) { - std::string::size_type pos = line.find(' '); - if (pos == std::string::npos) { - config->set(line); - } else { - config->set(line.substr(0, pos), line.substr(pos + 1)); - } - } - in.close(); -} - -} // storage diff --git a/storageserver/src/tests/testhelper.h b/storageserver/src/tests/testhelper.h deleted file mode 100644 index 9d0fceee84b..00000000000 --- a/storageserver/src/tests/testhelper.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include <fstream> -#include <sstream> -#include <vespa/messagebus/testlib/slobrok.h> -#include <vespa/vdstestlib/config/dirconfig.h> - -namespace storage { - -void addFileConfig(vdstestlib::DirConfig& dc, - const std::string& configDefName, - const std::string& fileName); - - -void addStorageDistributionConfig(vdstestlib::DirConfig& dc); - -vdstestlib::DirConfig getStandardConfig(bool storagenode); - -void addSlobrokConfig(vdstestlib::DirConfig& dc, - const mbus::Slobrok& slobrok); - -} // storage - |