20 Commits

Author SHA1 Message Date
60d0be17fc Refactor tests when checking for error exit codes
Rather than checking for non-zero, we need to check for >0 to
distinguish between timeouts and error exit codes.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-10-16 08:10:07 -07:00
0144c3796b fix cp none exists dest path ends with '/'
close #3894
This patch let podman cp return 'no such file or directory' error if DEST_PATH does not exist and ends with / when copying file.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-09-25 12:48:05 -04:00
a6836eae52 Do not support wildcards on cp
* symlink processing and wildcarding led to unexpected files
  being copied

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-12 16:56:38 -07:00
a2561ec58a fix copy change file owner if cp from container
If copies file from container to local machine, change the file owner to the cp command caller.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-08 17:14:47 -04:00
c962d214e6 fix bug creats directory copying file
close #3384

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-06-20 17:52:12 -04:00
c1b4060bdd podman copy files to the volume with a container
enabls podman to cpoy files between the host machine and the volume related with a container.
Close #3059

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-06-03 17:36:34 -04:00
25aac813bd Fix podman cp test by reordering operations
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-31 12:58:44 -04:00
b5b461ac28 Merge pull request #3147 from baude/testimagecache
use imagecaches for local tests
2019-05-30 21:56:26 +02:00
5a07311d9e Fix podman cp tests
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-30 10:53:52 -04:00
f456825fe8 Fix bug in e2e tests for podman cp
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-29 22:53:51 -04:00
431e633b48 Add test to ensure symlinks are resolved in ctr scope
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-29 22:53:51 -04:00
f610a485c1 use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image
stores as read-only image caches.  this cuts down on test time
significantly because each test does not need to restore the images from
a tarball anymore.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-29 15:12:05 -05:00
7b6dac300d Merge pull request #3194 from QiWang19/cptar
fix bug dest path of copying tar
2019-05-28 16:44:58 +02:00
bb7b0aad0e fix bug dest path of copying tar
when podman cp tar without --extract flag, if the destination already exists, or ends with path seprator, cp the tar under the directory, otherwise copy the tar named with the destination

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-05-24 11:51:30 -04:00
0b571ede78 Fix a potential flake in the tests for podman cp
Instead of using the working directory, use a subdirectory of the
temporary directory created for the individual test, to prevent a
potential EEXIST for shared working directory.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-23 16:30:11 -04:00
5b3f3c4110 Kill os.Exit() in tests, replace with asserts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-15 16:33:08 -04:00
4479b8eec3 implement cp reads tar file from stdin/stdout
enables podman cp uses - to stream a tar archive from STDIN or to STDOUT.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-05-09 10:12:39 -04:00
84620021b0 fix bug podman cp directory
`podman cp` used to copy the contents under the source directory to the destination. But according to the specification in podman-cp.md. it should copy the whole directory to the destination if the destination directory already exists.
- src dir ends with /., copy the contents to dest dir
- src dir does not end with /.
 - dest dir /home does not exist, copy the contents
 - dest dir /home exists, copy the directory

```
$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
$

$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
empty

```

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-04-04 12:45:12 -04:00
d5546008ab ginkgo status improvements
a series of improvements to our ginkgo test framework so we can
get better ideas of whats going on when run in CI

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 13:28:33 -06:00
36d962990a 'podman cp' copy between host and container
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-02-14 09:29:53 -05:00