From 1da18e85baa273835c2b0f727374e010f6fd2e89 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 14 May 2024 16:23:08 +0200 Subject: [PATCH] tests/functional/common/init.sh: Make $TEST_ROOT writable before removing it $TEST_ROOT typically contains read-only files/directories (e.g. the Nix store). So we have to make it writable first. --- tests/functional/common/init.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/common/init.sh b/tests/functional/common/init.sh index 017179952..74da12651 100755 --- a/tests/functional/common/init.sh +++ b/tests/functional/common/init.sh @@ -2,7 +2,10 @@ test -n "$TEST_ROOT" # We would delete any daemon socket, so let's stop the daemon first. killDaemon # Destroy the test directory that may have persisted from previous runs -rm -rf "$TEST_ROOT" +if [[ -e "$TEST_ROOT" ]]; then + chmod -R u+w "$TEST_ROOT" + rm -rf "$TEST_ROOT" +fi mkdir -p "$TEST_ROOT" mkdir "$TEST_HOME"