Merge pull request #648 from 14rcole/kpod-inspect

Implement `kpod inspect`
This commit is contained in:
Mrunal Patel 2017-07-21 07:12:08 -07:00 committed by GitHub
commit 0e17bf4659
17 changed files with 1180 additions and 318 deletions

View file

@ -190,3 +190,39 @@ function teardown() {
run crioctl image remove "$IMAGE"
stop_crio
}
@test "kpod inspect image" {
run ${KPOD_BINARY} $KPOD_OPTIONS pull redis:alpine
[ "$status" -eq 0 ]
run bash -c "${KPOD_BINARY} $KPOD_OPTIONS inspect redis:alpine | python -m json.tool"
echo "$output"
[ "$status" -eq 0 ]
}
run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine
@test "kpod inspect non-existent container" {
run ${KPOD_BINARY} $KPOD_OPTIONS inspect 14rcole/non-existent
echo "$output"
[ "$status" -ne 0 ]
}
@test "kpod inspect with format" {
run ${KPOD_BINARY} $KPOD_OPTIONS pull redis:alpine
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS --format {{.ID}} inspect redis:alpine
[ "$status" -eq 0]
inspectOutput="$output"
run ${KPOD_BINARY} $KPOD_OPTIONS images --quiet redis:alpine
[ "$status" -eq 0]
[ "$output" -eq "$inspectOutput" ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine
}
@test "kpod inspect specified type" {
run ${KPOD_BINARY} $KPOD_OPTIONS pull redis:alpine
[ "$status" -eq 0 ]
run bash -c "${KPOD_BINARY} $KPOD_OPTIONS inspect --type image redis:alpine | python -m json.tool"
echo "$output"
[ "$status" -eq 0]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine
}