2017-09-05 19:36:49 +00:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load helpers
|
|
|
|
|
2017-09-21 19:21:56 +00:00
|
|
|
IMAGE="alpine:latest"
|
2017-09-05 19:36:49 +00:00
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
cleanup_test
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "kpod tag with shortname:latest" {
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:latest
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-09-21 19:21:56 +00:00
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest
|
2017-09-05 19:36:49 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "kpod tag with shortname" {
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar
|
2017-09-21 19:21:56 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-09-05 19:36:49 +00:00
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-09-21 19:21:56 +00:00
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest
|
2017-09-05 19:36:49 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "kpod tag with shortname:tag" {
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:v
|
2017-09-21 19:21:56 +00:00
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-09-05 19:36:49 +00:00
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:v
|
|
|
|
echo "$output"
|
|
|
|
[ "$status" -eq 0 ]
|
2017-09-21 19:21:56 +00:00
|
|
|
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:v
|
2017-09-05 19:36:49 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|