@@ -22,7 +22,8 @@ load helpers
22
22
mkdir -p $srcdir /subdir
23
23
echo " ${randomcontent[2]} " > $srcdir /subdir/dotfile.
24
24
25
- run_podman run -d --name destrunning --workdir=/srv $IMAGE sh -c " mkdir /srv/subdir; sleep infinity"
25
+ run_podman run -d --name destrunning --workdir=/srv $IMAGE sh -c " mkdir /srv/subdir; echo READY; sleep infinity"
26
+ wait_for_ready destrunning
26
27
27
28
# Commit the image for testing non-running containers
28
29
run_podman commit -q destrunning
@@ -177,7 +178,9 @@ load helpers
177
178
echo ${randomcontent[0]} > /tmp/dotfile.;
178
179
echo ${randomcontent[1]} > /srv/containerfile1;
179
180
echo ${randomcontent[2]} > /srv/subdir/containerfile2;
181
+ echo READY;
180
182
sleep infinity"
183
+ wait_for_ready srcrunning
181
184
182
185
# Commit the image for testing non-running containers
183
186
run_podman commit -q srcrunning
@@ -238,7 +241,9 @@ load helpers
238
241
echo ${randomcontent[0]} > /tmp/dotfile.;
239
242
echo ${randomcontent[1]} > /srv/containerfile1;
240
243
echo ${randomcontent[2]} > /srv/subdir/containerfile2;
244
+ echo READY;
241
245
sleep infinity"
246
+ wait_for_ready srcrunning
242
247
243
248
# Commit the image for testing non-running containers
244
249
run_podman commit -q srcrunning
@@ -329,7 +334,8 @@ load helpers
329
334
mkdir -p $srcdir /dir.
330
335
cp -r $srcdir /dir/* $srcdir /dir.
331
336
332
- run_podman run -d --name destrunning --workdir=/srv $IMAGE sh -c " mkdir /srv/subdir; sleep infinity"
337
+ run_podman run -d --name destrunning --workdir=/srv $IMAGE sh -c " mkdir /srv/subdir; echo READY;sleep infinity"
338
+ wait_for_ready destrunning
333
339
334
340
# Commit the image for testing non-running containers
335
341
run_podman commit -q destrunning
@@ -391,7 +397,9 @@ load helpers
391
397
echo ${randomcontent[0]} > /srv/subdir/containerfile0; \
392
398
echo ${randomcontent[1]} > /srv/subdir/containerfile1; \
393
399
mkdir /tmp/subdir.; cp /srv/subdir/* /tmp/subdir./; \
400
+ echo READY;
394
401
sleep infinity"
402
+ wait_for_ready srcrunning
395
403
396
404
# Commit the image for testing non-running containers
397
405
run_podman commit -q srcrunning
@@ -460,7 +468,9 @@ load helpers
460
468
echo ${randomcontent[0]} > /srv/subdir/containerfile0; \
461
469
echo ${randomcontent[1]} > /srv/subdir/containerfile1; \
462
470
mkdir /tmp/subdir.; cp /srv/subdir/* /tmp/subdir./; \
471
+ echo READY;
463
472
sleep infinity"
473
+ wait_for_ready srcrunning
464
474
465
475
# Commit the image for testing non-running containers
466
476
run_podman commit -q srcrunning
@@ -549,7 +559,9 @@ load helpers
549
559
run_podman run -d --name srcrunning $IMAGE sh -c " echo ${randomcontent[0]} > /tmp/containerfile0; \
550
560
echo ${randomcontent[1]} > /tmp/containerfile1; \
551
561
mkdir /tmp/sub && cd /tmp/sub && ln -s .. weirdlink; \
562
+ echo READY;
552
563
sleep infinity"
564
+ wait_for_ready srcrunning
553
565
554
566
# Commit the image for testing non-running containers
555
567
run_podman commit -q srcrunning
@@ -749,7 +761,8 @@ load helpers
749
761
sh -c " mkdir /tmp/d1;ln -s /tmp/nonesuch1 /tmp/d1/x;
750
762
mkdir /tmp/d2;ln -s /tmp/nonesuch2 /tmp/d2/x;
751
763
mkdir /tmp/d3;
752
- trap 'exit 0' 15;while :;do sleep 0.5;done"
764
+ trap 'exit 0' 15;echo READY;while :;do sleep 0.5;done"
765
+ wait_for_ready cpcontainer
753
766
754
767
# Copy file from host into container, into a file named 'x'
755
768
# Note that the second has a trailing slash, implying a directory.
@@ -912,8 +925,10 @@ load helpers
912
925
rand_content_file=$( random_string 50)
913
926
rand_content_dir=$( random_string 50)
914
927
915
- run_podman run -d --name ctr-file $IMAGE sh -c " echo '$rand_content_file ' > /tmp/foo; sleep infinity"
916
- run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; echo '$rand_content_dir ' > /tmp/foo/file.txt; sleep infinity"
928
+ run_podman run -d --name ctr-file $IMAGE sh -c " echo '$rand_content_file ' > /tmp/foo; echo READY; sleep infinity"
929
+ run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; echo '$rand_content_dir ' > /tmp/foo/file.txt; echo READY; sleep infinity"
930
+ wait_for_ready ctr-file
931
+ wait_for_ready ctr-dir
917
932
918
933
# overwrite a directory with a file
919
934
run_podman 125 cp ctr-file:/tmp/foo ctr-dir:/tmp
@@ -946,8 +961,10 @@ load helpers
946
961
rand_content_file=$( random_string 50)
947
962
rand_content_dir=$( random_string 50)
948
963
949
- run_podman run -d --name ctr-file $IMAGE sh -c " echo '$rand_content_file ' > /tmp/foo; sleep infinity"
950
- run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; echo '$rand_content_dir ' > /tmp/foo/file.txt; sleep infinity"
964
+ run_podman run -d --name ctr-file $IMAGE sh -c " echo '$rand_content_file ' > /tmp/foo; echo READY; sleep infinity"
965
+ run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; echo '$rand_content_dir ' > /tmp/foo/file.txt; echo READY; sleep infinity"
966
+ wait_for_ready ctr-file
967
+ wait_for_ready ctr-dir
951
968
952
969
# overwrite a directory with a file
953
970
mkdir $hostdir /foo
@@ -978,8 +995,10 @@ load helpers
978
995
rand_content_file=$( random_string 50)
979
996
rand_content_dir=$( random_string 50)
980
997
981
- run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; sleep infinity"
982
- run_podman run -d --name ctr-file $IMAGE sh -c " touch /tmp/foo; sleep infinity"
998
+ run_podman run -d --name ctr-dir $IMAGE sh -c " mkdir /tmp/foo; echo READY; sleep infinity"
999
+ run_podman run -d --name ctr-file $IMAGE sh -c " touch /tmp/foo; echo READY; sleep infinity"
1000
+ wait_for_ready ctr-dir
1001
+ wait_for_ready ctr-file
983
1002
984
1003
# overwrite a directory with a file
985
1004
echo " $rand_content_file " > $hostdir /foo
@@ -1025,7 +1044,9 @@ load helpers
1025
1044
dstdir=$PODMAN_TMPDIR /dst
1026
1045
mkdir -p $dstdir
1027
1046
1028
- run_podman run -d --name=test-ctr --rm $IMAGE sh -c " mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; sleep infinity"
1047
+ run_podman run -d --name=test-ctr --rm $IMAGE sh -c " mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; echo READY;sleep infinity"
1048
+ wait_for_ready test-ctr
1049
+
1029
1050
run_podman cp test-ctr:/foo/test1. $dstdir /foo
1030
1051
run /bin/ls -1 $dstdir /foo
1031
1052
assert " $output " = " file1" " ls [local]/foo: only file1 was copied, nothing more"
@@ -1034,7 +1055,9 @@ load helpers
1034
1055
}
1035
1056
1036
1057
@test " podman cp - dot notation - container to container" {
1037
- run_podman run -d --name=src-ctr --rm $IMAGE sh -c " mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; sleep infinity"
1058
+ run_podman run -d --name=src-ctr --rm $IMAGE sh -c " mkdir -p /foo/test1. /foo/test2; touch /foo/test1./file1 /foo/test2/file2; echo READY;sleep infinity"
1059
+ wait_for_ready src-ctr
1060
+
1038
1061
run_podman run -d --name=dest-ctr --rm $IMAGE sleep infinity
1039
1062
run_podman cp src-ctr:/foo/test1. dest-ctr:/foo
1040
1063
0 commit comments