5
# helper function for "podman tag/untag" test
6
function _tag_and_check() {
10
run_podman tag $IMAGE $tag_as
11
run_podman image exists $check_as
12
run_podman untag $IMAGE $check_as
13
run_podman 1 image exists $check_as
16
@test "podman tag/untag" {
17
# Test a fully-qualified image reference.
18
_tag_and_check registry.com/image:latest registry.com/image:latest
20
# Test a reference without tag and make sure ":latest" is appended.
21
_tag_and_check registry.com/image registry.com/image:latest
23
# Test a tagged short image and make sure "localhost/" is prepended.
24
_tag_and_check image:latest localhost/image:latest
26
# Test a short image without tag and make sure "localhost/" is
27
# prepended and ":latest" is appended.
28
_tag_and_check image localhost/image:latest
31
run_podman 125 untag $IMAGE registry.com/foo:bar
32
is "$output" "Error: registry.com/foo:bar: tag not known"
35
@test "podman untag all" {
36
# First get the image ID
37
run_podman inspect --format '{{.ID}}' $IMAGE
40
# Add a couple of tags
41
run_podman tag $IMAGE registry.com/1:latest registry.com/2:latest registry.com/3:latest
43
# Untag with arguments to for all tags to be removed
46
# Now make sure all tags are removed
47
run_podman image inspect $iid --format "{{.RepoTags}}"
48
is "$output" "\[\]" "untag by ID leaves empty set of tags"
51
run_podman tag $iid $IMAGE