From e945f0efa92fd32e09abc3635f8160e95e11686b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 1 Apr 2020 20:18:41 +0100 Subject: Remove glacier.pid before and after runs of test --- netfs/unittests/testGlacier.cpp | 7 +++++-- 1 file 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 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; { -- cgit v1.2.3