From cf9bc25bbcdab34ea385210011e843ac7327630b Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 5 Jun 2023 12:43:27 +1000 Subject: [PATCH] pasta: Test handling of unknown protocols Test that pasta generates a sensible error message if asked to forward a protocol it doesn't understand. Signed-off-by: Stefano Brivio Signed-off-by: David Gibson --- test/system/505-networking-pasta.bats | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/system/505-networking-pasta.bats b/test/system/505-networking-pasta.bats index 032c9b0b89..a5cdcd8444 100644 --- a/test/system/505-networking-pasta.bats +++ b/test/system/505-networking-pasta.bats @@ -681,3 +681,11 @@ function teardown() { sleep 1 ! ps -p $(cat "${pidfile}") && rm "${pidfile}" } + +### Options #################################################################### +@test "podman networking with pasta(1) - Unsupported protocol in port forwarding" { + local port=$(random_free_port "" "" tcp) + + run_podman 126 run --net=pasta -p "${port}:${port}/sctp" $IMAGE true + is "$output" "Error: .*can't forward protocol: sctp" +}