From 6b021dd4ba58bccce443044b985af879429f1784 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 31 May 2024 16:42:11 +0200 Subject: [PATCH] test/system: speed up user namespace preserved root ownership We don't have two loop twice for the stat call we can just stat both dirs at once. This means we only have to create half of the containers so the test is twice as fast. Signed-off-by: Paul Holzinger --- test/system/030-run.bats | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 5ff1fb29ba..9049a74fad 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -308,12 +308,10 @@ echo $rand | 0 | $rand for user in "--user=0" "--user=100"; do for keepid in "" ${keep}; do opts="$priv $user $keepid" - - for dir in /etc /usr;do - run_podman run --rm $opts $IMAGE stat -c '%u:%g:%n' $dir - remove_same_dev_warning # grumble - is "$output" "0:0:$dir" "run $opts ($dir)" - done + run_podman run --rm $opts $IMAGE stat -c '%u:%g:%n' $dir /etc /usr + remove_same_dev_warning # grumble + is "${lines[0]}" "0:0:/etc" "run $opts /etc" + is "${lines[1]}" "0:0:/usr" "run $opts /usr" done done done