mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #11029 from brahmaroutu/fixtest_10963
When --net=none enabled, the test uses local filesystem
This commit is contained in:
commit
bcbe70588d
1 changed files with 11 additions and 3 deletions
|
@ -770,16 +770,24 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildCopyAddMultipleFiles(t *testing.T) {
|
func TestBuildCopyAddMultipleFiles(t *testing.T) {
|
||||||
|
server, err := fakeStorage(map[string]string{
|
||||||
|
"robots.txt": "hello",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer server.Close()
|
||||||
|
|
||||||
name := "testcopymultiplefilestofile"
|
name := "testcopymultiplefilestofile"
|
||||||
defer deleteImages(name)
|
defer deleteImages(name)
|
||||||
ctx, err := fakeContext(`FROM busybox
|
ctx, err := fakeContext(fmt.Sprintf(`FROM busybox
|
||||||
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd
|
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd
|
||||||
RUN echo 'dockerio:x:1001:' >> /etc/group
|
RUN echo 'dockerio:x:1001:' >> /etc/group
|
||||||
RUN mkdir /exists
|
RUN mkdir /exists
|
||||||
RUN touch /exists/exists_file
|
RUN touch /exists/exists_file
|
||||||
RUN chown -R dockerio.dockerio /exists
|
RUN chown -R dockerio.dockerio /exists
|
||||||
COPY test_file1 test_file2 /exists/
|
COPY test_file1 test_file2 /exists/
|
||||||
ADD test_file3 test_file4 https://dockerproject.com/robots.txt /exists/
|
ADD test_file3 test_file4 %s/robots.txt /exists/
|
||||||
RUN [ $(ls -l / | grep exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
RUN [ $(ls -l / | grep exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
||||||
RUN [ $(ls -l /exists/test_file1 | awk '{print $3":"$4}') = 'root:root' ]
|
RUN [ $(ls -l /exists/test_file1 | awk '{print $3":"$4}') = 'root:root' ]
|
||||||
RUN [ $(ls -l /exists/test_file2 | awk '{print $3":"$4}') = 'root:root' ]
|
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' ]
|
||||||
RUN [ $(ls -l /exists/robots.txt | awk '{print $3":"$4}') = 'root:root' ]
|
RUN [ $(ls -l /exists/robots.txt | awk '{print $3":"$4}') = 'root:root' ]
|
||||||
|
|
||||||
RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio' ]
|
||||||
`,
|
`, server.URL),
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"test_file1": "test1",
|
"test_file1": "test1",
|
||||||
"test_file2": "test2",
|
"test_file2": "test2",
|
||||||
|
|
Loading…
Add table
Reference in a new issue