Implement kpod inspect

kpod inspect allows the user to view low-level information about
containers and images

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
Ryan Cole 2017-06-29 15:16:06 -04:00
parent 3b295967f1
commit 0d4305a261
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
}