summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-04-27 17:06:30 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-05-03 13:39:17 -0400
commit66500b82a645428e1a59ce25fda1b76965df21cf (patch)
treea3b1a3c86dafff6c687a16395f46a7e3e748047b /test/system
parent8627b5151079cde65594c0c1588cdd5c1114ff94 (diff)
downloadpodman-66500b82a645428e1a59ce25fda1b76965df21cf.tar.gz
podman-66500b82a645428e1a59ce25fda1b76965df21cf.tar.bz2
podman-66500b82a645428e1a59ce25fda1b76965df21cf.zip
Report properly whether pod shares host network
Fixes: https://github.com/containers/podman/issues/14028 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/200-pod.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index ef4bf1a6c..64f95f723 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -381,4 +381,32 @@ EOF
is "$output" ".*$container_3_ID.*"
}
+@test "podman pod create share net" {
+ run_podman pod create --name test
+ run_podman pod inspect test --format {{.InfraConfig.HostNetwork}}
+ is "$output" "false" "Default network sharing should be false"
+ run_podman pod rm test
+
+ run_podman pod create --name test --share ipc --network private
+ run_podman pod inspect test --format {{.InfraConfig.HostNetwork}}
+ is "$output" "false" "Private network sharing with only ipc should be false"
+ run_podman pod rm test
+
+ run_podman pod create --name test --share net --network private
+ run_podman pod inspect test --format {{.InfraConfig.HostNetwork}}
+ is "$output" "false" "Private network sharing with only net should be false"
+ run_podman pod rm test
+
+ run_podman pod create --name test --share net --network host
+ run_podman pod inspect test --format {{.InfraConfig.HostNetwork}}
+ is "$output" "true" "Host network sharing with only net should be true"
+ run_podman pod rm test
+
+ run_podman pod create --name test --share ipc --network host
+ run_podman pod inspect test --format {{.InfraConfig.HostNetwork}}
+ is "$output" "true" "Host network sharing with only ipc should be true"
+ run_podman pod rm test
+
+}
+
# vim: filetype=sh