diff options
Diffstat (limited to 'test/system/065-cp.bats')
-rw-r--r-- | test/system/065-cp.bats | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats index 204065bdb..38660a13c 100644 --- a/test/system/065-cp.bats +++ b/test/system/065-cp.bats @@ -27,13 +27,8 @@ load helpers "echo $rand_content1 >/tmp/$rand_filename1; echo $rand_content2 >/tmp/$rand_filename2" - run_podman cp 'cpcontainer:/tmp/*' $dstdir - - test -e $dstdir/$rand_filename1 || die "file 1 not copied from container" - test -e $dstdir/$rand_filename2 || die "file 2 not copied from container" - - is "$(<$dstdir/$rand_filename1)" "$rand_content1" "content of file 1" - is "$(<$dstdir/$rand_filename2)" "$rand_content2" "content of file 2" + # cp no longer supports wildcarding + run_podman 125 cp 'cpcontainer:/tmp/*' $dstdir run_podman rm cpcontainer } @@ -149,14 +144,15 @@ load helpers trap 'exit 0' 15;while :;do sleep 0.5;done" # Copy file from host into container, into a file named 'x' - # Note that the second has a trailing slash; this will trigger mkdir - run_podman cp $srcdir/$rand_filename1 cpcontainer:/tmp/d1/x + # Note that the second has a trailing slash, implying a directory. + # Since that destination directory doesn't exist, the cp will fail + run_podman cp --pause=false $srcdir/$rand_filename1 cpcontainer:/tmp/d1/x is "$output" "" "output from podman cp 1" - run_podman cp $srcdir/$rand_filename2 cpcontainer:/tmp/d2/x/ - is "$output" "" "output from podman cp 3" + run_podman 125 cp --pause=false $srcdir/$rand_filename2 cpcontainer:/tmp/d2/x/ + is "$output" "Error: failed to get stat of dest path .*stat.* no such file or directory" "cp will not create nonexistent destination directory" - run_podman cp $srcdir/$rand_filename3 cpcontainer:/tmp/d3/x + run_podman cp --pause=false $srcdir/$rand_filename3 cpcontainer:/tmp/d3/x is "$output" "" "output from podman cp 3" # Read back. @@ -166,10 +162,8 @@ load helpers run_podman exec cpcontainer cat /tmp/nonesuch1 is "$output" "$rand_content1" "cp creates destination file" - # In the second case, podman creates a directory nonesuch2, then - # creates a file with the same name as the input file. THIS IS WEIRD! - run_podman exec cpcontainer cat /tmp/nonesuch2/$rand_filename2 - is "$output" "$rand_content2" "cp creates destination dir and file" + # cp into nonexistent directory should not mkdir nonesuch2 directory + run_podman 1 exec cpcontainer test -e /tmp/nonesuch2 # In the third case, podman (correctly imo) creates a file named 'x' run_podman exec cpcontainer cat /tmp/d3/x @@ -205,7 +199,7 @@ load helpers "mkdir -p $graphroot; trap 'exit 0' 15;while :;do sleep 0.5;done" # Copy from host into container. - run_podman cp $srcdir/$rand_filename cpcontainer:$graphroot/$rand_filename + run_podman cp --pause=false $srcdir/$rand_filename cpcontainer:$graphroot/$rand_filename # ls, and confirm it's there. run_podman exec cpcontainer ls -l $graphroot/$rand_filename |