diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-06-24 14:44:42 +0200 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2020-06-24 14:46:50 -0400 |
commit | 6594d5d6558437d4cdb11a72eda175ead407ec75 (patch) | |
tree | c57e5e1b46eeb23605d4991b9baeb382e68fb832 /test/system | |
parent | 639b809c80dc2fce76c4d24459d06c469777868f (diff) | |
download | podman-6594d5d6558437d4cdb11a72eda175ead407ec75.tar.gz podman-6594d5d6558437d4cdb11a72eda175ead407ec75.tar.bz2 podman-6594d5d6558437d4cdb11a72eda175ead407ec75.zip |
podman untag: error if tag doesn't exist
Throw an error if a specified tag does not exist. Also make sure that
the user input is normalized as we already do for `podman tag`.
To prevent regressions, add a set of end-to-end and systemd tests.
Last but not least, update the docs and add bash completions.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/020-tag.bats | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/system/020-tag.bats b/test/system/020-tag.bats new file mode 100644 index 000000000..7593ad68f --- /dev/null +++ b/test/system/020-tag.bats @@ -0,0 +1,35 @@ +#!/usr/bin/env bats + +load helpers + +# helper function for "podman tag/untag" test +function _tag_and_check() { + local tag_as="$1" + local check_as="$2" + + run_podman tag $IMAGE $tag_as + run_podman image exists $check_as + run_podman untag $IMAGE $check_as + run_podman 1 image exists $check_as +} + +@test "podman tag/untag" { + # Test a fully-qualified image reference. + _tag_and_check registry.com/image:latest registry.com/image:latest + + # Test a reference without tag and make sure ":latest" is appended. + _tag_and_check registry.com/image registry.com/image:latest + + # Test a tagged short image and make sure "localhost/" is prepended. + _tag_and_check image:latest localhost/image:latest + + # Test a short image without tag and make sure "localhost/" is + # prepended and ":latest" is appended. + _tag_and_check image localhost/image:latest + + # Test error case. + run_podman 125 untag $IMAGE registry.com/foo:bar + is "$output" "Error: \"registry.com/foo:bar\": no such tag" +} + +# vim: filetype=sh |