Skip to content

Commit

Permalink
Merge pull request containers#8511 from Edward5hen/kube-test
Browse files Browse the repository at this point in the history
Add APIv2 tests for kube generate
  • Loading branch information
openshift-merge-robot authored Nov 30, 2020
2 parents 8b2c0a4 + 70fa488 commit fc85ec9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/apiv2/25-containersMore.at
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fc85ec9

Please sign in to comment.