summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-24 16:25:41 -0400
committerGitHub <noreply@github.com>2020-06-24 16:25:41 -0400
commit0b9143df881f5de0f36f31bc2598e864fdeae7ed (patch)
tree76ed319444ac750d898d06b986adf8341ed605ef /test/system
parent4af2081424c8fa7ac191e9c5231d2429edb8327c (diff)
parent915f8698f4f84fb79cf0438a5b6e4a283e75a7bf (diff)
downloadpodman-0b9143df881f5de0f36f31bc2598e864fdeae7ed.tar.gz
podman-0b9143df881f5de0f36f31bc2598e864fdeae7ed.tar.bz2
podman-0b9143df881f5de0f36f31bc2598e864fdeae7ed.zip
Merge pull request #6758 from mheon/v2.0.1_backports
V2.0.1 backports
Diffstat (limited to 'test/system')
-rw-r--r--test/system/020-tag.bats35
-rw-r--r--test/system/120-load.bats18
2 files changed, 52 insertions, 1 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
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 15df6adec..f290c1888 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -44,6 +44,11 @@ verify_iid_and_name() {
run_podman load < $archive
verify_iid_and_name "<none>:<none>"
+ # Same as above, using stdin but with `podman image load`
+ run_podman rmi $iid
+ run_podman image load < $archive
+ verify_iid_and_name "<none>:<none>"
+
# Cleanup: since load-by-iid doesn't preserve name, re-tag it;
# otherwise our global teardown will rmi and re-pull our standard image.
run_podman tag $iid $img_name
@@ -57,9 +62,14 @@ verify_iid_and_name() {
# Load using -i; this time the image should be tagged.
run_podman load -i $archive
verify_iid_and_name $img_name
+ run_podman rmi $iid
- # Same as above, using stdin
+ # Also make sure that `image load` behaves the same.
+ run_podman image load -i $archive
+ verify_iid_and_name $img_name
run_podman rmi $iid
+
+ # Same as above, using stdin
run_podman load < $archive
verify_iid_and_name $img_name
}
@@ -97,4 +107,10 @@ verify_iid_and_name() {
"Diagnostic from 'podman load' without redirection or -i"
}
+@test "podman load - at most 1 arg(s)" {
+ run_podman 125 load 1 2 3
+ is "$output" \
+ "Error: accepts at most 1 arg(s), received 3"
+}
+
# vim: filetype=sh