aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-24 12:19:42 -0400
committerGitHub <noreply@github.com>2020-06-24 12:19:42 -0400
commit988fd27541dfa852ee9543c2d8a916896ef0c774 (patch)
tree592f484305f10be66d076952b6f81bc637309c11 /test/system
parent6bc5dcc2829c2bc08923df0b50f71582d5558fe8 (diff)
parent1c6c12581ce0f2257a862e3a6a8dbaa7d0f32686 (diff)
downloadpodman-988fd27541dfa852ee9543c2d8a916896ef0c774.tar.gz
podman-988fd27541dfa852ee9543c2d8a916896ef0c774.tar.bz2
podman-988fd27541dfa852ee9543c2d8a916896ef0c774.zip
Merge pull request #6746 from vrothberg/untag
podman untag: error if tag doesn't exist
Diffstat (limited to 'test/system')
-rw-r--r--test/system/020-tag.bats35
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