diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-13 19:29:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 19:29:16 +0000 |
commit | 5c3eec55895c9ca4c36571e1e919f0cb8632bedb (patch) | |
tree | 711c52400d7bfa70c053cfde9a63d013d3e08bcd /test/apiv2/80-kube.at | |
parent | 5f8d08d593d625beaa224c48e7da945c4f90ea48 (diff) | |
parent | e08a77ce64eec5cd0192ae1970fa859c00440174 (diff) | |
download | podman-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/apiv2/80-kube.at')
-rw-r--r-- | test/apiv2/80-kube.at | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/apiv2/80-kube.at b/test/apiv2/80-kube.at new file mode 100644 index 000000000..40b26d75e --- /dev/null +++ b/test/apiv2/80-kube.at @@ -0,0 +1,50 @@ +# -*- sh -*- +# +# test more container-related endpoints +# + +podman create $IMAGE true + +t GET libpod/containers/json?last=1 200 \ + length=1 \ + .[0].Id~[0-9a-f]\\{64\\} \ + .[0].Image=$IMAGE \ + .[0].Command[0]="true" \ + .[0].IsInfra=false + +cid=$(jq -r '.[0].Id' <<<"$output") + +# Make sure that generate-kube works + +t GET libpod/generate/kube?names=$cid 200 +like "$output" ".*apiVersion:.*" "Check generated kube yaml - apiVersion" +like "$output" ".*kind:\\sPod.*" "Check generated kube yaml - kind: Pod" +like "$output" ".*metadata:.*" "Check generated kube yaml - metadata" +like "$output" ".*spec:.*" "Check generated kube yaml - spec" + +t GET "libpod/generate/kube?service=true&names=$cid" 200 +like "$output" ".*apiVersion:.*" "Check generated kube yaml(service=true) - apiVersion" +like "$output" ".*kind:\\sPod.*" "Check generated kube yaml(service=true) - kind: Pod" +like "$output" ".*metadata:.*" "Check generated kube yaml(service=true) - metadata" +like "$output" ".*spec:.*" "Check generated kube yaml(service=true) - spec" +like "$output" ".*kind:\\sService.*" "Check generated kube yaml(service=true) - kind: Service" + +TMPD=$(mktemp -d podman-apiv2-test-kube.XXXXXX) +YAML="${TMPD}/kube.yaml" +echo "$output" > $YAML + +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 + +# Make sure that play-kube works + +t POST libpod/play/kube $YAML 200 +t DELETE libpod/play/kube $YAML 200 + +rm -rf $TMPD + +# vim: filetype=sh |