summaryrefslogtreecommitdiff
path: root/test/system/700-play.bats
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-13 19:29:16 +0000
committerGitHub <noreply@github.com>2022-07-13 19:29:16 +0000
commit5c3eec55895c9ca4c36571e1e919f0cb8632bedb (patch)
tree711c52400d7bfa70c053cfde9a63d013d3e08bcd /test/system/700-play.bats
parent5f8d08d593d625beaa224c48e7da945c4f90ea48 (diff)
parente08a77ce64eec5cd0192ae1970fa859c00440174 (diff)
downloadpodman-5c3eec55895c9ca4c36571e1e919f0cb8632bedb.tar.gz
podman-5c3eec55895c9ca4c36571e1e919f0cb8632bedb.tar.bz2
podman-5c3eec55895c9ca4c36571e1e919f0cb8632bedb.zip
Merge pull request #14772 from nicrowe00/12475
Add "podman kube play" cmd
Diffstat (limited to 'test/system/700-play.bats')
-rw-r--r--test/system/700-play.bats34
1 files changed, 24 insertions, 10 deletions
diff --git a/test/system/700-play.bats b/test/system/700-play.bats
index 6c2a8c8b1..53e9a5274 100644
--- a/test/system/700-play.bats
+++ b/test/system/700-play.bats
@@ -65,12 +65,12 @@ status: {}
RELABEL="system_u:object_r:container_file_t:s0"
-@test "podman play with stdin" {
+@test "podman kube with stdin" {
TESTDIR=$PODMAN_TMPDIR/testdir
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
- run_podman play kube - < $PODMAN_TMPDIR/test.yaml
+ run_podman kube play - < $PODMAN_TMPDIR/test.yaml
if [ -e /usr/sbin/selinuxenabled -a /usr/sbin/selinuxenabled ]; then
run ls -Zd $TESTDIR
is "$output" "${RELABEL} $TESTDIR" "selinux relabel should have happened"
@@ -86,6 +86,20 @@ RELABEL="system_u:object_r:container_file_t:s0"
run_podman pod rm -t 0 -f test_pod
}
+@test "podman kube" {
+ TESTDIR=$PODMAN_TMPDIR/testdir
+ mkdir -p $TESTDIR
+ echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
+ run_podman kube play $PODMAN_TMPDIR/test.yaml
+ if [ -e /usr/sbin/selinuxenabled -a /usr/sbin/selinuxenabled ]; then
+ run ls -Zd $TESTDIR
+ is "$output" "${RELABEL} $TESTDIR" "selinux relabel should have happened"
+ fi
+
+ run_podman stop -a -t 0
+ run_podman pod rm -t 0 -f test_pod
+}
+
@test "podman play" {
TESTDIR=$PODMAN_TMPDIR/testdir
mkdir -p $TESTDIR
@@ -159,13 +173,13 @@ EOF
run_podman 1 container exists $service_container
}
-@test "podman play --network" {
+@test "podman kube --network" {
TESTDIR=$PODMAN_TMPDIR/testdir
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
- run_podman 125 play kube --network host $PODMAN_TMPDIR/test.yaml
+ run_podman 125 kube play --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 kube play --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
@@ -174,7 +188,7 @@ EOF
run_podman stop -a -t 0
run_podman pod rm -t 0 -f test_pod
- run_podman play kube --network none $PODMAN_TMPDIR/test.yaml
+ run_podman kube play --network none $PODMAN_TMPDIR/test.yaml
run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}"
infraID="$output"
run_podman container inspect --format "{{.HostConfig.NetworkMode}}" $infraID
@@ -280,12 +294,12 @@ _EOF
run_podman rmi -f userimage:latest
}
-@test "podman play --annotation" {
+@test "podman kube --annotation" {
TESTDIR=$PODMAN_TMPDIR/testdir
RANDOMSTRING=$(random_string 15)
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
- run_podman play kube --annotation "name=$RANDOMSTRING" $PODMAN_TMPDIR/test.yaml
+ run_podman kube play --annotation "name=$RANDOMSTRING" $PODMAN_TMPDIR/test.yaml
run_podman inspect --format "{{ .Config.Annotations }}" test_pod-test
is "$output" ".*name:$RANDOMSTRING" "Annotation should be added to pod"
@@ -338,7 +352,7 @@ status: {}
assert "$output" =~ "invalid annotation \"test\"=\"$RANDOMSTRING\"" "Expected to fail with annotation length greater than 63"
}
-@test "podman play kube - default log driver" {
+@test "podman kube play - default log driver" {
TESTDIR=$PODMAN_TMPDIR/testdir
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
@@ -347,7 +361,7 @@ status: {}
default_driver=$output
# Make sure that the default log driver is used
- run_podman play kube $PODMAN_TMPDIR/test.yaml
+ run_podman kube play $PODMAN_TMPDIR/test.yaml
run_podman inspect --format "{{.HostConfig.LogConfig.Type}}" test_pod-test
is "$output" "$default_driver" "play kube uses default log driver"