test/system: add rootless-netns test for setup errors

This is a test for #22168.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2024-04-03 12:09:31 +02:00
parent ce04fbc16a
commit a61ae8c0a9
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 6 additions and 0 deletions

View File

@ -785,6 +785,12 @@ EOF
pasta_iface=$(default_ifname)
# First let's force a setup error by making pasta be "false".
ln -s /usr/bin/false $PODMAN_TMPDIR/pasta
CONTAINERS_HELPER_BINARY_DIR="$PODMAN_TMPDIR" run_podman 125 unshare --rootless-netns ip addr
assert "$output" =~ "pasta failed with exit code 1"
# Now this should recover from the previous error and setup the netns correctly.
run_podman unshare --rootless-netns ip addr
is "$output" ".*${pasta_iface}.*"
}