summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-09-07 18:24:22 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-08 10:09:28 +0200
commitf18ccbcc0f70c23a6b854130395d9a940383290b (patch)
tree9cbb69f94e1c7ef738c07aee8a0ed2bf6f45f0ef /test/system
parent8a55363b80a012b6c6e774957ac477d0fd540a5e (diff)
downloadpodman-f18ccbcc0f70c23a6b854130395d9a940383290b.tar.gz
podman-f18ccbcc0f70c23a6b854130395d9a940383290b.tar.bz2
podman-f18ccbcc0f70c23a6b854130395d9a940383290b.zip
fix play kube --network options
Commit 092902b45555 introduced advanced network options for podman play kube. However this never worked because it unconditionally set the network mode to bridge after it parsed the network option. Added a test to ensure the correct mode is set. Truly fixes #10807 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/700-play.bats10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/system/700-play.bats b/test/system/700-play.bats
index 7f35877aa..2b05cdd84 100644
--- a/test/system/700-play.bats
+++ b/test/system/700-play.bats
@@ -98,6 +98,16 @@ RELABEL="system_u:object_r:container_file_t:s0"
run_podman 125 play kube --network host $PODMAN_TMPDIR/test.yaml
is "$output" ".*invalid value passed to --network: bridge or host networking must be configured in YAML" "podman plan-network should fail with --network host"
run_podman play kube --network slirp4netns:port_handler=slirp4netns $PODMAN_TMPDIR/test.yaml
+ run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}"
+ infraID="$output"
+ run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID
+ is "$output" "slirp4netns" "network mode slirp4netns is set for the container"
+ run_podman pod rm -f test_pod
+ run_podman play kube --network none $PODMAN_TMPDIR/test.yaml
+ run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}"
+ infraID="$output"
+ run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID
+ is "$output" "none" "network mode none is set for the container"
run_podman pod rm -f test_pod
}