summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-02-14 16:51:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-02-14 16:51:09 +0000
commit866e20158b146bc6db59373b70afaea712246483 (patch)
treef9c080c9e991c99d592b1a7d4d4ee8a24221aaf7
parentGet config deserializer by file extension (diff)
downloadnetfs-866e20158b146bc6db59373b70afaea712246483.tar.bz2
netfs-866e20158b146bc6db59373b70afaea712246483.tar.xz
netfs-866e20158b146bc6db59373b70afaea712246483.zip
Create test export in bin dir, not root dir
-rw-r--r--netfs/unittests/mockDaemon.cpp2
-rw-r--r--netfs/unittests/testCore.cpp26
2 files changed, 14 insertions, 14 deletions
diff --git a/netfs/unittests/mockDaemon.cpp b/netfs/unittests/mockDaemon.cpp
index af3cf04..b428e28 100644
--- a/netfs/unittests/mockDaemon.cpp
+++ b/netfs/unittests/mockDaemon.cpp
@@ -3,7 +3,7 @@
#include <definedDirs.h>
#include <buffer.h>
-const boost::filesystem::path TestExportRoot(rootDir /
+const boost::filesystem::path TestExportRoot(binDir /
stringbf("testExport-%d", getpid()));
MockDaemon::MockDaemon(const std::string & ep) :
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index 9c8419b..b56e11c 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -16,7 +16,7 @@ class Core {
}),
fuseHost(testEndpoint, {
(rootDir / fuseConfig).string() + ":testvol",
- (rootDir / "test").string()
+ (binDir / "test").string()
}),
ic(daemonHost.ic),
fuse(fuseHost.fuse)
@@ -52,31 +52,31 @@ BOOST_AUTO_TEST_CASE( testSandboxing )
{
const auto testExport = stringbf("testExport-%d", getpid());
// A previous (bad) run might create one or more of these:
- boost::filesystem::remove(rootDir / "outside");
- boost::filesystem::remove(rootDir / "sub" / "outside");
- boost::filesystem::remove(rootDir / "sub");
+ boost::filesystem::remove(binDir / "outside");
+ boost::filesystem::remove(binDir / "sub" / "outside");
+ boost::filesystem::remove(binDir / "sub");
struct fuse_file_info fi;
memset(&fi, 0, sizeof(fi));
BOOST_REQUIRE_EQUAL(fuse->create("../outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "outside"));
BOOST_REQUIRE_EQUAL(fuse->create("/../outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "outside"));
BOOST_REQUIRE_EQUAL(fuse->create("../sub/outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "sub" / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "sub" / "outside"));
BOOST_REQUIRE_EQUAL(fuse->create("/../sub/outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "sub" / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "sub" / "outside"));
BOOST_REQUIRE_EQUAL(fuse->create("../sub/../outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "outside"));
BOOST_REQUIRE_EQUAL(fuse->create("/../sub/../outside", 0666, &fi), -EPERM);
- BOOST_REQUIRE(!boost::filesystem::exists(rootDir / "outside"));
+ BOOST_REQUIRE(!boost::filesystem::exists(binDir / "outside"));
int fd = fuse->create("/inside", 0666, &fi);
BOOST_REQUIRE(fd >= 0);
fuse->release("/inside", &fi);
- BOOST_REQUIRE(boost::filesystem::exists(rootDir / testExport / "inside"));
+ BOOST_REQUIRE(boost::filesystem::exists(binDir / testExport / "inside"));
int fd2 = fuse->create("inside", 0666, &fi);
BOOST_REQUIRE(fd2 >= 0);
fuse->release("inside", &fi);
- BOOST_REQUIRE(boost::filesystem::exists(rootDir / testExport / "inside"));
+ BOOST_REQUIRE(boost::filesystem::exists(binDir / testExport / "inside"));
}
BOOST_AUTO_TEST_SUITE_END();
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE( uriConnect )
});
FuseMockHost fuse(std::string(), {
testUri,
- (rootDir / "test").string(),
+ (binDir / "test").string(),
});
struct statvfs s;