summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/bucketdb/bucketmanagertest.cpp6
-rw-r--r--storage/src/tests/common/testhelper.cpp3
-rw-r--r--storage/src/tests/distributor/distributor_host_info_reporter_test.cpp3
-rw-r--r--storage/src/tests/distributor/getoperationtest.cpp4
-rw-r--r--storage/src/tests/distributor/operationtargetresolvertest.cpp4
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp4
-rw-r--r--storage/src/tests/distributor/twophaseupdateoperationtest.cpp1
-rw-r--r--storage/src/tests/distributor/updateoperationtest.cpp4
-rw-r--r--storage/src/tests/storageserver/documentapiconvertertest.cpp3
-rw-r--r--storage/src/tests/testhelper.cpp3
10 files changed, 24 insertions, 11 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp
index ee2e3f6ef7f..7e34c14a495 100644
--- a/storage/src/tests/bucketdb/bucketmanagertest.cpp
+++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp
@@ -24,6 +24,7 @@ LOG_SETUP(".test.bucketdb.bucketmanager");
#include <vespa/vdslib/state/random.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/stllike/string.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/storageapi/message/bucket.h>
#include <thread>
#include <future>
@@ -158,6 +159,7 @@ public:
static constexpr uint32_t DIR_SPREAD = 3;
static constexpr uint32_t MESSAGE_WAIT_TIME = 60*2;
+
void setUp() {
_emptyBuckets = 0;
}
@@ -192,8 +194,8 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer,
vdstestlib::DirConfig config(getStandardConfig(true));
DocumentTypeRepo::SP repo(new DocumentTypeRepo(
- *ConfigGetter<DocumenttypesConfig>::getConfig("config-doctypes",
- FileSpec("config-doctypes.cfg"))));
+ *ConfigGetter<DocumenttypesConfig>::getConfig(
+ "config-doctypes", FileSpec(vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))));
_top.reset(new DummyStorageLink);
_node.reset(new TestServiceLayerApp(
DiskCount(2), NodeIndex(0), config.getConfigId()));
diff --git a/storage/src/tests/common/testhelper.cpp b/storage/src/tests/common/testhelper.cpp
index b8b42124d39..a530b918b77 100644
--- a/storage/src/tests/common/testhelper.cpp
+++ b/storage/src/tests/common/testhelper.cpp
@@ -4,6 +4,7 @@
#include <vespa/log/log.h>
#include <vespa/vespalib/io/fileutil.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP(".testhelper");
@@ -159,7 +160,7 @@ vdstestlib::DirConfig getStandardConfig(bool storagenode) {
config->set("maxconcurrentvisitors_fixed", "4");
config->set("maxconcurrentvisitors_variable", "0");
config = &dc.addConfig("stor-visitordispatcher");
- addFileConfig(dc, "documenttypes", "config-doctypes.cfg");
+ addFileConfig(dc, "documenttypes", vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg");
addStorageDistributionConfig(dc);
return dc;
}
diff --git a/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp b/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
index 65ccc65bdcf..8cbe2045fd2 100644
--- a/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
+++ b/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
@@ -7,6 +7,7 @@
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/jsonstream.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <tests/common/hostreporter/util.h>
namespace storage {
@@ -186,7 +187,7 @@ DistributorHostInfoReporterTest::generateExampleJson()
std::string jsonString = json.str();
- std::string path = "../../../protocols/getnodestate/distributor.json";
+ std::string path = vespalib::TestApp::GetSourceDirectory() + "../../../protocols/getnodestate/distributor.json";
std::string goldenString = File::readAll(path);
vespalib::slime::Memory goldenMemory(goldenString);
diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp
index 12853be2e42..169fdc1c213 100644
--- a/storage/src/tests/distributor/getoperationtest.cpp
+++ b/storage/src/tests/distributor/getoperationtest.cpp
@@ -10,6 +10,7 @@
#include <tests/distributor/distributortestutil.h>
#include <tests/common/dummystoragelink.h>
#include <vespa/vdstestlib/cppunit/macros.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <iomanip>
#include <iostream>
#include <memory>
@@ -54,7 +55,8 @@ public:
void setUp() {
_repo.reset(
new document::DocumentTypeRepo(*ConfigGetter<DocumenttypesConfig>::
- getConfig("config-doctypes", FileSpec("config-doctypes.cfg"))));
+ getConfig("config-doctypes",
+ FileSpec(vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))));
createLinks();
docId = document::DocumentId(document::DocIdString("test", "uri"));
diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp
index 5b23d3a7a9e..27f1cb722b0 100644
--- a/storage/src/tests/distributor/operationtargetresolvertest.cpp
+++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp
@@ -14,6 +14,7 @@
#include <tests/common/dummystoragelink.h>
#include <vespa/vdslib/distribution/idealnodecalculatorimpl.h>
#include <vespa/vdstestlib/cppunit/macros.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/storage/distributor/operationtargetresolverimpl.h>
using document::BucketId;
@@ -49,7 +50,8 @@ struct OperationTargetResolverTest : public CppUnit::TestFixture,
void setUp() {
_repo.reset(new document::DocumentTypeRepo(
*config::ConfigGetter<document::DocumenttypesConfig>::getConfig(
- "config-doctypes", config::FileSpec("config-doctypes.cfg"))));
+ "config-doctypes",
+ config::FileSpec(vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))));
_html_type = _repo->getDocumentType("text/html");
createLinks();
};
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index 011b34cd1e3..d2dc7583229 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -12,6 +12,7 @@
#include <tests/common/dummystoragelink.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/text/stringtokenizer.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <iomanip>
#include <iostream>
#include <memory>
@@ -93,7 +94,8 @@ public:
void setUp() {
_repo.reset(
new DocumentTypeRepo(*ConfigGetter<DocumenttypesConfig>
- ::getConfig("config-doctypes", FileSpec("config-doctypes.cfg"))));
+ ::getConfig("config-doctypes",
+ FileSpec(vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))));
_html_type = _repo->getDocumentType("text/html");
createLinks();
};
diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
index f6346c9755f..60f836e3ea7 100644
--- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
+++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
@@ -25,7 +25,6 @@ namespace distributor {
using std::shared_ptr;
using config::ConfigGetter;
using document::DocumenttypesConfig;
-using config::FileSpec;
using namespace document;
using namespace storage;
using namespace storage::distributor;
diff --git a/storage/src/tests/distributor/updateoperationtest.cpp b/storage/src/tests/distributor/updateoperationtest.cpp
index 912d0235e42..9a2b529eb77 100644
--- a/storage/src/tests/distributor/updateoperationtest.cpp
+++ b/storage/src/tests/distributor/updateoperationtest.cpp
@@ -13,6 +13,7 @@
#include <vespa/document/config/config-documenttypes.h>
#include <tests/distributor/messagesenderstub.h>
#include <vespa/storage/distributor/operations/external/updateoperation.h>
+#include <vespa/vespalib/testkit/testapp.h>
using std::shared_ptr;
using namespace document;
@@ -48,7 +49,8 @@ public:
void setUp() {
_repo.reset(
new DocumentTypeRepo(*ConfigGetter<DocumenttypesConfig>::
- getConfig("config-doctypes", FileSpec("config-doctypes.cfg"))));
+ getConfig("config-doctypes",
+ FileSpec(vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))));
_html_type = _repo->getDocumentType("text/html");
createLinks();
}
diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp
index 69083352c4a..604e849ebe8 100644
--- a/storage/src/tests/storageserver/documentapiconvertertest.cpp
+++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp
@@ -15,6 +15,7 @@
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageapi/message/visitor.h>
#include <vespa/vdslib/container/writabledocumentlist.h>
+#include <vespa/vespalib/testkit/testapp.h>
using document::DataType;
using document::DocIdString;
@@ -33,7 +34,7 @@ struct DocumentApiConverterTest : public CppUnit::TestFixture
DocumentApiConverterTest()
: _repo(new DocumentTypeRepo(readDocumenttypesConfig(
- "config-doctypes.cfg"))),
+ vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg"))),
_html_type(*_repo->getDocumentType("text/html"))
{
}
diff --git a/storage/src/tests/testhelper.cpp b/storage/src/tests/testhelper.cpp
index c4074aa1ac6..55690b2382b 100644
--- a/storage/src/tests/testhelper.cpp
+++ b/storage/src/tests/testhelper.cpp
@@ -125,7 +125,8 @@ vdstestlib::DirConfig getStandardConfig(bool storagenode) {
config->set("maxconcurrentvisitors_fixed", "4");
config->set("maxconcurrentvisitors_variable", "0");
config = &dc.addConfig("stor-visitordispatcher");
- addFileConfig(dc, "documenttypes", "config-doctypes.cfg");
+ addFileConfig(dc, "documenttypes",
+ vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg");
addStorageDistributionConfig(dc);
return dc;
}