diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm index 7b5368dbc..921724866 100644 --- a/test/lib/pgBackRestTest/Common/JobTest.pm +++ b/test/lib/pgBackRestTest/Common/JobTest.pm @@ -701,7 +701,7 @@ sub end containerRemove("test-$self->{iVmIdx}"); } - executeTest("rm -rf ${strHostTestPath}"); + executeTest("chmod -R 700 ${strHostTestPath}/* 2>&1;rm -rf ${strHostTestPath}"); } $bDone = true; diff --git a/test/src/common/harnessTest.c b/test/src/common/harnessTest.c index a50878de5..789e13025 100644 --- a/test/src/common/harnessTest.c +++ b/test/src/common/harnessTest.c @@ -169,7 +169,9 @@ testBegin(const char *name) // Clear out the test directory so the next test starts clean char buffer[2048]; - snprintf(buffer, sizeof(buffer), "%srm -rf %s/" "*", testContainer() ? "sudo " : "", testPath()); + snprintf( + buffer, sizeof(buffer), "%schmod -R 700 %s/" "*;%srm -rf %s/" "*", testContainer() ? "sudo " : "", testPath(), + testContainer() ? "sudo " : "", testPath()); if (system(buffer) != 0) { @@ -179,7 +181,9 @@ testBegin(const char *name) } // Clear out the data directory so the next test starts clean - snprintf(buffer, sizeof(buffer), "%srm -rf %s/" "*", testContainer() ? "sudo " : "", testDataPath()); + snprintf( + buffer, sizeof(buffer), "%schmod -R 700 %s/" "*;%srm -rf %s/" "*", testContainer() ? "sudo " : "", + testDataPath(), testContainer() ? "sudo " : "", testDataPath()); if (system(buffer) != 0) {