Skip to content

Commit

Permalink
test/system: add rootless-netns test for setup errors
Browse files Browse the repository at this point in the history
This is a test for containers#22168.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Apr 3, 2024
1 parent ce04fbc commit a61ae8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/system/505-networking-pasta.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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}.*"
}

0 comments on commit a61ae8c

Please sign in to comment.