]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop default ACL from $TESTDIR
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 May 2021 06:47:01 +0000 (15:47 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 May 2021 09:28:00 +0000 (11:28 +0200)
This fixes an issue introduced by the commit 954c77c2510c0328fd98354a59f380945752c38c.

For some reasons, setting default ACL on $TESTDIR makes TEST-29-PORTABLE
fail. Let's drop the default ACL, and set ACL on saved results instead.

Fixes #19519.

test/test-functions

index 87b82db4219149bbc7a03307da83a2d29d1392de..64accfc29ea98c47925965396dea4331ae84b1a7 100644 (file)
@@ -1131,6 +1131,10 @@ save_journal() {
         rm -r "$j"
     done
 
+    if [ -n "${SUDO_USER}" ]; then
+        setfacl -m "user:${SUDO_USER:?}:r-X" "$dest"*
+    fi
+
     # we want to print this sometime later, so save this in a variable
     JOURNAL_LIST="$(ls -l "$dest"*)"
 }
@@ -1142,6 +1146,9 @@ check_result_common() {
     if [ -s "$workspace/failed" ]; then
         # Non-empty …/failed has highest priority
         cp -a "$workspace/failed" "${TESTDIR:?}/"
+        if [ -n "${SUDO_USER}" ]; then
+            setfacl -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}/"failed
+        fi
         ret=1
     elif [ -e "$workspace/testok" ]; then
         # …/testok always counts (but with lower priority than …/failed)
@@ -2477,7 +2484,6 @@ do_test() {
     if [ -n "${SUDO_USER}" ]; then
         ddebug "Making ${TESTDIR:?} readable for ${SUDO_USER} (acquired from sudo)"
         setfacl -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}"
-        setfacl -d -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}"
     fi
 
     testname="$(basename "$PWD")"