diff options
-rw-r--r-- | netfs/unittests/testGlacier.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/netfs/unittests/testGlacier.cpp b/netfs/unittests/testGlacier.cpp index 44f52f4..f4474fb 100644 --- a/netfs/unittests/testGlacier.cpp +++ b/netfs/unittests/testGlacier.cpp @@ -6,15 +6,18 @@ #include <definedDirs.h> const std::string testEndpoint("tcp -h localhost -p 12013"); +#define PID "/tmp/glacier.pid" BOOST_AUTO_TEST_CASE ( withRouter ) { + std::filesystem::remove(PID); BOOST_REQUIRE_EQUAL(0, - system("/usr/bin/glacier2router --Glacier2.Client.Endpoints='tcp -p 14063' --Glacier2.PermissionsVerifier=Glacier2/NullPermissionsVerifier --daemon --pidfile /tmp/glacier.pid")); + system("/usr/bin/glacier2router --Glacier2.Client.Endpoints='tcp -p 14063' --Glacier2.PermissionsVerifier=Glacier2/NullPermissionsVerifier --daemon --pidfile " PID)); sleep(1); BOOST_SCOPE_EXIT(void) { - BOOST_REQUIRE_EQUAL(0, system("kill $(cat /tmp/glacier.pid)")); + BOOST_REQUIRE_EQUAL(0, system("kill $(cat " PID ")")); + std::filesystem::remove(PID); } BOOST_SCOPE_EXIT_END; { |