mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
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 <pholzing@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user