From 0185347265671d0101b0e9c03fcc4e638d660705 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 20 Mar 2024 11:47:40 +0000 Subject: Avoid subshell hiding failure report from testfilestats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We remove the working directory from the found file names as these paths could contain a lot of funny characters confusing the for loop like spaces… we just readd it later in the actual calls to be safe. --- test/integration/framework | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 1eec8ca05..0570d5c8e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -2094,11 +2094,12 @@ testfilestats() { else local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfilestats.output" { + echo ls -ld "$1" || true echo -n "stat(1) reports for $2: " stat --format "$2" "$1" || true } >"$OUTPUT" 2>&1 - msgfailoutput '' "$OUTPUT" + msgfailoutput '' "$OUTPUT" stat --format "$2" "$1" fi msggroup } @@ -2261,8 +2262,8 @@ aptautotest_aptget_update() { # all copied files are properly chmodded local backupIFS="$IFS" IFS="$(printf "\n\b")" - cdfind "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -type f ! -name 'lock' | while read file; do - testfilestats "$file" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" + for file in $(cdfind "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -type f ! -name 'lock' | cut -c "$((${#TMPWORKINGDIRECTORY} + 1))-"); do + testfilestats "${TMPWORKINGDIRECTORY}$file" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" done IFS="$backupIFS" if [ "$TESTCALL" = 'testsuccess' ]; then -- cgit v1.2.3-70-g09d2