]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Fail sysext test if reusing a root directory
authorKrzesimir Nowak <knowak@microsoft.com>
Tue, 19 Mar 2024 13:40:57 +0000 (14:40 +0100)
committerKrzesimir Nowak <knowak@microsoft.com>
Mon, 25 Mar 2024 07:14:36 +0000 (08:14 +0100)
test/units/testsuite-50.sh

index 370e8f01ed3b9a267aaec3753a8acbd7c7824480..dc31ce4da36b502e823d464601f99fe7ddefc120 100755 (executable)
@@ -808,6 +808,10 @@ prep_root() {
     local r=${1}; shift
     local h=${1}; shift
 
+    if [[ -d ${r} ]]; then
+        die "${r@Q} is being reused as a root, possibly a result of copy-pasting some test case and forgetting to rename the root directory name"
+    fi
+
     mkdir -p "${r}${h}" "${r}/usr/lib" "${r}/var/lib/extensions" "${r}/var/lib/extensions.mutable"
 }