summaryrefslogtreecommitdiff
path: root/test/system/065-cp.bats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-24 09:52:11 -0400
committerGitHub <noreply@github.com>2021-06-24 09:52:11 -0400
commitf29f6aafa10aaa28477014e8ee1b42fbe43c416d (patch)
treeb722db1891c051f7260192677effb9fbc7fc9f7c /test/system/065-cp.bats
parentda33fc45b6628c1ac1a16e49790be2b4fbf502a5 (diff)
parentb1082696ebb3970ca0a67790fa9bb9955eff5fc2 (diff)
downloadpodman-f29f6aafa10aaa28477014e8ee1b42fbe43c416d.tar.gz
podman-f29f6aafa10aaa28477014e8ee1b42fbe43c416d.tar.bz2
podman-f29f6aafa10aaa28477014e8ee1b42fbe43c416d.zip
Merge pull request #10772 from vrothberg/fix-cp
cp: do not allow dir->file copying
Diffstat (limited to 'test/system/065-cp.bats')
-rw-r--r--test/system/065-cp.bats9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats
index 24ac8118e..eda04611f 100644
--- a/test/system/065-cp.bats
+++ b/test/system/065-cp.bats
@@ -272,6 +272,11 @@ load helpers
run_podman rm -f cpcontainer
done < <(parse_table "$tests")
+ run_podman create --name cpcontainer --workdir=/srv $cpimage sleep infinity
+ run_podman 125 cp $srcdir cpcontainer:/etc/os-release
+ is "$output" "Error: destination must be a directory when copying a directory" "cannot copy directory to file"
+ run_podman rm -f cpcontainer
+
run_podman rmi -f $cpimage
}
@@ -343,6 +348,10 @@ load helpers
is "$(< $destdir$dest_fullname/containerfile1)" "${randomcontent[1]}" "$description"
rm -rf $destdir/*
done < <(parse_table "$tests")
+
+ touch $destdir/testfile
+ run_podman 125 cp cpcontainer:/etc/ $destdir/testfile
+ is "$output" "Error: destination must be a directory when copying a directory" "cannot copy directory to file"
run_podman rm -f cpcontainer
run_podman rmi -f $cpimage