diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-27 09:46:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 09:46:00 +0100 |
commit | dbbd5987fde0547305bc42a27d355d2de9e08dd3 (patch) | |
tree | 5f4ebcb04c0d5f1ac83141043bf7e5bd94dfffd9 /test/system/030-run.bats | |
parent | d93d9f60a49b2861d305722c87539aa6b2aac648 (diff) | |
parent | c93d4be41e6e79ff6b4bd69e1564d057d1de0469 (diff) | |
download | podman-dbbd5987fde0547305bc42a27d355d2de9e08dd3.tar.gz podman-dbbd5987fde0547305bc42a27d355d2de9e08dd3.tar.bz2 podman-dbbd5987fde0547305bc42a27d355d2de9e08dd3.zip |
Merge pull request #8149 from edsantiago/bats
System tests: cleanup, make more robust
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r-- | test/system/030-run.bats | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 48f25f8d3..6b6964c63 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -473,34 +473,53 @@ json-file | f # run with --runtime should preserve the named runtime @test "podman run : full path to --runtime is preserved" { - skip_if_cgroupsv1 - skip_if_remote - run_podman run -d --runtime '/usr/bin/crun' $IMAGE sleep 60 + skip_if_remote "podman-remote does not support --runtime option" + + # Get configured runtime + run_podman info --format '{{.Host.OCIRuntime.Path}}' + runtime="$output" + + # Assumes that /var/tmp is not mounted noexec; this is usually safe + new_runtime="/var/tmp/myruntime$(random_string 12)" + cp --preserve $runtime $new_runtime + + run_podman run -d --runtime "$new_runtime" $IMAGE sleep 60 cid="$output" run_podman inspect --format '{{.OCIRuntime}}' $cid - is "$output" "/usr/bin/crun" - + is "$output" "$new_runtime" "podman inspect shows configured runtime" run_podman kill $cid + run_podman rm $cid + rm -f $new_runtime } # Regression test for issue #8082 @test "podman run : look up correct image name" { - # Create a 2nd tag for the local image. - local name="localhost/foo/bar" - run_podman tag $IMAGE $name + # Create a 2nd tag for the local image. Force to lower case, and apply it. + local newtag="localhost/$(random_string 10)/$(random_string 8)" + newtag=${newtag,,} + run_podman tag $IMAGE $newtag + + # Create a container with the 2nd tag and make sure that it's being + # used. #8082 always inaccurately used the 1st tag. + run_podman create $newtag + cid="$output" - # Create a container with the 2nd tag and make sure that it's being - # used. #8082 always inaccurately used the 1st tag. - run_podman create $name - cid="$output" + run_podman inspect --format "{{.ImageName}}" $cid + is "$output" "$newtag" "container .ImageName is the container-create name" - run_podman inspect --format "{{.ImageName}}" $cid - is "$output" "$name" + # Same thing, but now with a :tag, and making sure it works with --name + newtag2="${newtag}:$(random_string 6|tr A-Z a-z)" + run_podman tag $IMAGE $newtag2 - # Clean up. - run_podman rm $cid - run_podman untag $IMAGE $name + cname="$(random_string 14|tr A-Z a-z)" + run_podman create --name $cname $newtag2 + run_podman inspect --format "{{.ImageName}}" $cname + is "$output" "$newtag2" "container .ImageName is the container-create name" + + # Clean up. + run_podman rm $cid $cname + run_podman untag $IMAGE $newtag $newtag2 } # vim: filetype=sh |