From a61ae8c0a99a09e245309e613f897c8002e6f8a3 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 3 Apr 2024 12:09:31 +0200 Subject: [PATCH] test/system: add rootless-netns test for setup errors This is a test for #22168. Signed-off-by: Paul Holzinger --- test/system/505-networking-pasta.bats | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/system/505-networking-pasta.bats b/test/system/505-networking-pasta.bats index 229b0adfeb..9a96c61836 100644 --- a/test/system/505-networking-pasta.bats +++ b/test/system/505-networking-pasta.bats @@ -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}.*" }