From 7951a7f13a04f4f6b19e3c5fcc1ba293e905348a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 1 Oct 2020 15:25:40 +0200 Subject: system test: untag all test Extend the system tests to test `podman untag $image` without further arguments to force removing all tags from the image. Signed-off-by: Valentin Rothberg --- test/system/020-tag.bats | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/system/020-tag.bats b/test/system/020-tag.bats index 7593ad68f..1f5eede39 100644 --- a/test/system/020-tag.bats +++ b/test/system/020-tag.bats @@ -32,4 +32,23 @@ function _tag_and_check() { is "$output" "Error: \"registry.com/foo:bar\": no such tag" } +@test "podman untag all" { + # First get the image ID + run_podman inspect --format '{{.ID}}' $IMAGE + iid=$output + + # Add a couple of tags + run_podman tag $IMAGE registry.com/1:latest registry.com/2:latest registry.com/3:latest + + # Untag with arguments to for all tags to be removed + run_podman untag $iid + + # Now make sure all tags are removed + run_podman image inspect $iid --format "{{.RepoTags}}" + is "$output" "\[\]" "untag by ID leaves empty set of tags" + + # Restore image + run_podman tag $iid $IMAGE +} + # vim: filetype=sh -- cgit v1.2.3-54-g00ecf