diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-22 15:44:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 15:44:40 -0500 |
commit | e64669cb96cbb5802ee0d5a0f1aea9638b4d9dd8 (patch) | |
tree | b365e0625c77e89c069c96853d24c0e74cdd4192 /test/system | |
parent | 613addd56f6dfccc1382de6306f92a9d16fed4d3 (diff) | |
parent | f3a8e3324f206339386b541927445926dd137ad2 (diff) | |
download | podman-e64669cb96cbb5802ee0d5a0f1aea9638b4d9dd8.tar.gz podman-e64669cb96cbb5802ee0d5a0f1aea9638b4d9dd8.tar.bz2 podman-e64669cb96cbb5802ee0d5a0f1aea9638b4d9dd8.zip |
Merge pull request #9469 from vrothberg/cp-stdout
podman cp: /dev/std{in,out} fixes
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/065-cp.bats | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats index 0fcc437d4..312106b36 100644 --- a/test/system/065-cp.bats +++ b/test/system/065-cp.bats @@ -475,9 +475,9 @@ load helpers run_podman exec cpcontainer rm -rf /tmp/$srcdir # Now for "/dev/stdin". + # Note: while this works, the content ends up in Nirvana. + # Same for Docker. run_podman cp /dev/stdin cpcontainer:/tmp < $tar_file - run_podman exec cpcontainer cat /tmp/$srcdir/$rand_filename - is "$output" "$rand_content" # Error checks below ... @@ -487,11 +487,11 @@ load helpers # Destination must be a directory (on an existing file). run_podman exec cpcontainer touch /tmp/file.txt - run_podman 125 cp /dev/stdin cpcontainer:/tmp/file.txt < $tar_file + run_podman 125 cp - cpcontainer:/tmp/file.txt < $tar_file is "$output" 'Error: destination must be a directory when copying from stdin' # Destination must be a directory (on an absent path). - run_podman 125 cp /dev/stdin cpcontainer:/tmp/IdoNotExist < $tar_file + run_podman 125 cp - cpcontainer:/tmp/IdoNotExist < $tar_file is "$output" 'Error: destination must be a directory when copying from stdin' run_podman rm -f cpcontainer @@ -508,6 +508,10 @@ load helpers run_podman exec cpcontainer sh -c "echo '$rand_content' > /tmp/file.txt" run_podman exec cpcontainer touch /tmp/empty.txt + # Make sure that only "-" gets special treatment. "/dev/stdout" + run_podman 125 cp cpcontainer:/tmp/file.txt /dev/stdout + is "$output" 'Error: invalid destination: "/dev/stdout" must be a directory or a regular file' + # Copying from stdout will always compress. So let's copy the previously # created file from the container via stdout, untar the archive and make # sure the file exists with the expected content. |