summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2024-03-20 11:47:40 +0000
committerDavid Kalnischkies <david@kalnischkies.de>2024-03-30 15:59:57 +0000
commit0185347265671d0101b0e9c03fcc4e638d660705 (patch)
treef409eebb3cd665296ca8a90ac9d76b43ee566901 /test
parentdb797312548f6e7d6d1d1faa9f1e48c1e521d290 (diff)
Avoid subshell hiding failure report from testfilestats
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.
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework7
1 files 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