summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-30 15:13:22 +0100
committerGitHub <noreply@github.com>2020-11-30 15:13:22 +0100
commitfc85ec942ee3273f5ad56381a0f6b9e78aea59bf (patch)
tree798db6914b693d9f49f747c6ad37ad14b739018c /test
parent8b2c0a4fa3f85ec27f1460fa9fe4b3b1313b901a (diff)
parent70fa48837285c8cadc7d5915935259c4cdf5fe1c (diff)
downloadpodman-fc85ec942ee3273f5ad56381a0f6b9e78aea59bf.tar.gz
podman-fc85ec942ee3273f5ad56381a0f6b9e78aea59bf.tar.bz2
podman-fc85ec942ee3273f5ad56381a0f6b9e78aea59bf.zip
Merge pull request #8511 from Edward5hen/kube-test
Add APIv2 tests for kube generate
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/25-containersMore.at27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/apiv2/25-containersMore.at b/test/apiv2/25-containersMore.at
index e0e6f7222..4f6b80a5f 100644
--- a/test/apiv2/25-containersMore.at
+++ b/test/apiv2/25-containersMore.at
@@ -52,4 +52,31 @@ t POST libpod/containers/foo/unmount '' 204
t DELETE libpod/containers/foo?force=true 204
+podman run $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].State~\\\(exited\\\|stopped\\\) \
+ .[0].ExitCode=0 \
+ .[0].IsInfra=false
+
+cid=$(jq -r '.[0].Id' <<<"$output")
+
+t GET libpod/generate/$cid/kube 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/$cid/kube?service=true 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"
+
+t DELETE libpod/containers/$cid 204
# vim: filetype=sh