mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
fix tests for "podman kube play"
This is a follow up to fix some of the apiv2 tests related to "podman kube play" while also removing reduntant system tests. Signed-off-by: Niall Crowe <nicrowe@redhat.com>
This commit is contained in:
@ -37,13 +37,29 @@ t DELETE libpod/containers/$cid 200 .[0].Id=$cid
|
||||
|
||||
# Make sure that kube-play works
|
||||
|
||||
t POST libpod/kube/play $YAML 200
|
||||
t DELETE libpod/kube/play $YAML 200
|
||||
t POST libpod/kube/play $YAML 200 \
|
||||
.Pods[0].ID~[0-9a-f]\\{64\\} \
|
||||
.Pods[0].ContainerErrors=null \
|
||||
.Pods[0].Containers[0]~[0-9a-f]\\{64\\}
|
||||
|
||||
t DELETE libpod/kube/play $YAML 200 \
|
||||
.Pods[0].ID~null \
|
||||
.Pods[0].ContainerErrors=null \
|
||||
.Pods[0].Containers[0]~null
|
||||
|
||||
# Make sure that play-kube works
|
||||
|
||||
t POST libpod/play/kube $YAML 200
|
||||
t DELETE libpod/play/kube $YAML 200
|
||||
t POST libpod/play/kube $YAML 200 \
|
||||
.Pods[0].ID~[0-9a-f]\\{64\\} \
|
||||
.Pods[0].ContainerErrors=null \
|
||||
.Pods[0].Containers[0]~[0-9a-f]\\{64\\}
|
||||
|
||||
t DELETE libpod/play/kube $YAML 200 \
|
||||
.Pods[0].ID~null \
|
||||
.Pods[0].ContainerErrors=null \
|
||||
.Pods[0].Containers[0]~null \
|
||||
.StopReport[0].Id~[0-9a-f]\\{64\\} \
|
||||
.RmReport[0].Id~[0-9a-f]\\{64\\}
|
||||
|
||||
rm -rf $TMPD
|
||||
|
||||
|
@ -86,21 +86,9 @@ 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" {
|
||||
# Testing that the "podman play" cmd still works now that
|
||||
# "podman kube" is an option.
|
||||
TESTDIR=$PODMAN_TMPDIR/testdir
|
||||
mkdir -p $TESTDIR
|
||||
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
|
||||
|
Reference in New Issue
Block a user