When --net=none enabled, the test uses local filesystem
| ... | ... |
@@ -770,16 +770,24 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
| 770 | 770 |
} |
| 771 | 771 |
|
| 772 | 772 |
func TestBuildCopyAddMultipleFiles(t *testing.T) {
|
| 773 |
+ server, err := fakeStorage(map[string]string{
|
|
| 774 |
+ "robots.txt": "hello", |
|
| 775 |
+ }) |
|
| 776 |
+ if err != nil {
|
|
| 777 |
+ t.Fatal(err) |
|
| 778 |
+ } |
|
| 779 |
+ defer server.Close() |
|
| 780 |
+ |
|
| 773 | 781 |
name := "testcopymultiplefilestofile" |
| 774 | 782 |
defer deleteImages(name) |
| 775 |
- ctx, err := fakeContext(`FROM busybox |
|
| 783 |
+ ctx, err := fakeContext(fmt.Sprintf(`FROM busybox |
|
| 776 | 784 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 777 | 785 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| 778 | 786 |
RUN mkdir /exists |
| 779 | 787 |
RUN touch /exists/exists_file |
| 780 | 788 |
RUN chown -R dockerio.dockerio /exists |
| 781 | 789 |
COPY test_file1 test_file2 /exists/ |
| 782 |
-ADD test_file3 test_file4 https://dockerproject.com/robots.txt /exists/ |
|
| 790 |
+ADD test_file3 test_file4 %s/robots.txt /exists/ |
|
| 783 | 791 |
RUN [ $(ls -l / | grep exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
| 784 | 792 |
RUN [ $(ls -l /exists/test_file1 | awk '{print $3":"$4}') = 'root:root' ]
|
| 785 | 793 |
RUN [ $(ls -l /exists/test_file2 | awk '{print $3":"$4}') = 'root:root' ]
|
| ... | ... |
@@ -789,7 +797,7 @@ RUN [ $(ls -l /exists/test_file4 | awk '{print $3":"$4}') = 'root:root' ]
|
| 789 | 789 |
RUN [ $(ls -l /exists/robots.txt | awk '{print $3":"$4}') = 'root:root' ]
|
| 790 | 790 |
|
| 791 | 791 |
RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
| 792 |
-`, |
|
| 792 |
+`, server.URL), |
|
| 793 | 793 |
map[string]string{
|
| 794 | 794 |
"test_file1": "test1", |
| 795 | 795 |
"test_file2": "test2", |