diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-24 05:53:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 05:53:16 -0400 |
commit | c44c298ae7b5ce1da2aeff5b920de65767966007 (patch) | |
tree | 3c949238461e4d6bfc63a2dc49fb9628b44e9ace /test | |
parent | 2f79497aba90229664c35fb738704d61e4528f44 (diff) | |
parent | dcb5c92c0d94c81f0706cd282b55a2a9d1fde30f (diff) | |
download | podman-c44c298ae7b5ce1da2aeff5b920de65767966007.tar.gz podman-c44c298ae7b5ce1da2aeff5b920de65767966007.tar.bz2 podman-c44c298ae7b5ce1da2aeff5b920de65767966007.zip |
Merge pull request #11018 from vrothberg/fix-10994
import: write stdin to tmp file
Diffstat (limited to 'test')
-rw-r--r-- | test/system/125-import.bats | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/system/125-import.bats b/test/system/125-import.bats new file mode 100644 index 000000000..c53711618 --- /dev/null +++ b/test/system/125-import.bats @@ -0,0 +1,45 @@ +#!/usr/bin/env bats -*- bats -*- +# +# tests for podman import +# + +load helpers + +@test "podman import" { + local archive=$PODMAN_TMPDIR/archive.tar + local random_content=$(random_string 12) + # Generate a random name and tag (must be lower-case) + local random_name=x0$(random_string 12 | tr A-Z a-z) + local random_tag=t0$(random_string 7 | tr A-Z a-z) + local fqin=localhost/$random_name:$random_tag + + run_podman run --name import $IMAGE sh -c "echo ${random_content} > /random.txt" + run_podman export import -o $archive + run_podman rm -f import + + # Simple import + run_podman import -q $archive + iid="$output" + run_podman run -t --rm $iid cat /random.txt + is "$output" "$random_content" "simple import" + run_podman rmi -f $iid + + # Simple import via stdin + run_podman import -q - < <(cat $archive) + iid="$output" + run_podman run -t --rm $iid cat /random.txt + is "$output" "$random_content" "simple import via stdin" + run_podman rmi -f $iid + + # Tagged import + run_podman import -q $archive $fqin + run_podman run -t --rm $fqin cat /random.txt + is "$output" "$random_content" "tagged import" + run_podman rmi -f $fqin + + # Tagged import via stdin + run_podman import -q - $fqin < <(cat $archive) + run_podman run -t --rm $fqin cat /random.txt + is "$output" "$random_content" "tagged import via stdin" + run_podman rmi -f $fqin +} |