Signed-off-by: Darren Stahl <darst@microsoft.com>
| ... | ... |
@@ -536,7 +536,6 @@ func (s *DockerSuite) TestBuildOnBuildForbiddenChainedInSourceImage(c *check.C) |
| 536 | 536 |
} |
| 537 | 537 |
|
| 538 | 538 |
func (s *DockerSuite) TestBuildOnBuildCmdEntrypointJSON(c *check.C) {
|
| 539 |
- testRequires(c, DaemonIsLinux) |
|
| 540 | 539 |
name1 := "onbuildcmd" |
| 541 | 540 |
name2 := "onbuildgenerated" |
| 542 | 541 |
|
| ... | ... |
@@ -557,16 +556,15 @@ ONBUILD RUN ["true"]`, |
| 557 | 557 |
c.Fatal(err) |
| 558 | 558 |
} |
| 559 | 559 |
|
| 560 |
- out, _ := dockerCmd(c, "run", "-t", name2) |
|
| 560 |
+ out, _ := dockerCmd(c, "run", name2) |
|
| 561 | 561 |
|
| 562 | 562 |
if !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {
|
| 563 |
- c.Fatal("did not get echo output from onbuild", out)
|
|
| 563 |
+ c.Fatalf("did not get echo output from onbuild. Got: %q", out)
|
|
| 564 | 564 |
} |
| 565 | 565 |
|
| 566 | 566 |
} |
| 567 | 567 |
|
| 568 | 568 |
func (s *DockerSuite) TestBuildOnBuildEntrypointJSON(c *check.C) {
|
| 569 |
- testRequires(c, DaemonIsLinux) |
|
| 570 | 569 |
name1 := "onbuildcmd" |
| 571 | 570 |
name2 := "onbuildgenerated" |
| 572 | 571 |
|
| ... | ... |
@@ -585,7 +583,7 @@ ONBUILD ENTRYPOINT ["echo"]`, |
| 585 | 585 |
c.Fatal(err) |
| 586 | 586 |
} |
| 587 | 587 |
|
| 588 |
- out, _ := dockerCmd(c, "run", "-t", name2) |
|
| 588 |
+ out, _ := dockerCmd(c, "run", name2) |
|
| 589 | 589 |
|
| 590 | 590 |
if !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {
|
| 591 | 591 |
c.Fatal("got malformed output from onbuild", out)
|
| ... | ... |
@@ -594,7 +592,7 @@ ONBUILD ENTRYPOINT ["echo"]`, |
| 594 | 594 |
} |
| 595 | 595 |
|
| 596 | 596 |
func (s *DockerSuite) TestBuildCacheAdd(c *check.C) {
|
| 597 |
- testRequires(c, DaemonIsLinux) |
|
| 597 |
+ testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet |
|
| 598 | 598 |
name := "testbuildtwoimageswithadd" |
| 599 | 599 |
server, err := fakeStorage(map[string]string{
|
| 600 | 600 |
"robots.txt": "hello", |
| ... | ... |
@@ -629,7 +627,7 @@ func (s *DockerSuite) TestBuildCacheAdd(c *check.C) {
|
| 629 | 629 |
} |
| 630 | 630 |
|
| 631 | 631 |
func (s *DockerSuite) TestBuildLastModified(c *check.C) {
|
| 632 |
- testRequires(c, DaemonIsLinux) |
|
| 632 |
+ testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet |
|
| 633 | 633 |
name := "testbuildlastmodified" |
| 634 | 634 |
|
| 635 | 635 |
server, err := fakeStorage(map[string]string{
|
| ... | ... |
@@ -695,9 +693,20 @@ RUN ls -le /file` |
| 695 | 695 |
} |
| 696 | 696 |
|
| 697 | 697 |
func (s *DockerSuite) TestBuildSixtySteps(c *check.C) {
|
| 698 |
- testRequires(c, DaemonIsLinux) |
|
| 698 |
+ testRequires(c, DaemonIsLinux) // TODO Windows: This test passes on Windows, |
|
| 699 |
+ // but currently adds a disproportionate amount of time for the value it has. |
|
| 700 |
+ // Removing it from Windows CI for now, but this will be revisited in the |
|
| 701 |
+ // TP5 timeframe when perf is better. |
|
| 699 | 702 |
name := "foobuildsixtysteps" |
| 700 |
- ctx, err := fakeContext("FROM scratch\n"+strings.Repeat("ADD foo /\n", 60),
|
|
| 703 |
+ |
|
| 704 |
+ var baseImage string |
|
| 705 |
+ if daemonPlatform == "windows" {
|
|
| 706 |
+ baseImage = "windowsservercore" |
|
| 707 |
+ } else {
|
|
| 708 |
+ baseImage = "scratch" |
|
| 709 |
+ } |
|
| 710 |
+ |
|
| 711 |
+ ctx, err := fakeContext("FROM "+baseImage+"\n"+strings.Repeat("ADD foo /\n", 60),
|
|
| 701 | 712 |
map[string]string{
|
| 702 | 713 |
"foo": "test1", |
| 703 | 714 |
}) |
| ... | ... |
@@ -712,7 +721,7 @@ func (s *DockerSuite) TestBuildSixtySteps(c *check.C) {
|
| 712 | 712 |
} |
| 713 | 713 |
|
| 714 | 714 |
func (s *DockerSuite) TestBuildAddSingleFileToRoot(c *check.C) {
|
| 715 |
- testRequires(c, DaemonIsLinux) |
|
| 715 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 716 | 716 |
name := "testaddimg" |
| 717 | 717 |
ctx, err := fakeContext(fmt.Sprintf(`FROM busybox |
| 718 | 718 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -738,7 +747,6 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`, expecte
|
| 738 | 738 |
|
| 739 | 739 |
// Issue #3960: "ADD src ." hangs |
| 740 | 740 |
func (s *DockerSuite) TestBuildAddSingleFileToWorkdir(c *check.C) {
|
| 741 |
- testRequires(c, DaemonIsLinux) |
|
| 742 | 741 |
name := "testaddsinglefiletoworkdir" |
| 743 | 742 |
ctx, err := fakeContext(`FROM busybox |
| 744 | 743 |
ADD test_file .`, |
| ... | ... |
@@ -765,7 +773,7 @@ ADD test_file .`, |
| 765 | 765 |
} |
| 766 | 766 |
|
| 767 | 767 |
func (s *DockerSuite) TestBuildAddSingleFileToExistDir(c *check.C) {
|
| 768 |
- testRequires(c, DaemonIsLinux) |
|
| 768 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 769 | 769 |
name := "testaddsinglefiletoexistdir" |
| 770 | 770 |
ctx, err := fakeContext(`FROM busybox |
| 771 | 771 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -791,7 +799,7 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
| 791 | 791 |
} |
| 792 | 792 |
|
| 793 | 793 |
func (s *DockerSuite) TestBuildCopyAddMultipleFiles(c *check.C) {
|
| 794 |
- testRequires(c, DaemonIsLinux) |
|
| 794 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 795 | 795 |
server, err := fakeStorage(map[string]string{
|
| 796 | 796 |
"robots.txt": "hello", |
| 797 | 797 |
}) |
| ... | ... |
@@ -836,9 +844,16 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
| 836 | 836 |
} |
| 837 | 837 |
|
| 838 | 838 |
func (s *DockerSuite) TestBuildAddMultipleFilesToFile(c *check.C) {
|
| 839 |
- testRequires(c, DaemonIsLinux) |
|
| 840 | 839 |
name := "testaddmultiplefilestofile" |
| 841 |
- ctx, err := fakeContext(`FROM scratch |
|
| 840 |
+ |
|
| 841 |
+ var baseImage string |
|
| 842 |
+ if daemonPlatform == "windows" {
|
|
| 843 |
+ baseImage = "windowsservercore" |
|
| 844 |
+ } else {
|
|
| 845 |
+ baseImage = "scratch" |
|
| 846 |
+ } |
|
| 847 |
+ |
|
| 848 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 842 | 849 |
ADD file1.txt file2.txt test |
| 843 | 850 |
`, |
| 844 | 851 |
map[string]string{
|
| ... | ... |
@@ -858,9 +873,16 @@ func (s *DockerSuite) TestBuildAddMultipleFilesToFile(c *check.C) {
|
| 858 | 858 |
} |
| 859 | 859 |
|
| 860 | 860 |
func (s *DockerSuite) TestBuildJSONAddMultipleFilesToFile(c *check.C) {
|
| 861 |
- testRequires(c, DaemonIsLinux) |
|
| 862 | 861 |
name := "testjsonaddmultiplefilestofile" |
| 863 |
- ctx, err := fakeContext(`FROM scratch |
|
| 862 |
+ |
|
| 863 |
+ var baseImage string |
|
| 864 |
+ if daemonPlatform == "windows" {
|
|
| 865 |
+ baseImage = "windowsservercore" |
|
| 866 |
+ } else {
|
|
| 867 |
+ baseImage = "scratch" |
|
| 868 |
+ } |
|
| 869 |
+ |
|
| 870 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 864 | 871 |
ADD ["file1.txt", "file2.txt", "test"] |
| 865 | 872 |
`, |
| 866 | 873 |
map[string]string{
|
| ... | ... |
@@ -880,9 +902,16 @@ func (s *DockerSuite) TestBuildJSONAddMultipleFilesToFile(c *check.C) {
|
| 880 | 880 |
} |
| 881 | 881 |
|
| 882 | 882 |
func (s *DockerSuite) TestBuildAddMultipleFilesToFileWild(c *check.C) {
|
| 883 |
- testRequires(c, DaemonIsLinux) |
|
| 884 | 883 |
name := "testaddmultiplefilestofilewild" |
| 885 |
- ctx, err := fakeContext(`FROM scratch |
|
| 884 |
+ |
|
| 885 |
+ var baseImage string |
|
| 886 |
+ if daemonPlatform == "windows" {
|
|
| 887 |
+ baseImage = "windowsservercore" |
|
| 888 |
+ } else {
|
|
| 889 |
+ baseImage = "scratch" |
|
| 890 |
+ } |
|
| 891 |
+ |
|
| 892 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 886 | 893 |
ADD file*.txt test |
| 887 | 894 |
`, |
| 888 | 895 |
map[string]string{
|
| ... | ... |
@@ -902,9 +931,16 @@ func (s *DockerSuite) TestBuildAddMultipleFilesToFileWild(c *check.C) {
|
| 902 | 902 |
} |
| 903 | 903 |
|
| 904 | 904 |
func (s *DockerSuite) TestBuildJSONAddMultipleFilesToFileWild(c *check.C) {
|
| 905 |
- testRequires(c, DaemonIsLinux) |
|
| 906 | 905 |
name := "testjsonaddmultiplefilestofilewild" |
| 907 |
- ctx, err := fakeContext(`FROM scratch |
|
| 906 |
+ |
|
| 907 |
+ var baseImage string |
|
| 908 |
+ if daemonPlatform == "windows" {
|
|
| 909 |
+ baseImage = "windowsservercore" |
|
| 910 |
+ } else {
|
|
| 911 |
+ baseImage = "scratch" |
|
| 912 |
+ } |
|
| 913 |
+ |
|
| 914 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 908 | 915 |
ADD ["file*.txt", "test"] |
| 909 | 916 |
`, |
| 910 | 917 |
map[string]string{
|
| ... | ... |
@@ -924,9 +960,16 @@ func (s *DockerSuite) TestBuildJSONAddMultipleFilesToFileWild(c *check.C) {
|
| 924 | 924 |
} |
| 925 | 925 |
|
| 926 | 926 |
func (s *DockerSuite) TestBuildCopyMultipleFilesToFile(c *check.C) {
|
| 927 |
- testRequires(c, DaemonIsLinux) |
|
| 928 | 927 |
name := "testcopymultiplefilestofile" |
| 929 |
- ctx, err := fakeContext(`FROM scratch |
|
| 928 |
+ |
|
| 929 |
+ var baseImage string |
|
| 930 |
+ if daemonPlatform == "windows" {
|
|
| 931 |
+ baseImage = "windowsservercore" |
|
| 932 |
+ } else {
|
|
| 933 |
+ baseImage = "scratch" |
|
| 934 |
+ } |
|
| 935 |
+ |
|
| 936 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 930 | 937 |
COPY file1.txt file2.txt test |
| 931 | 938 |
`, |
| 932 | 939 |
map[string]string{
|
| ... | ... |
@@ -946,9 +989,16 @@ func (s *DockerSuite) TestBuildCopyMultipleFilesToFile(c *check.C) {
|
| 946 | 946 |
} |
| 947 | 947 |
|
| 948 | 948 |
func (s *DockerSuite) TestBuildJSONCopyMultipleFilesToFile(c *check.C) {
|
| 949 |
- testRequires(c, DaemonIsLinux) |
|
| 950 | 949 |
name := "testjsoncopymultiplefilestofile" |
| 951 |
- ctx, err := fakeContext(`FROM scratch |
|
| 950 |
+ |
|
| 951 |
+ var baseImage string |
|
| 952 |
+ if daemonPlatform == "windows" {
|
|
| 953 |
+ baseImage = "windowsservercore" |
|
| 954 |
+ } else {
|
|
| 955 |
+ baseImage = "scratch" |
|
| 956 |
+ } |
|
| 957 |
+ |
|
| 958 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 952 | 959 |
COPY ["file1.txt", "file2.txt", "test"] |
| 953 | 960 |
`, |
| 954 | 961 |
map[string]string{
|
| ... | ... |
@@ -968,7 +1018,7 @@ func (s *DockerSuite) TestBuildJSONCopyMultipleFilesToFile(c *check.C) {
|
| 968 | 968 |
} |
| 969 | 969 |
|
| 970 | 970 |
func (s *DockerSuite) TestBuildAddFileWithWhitespace(c *check.C) {
|
| 971 |
- testRequires(c, DaemonIsLinux) |
|
| 971 |
+ testRequires(c, DaemonIsLinux) // Not currently passing on Windows |
|
| 972 | 972 |
name := "testaddfilewithwhitespace" |
| 973 | 973 |
ctx, err := fakeContext(`FROM busybox |
| 974 | 974 |
RUN mkdir "/test dir" |
| ... | ... |
@@ -1004,7 +1054,7 @@ RUN [ $(cat "/test dir/test_file6") = 'test6' ]`, |
| 1004 | 1004 |
} |
| 1005 | 1005 |
|
| 1006 | 1006 |
func (s *DockerSuite) TestBuildCopyFileWithWhitespace(c *check.C) {
|
| 1007 |
- testRequires(c, DaemonIsLinux) |
|
| 1007 |
+ testRequires(c, DaemonIsLinux) // Not currently passing on Windows |
|
| 1008 | 1008 |
name := "testcopyfilewithwhitespace" |
| 1009 | 1009 |
ctx, err := fakeContext(`FROM busybox |
| 1010 | 1010 |
RUN mkdir "/test dir" |
| ... | ... |
@@ -1040,7 +1090,6 @@ RUN [ $(cat "/test dir/test_file6") = 'test6' ]`, |
| 1040 | 1040 |
} |
| 1041 | 1041 |
|
| 1042 | 1042 |
func (s *DockerSuite) TestBuildAddMultipleFilesToFileWithWhitespace(c *check.C) {
|
| 1043 |
- testRequires(c, DaemonIsLinux) |
|
| 1044 | 1043 |
name := "testaddmultiplefilestofilewithwhitespace" |
| 1045 | 1044 |
ctx, err := fakeContext(`FROM busybox |
| 1046 | 1045 |
ADD [ "test file1", "test file2", "test" ] |
| ... | ... |
@@ -1062,7 +1111,6 @@ func (s *DockerSuite) TestBuildAddMultipleFilesToFileWithWhitespace(c *check.C) |
| 1062 | 1062 |
} |
| 1063 | 1063 |
|
| 1064 | 1064 |
func (s *DockerSuite) TestBuildCopyMultipleFilesToFileWithWhitespace(c *check.C) {
|
| 1065 |
- testRequires(c, DaemonIsLinux) |
|
| 1066 | 1065 |
name := "testcopymultiplefilestofilewithwhitespace" |
| 1067 | 1066 |
ctx, err := fakeContext(`FROM busybox |
| 1068 | 1067 |
COPY [ "test file1", "test file2", "test" ] |
| ... | ... |
@@ -1084,7 +1132,7 @@ func (s *DockerSuite) TestBuildCopyMultipleFilesToFileWithWhitespace(c *check.C) |
| 1084 | 1084 |
} |
| 1085 | 1085 |
|
| 1086 | 1086 |
func (s *DockerSuite) TestBuildCopyWildcard(c *check.C) {
|
| 1087 |
- testRequires(c, DaemonIsLinux) |
|
| 1087 |
+ testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet |
|
| 1088 | 1088 |
name := "testcopywildcard" |
| 1089 | 1089 |
server, err := fakeStorage(map[string]string{
|
| 1090 | 1090 |
"robots.txt": "hello", |
| ... | ... |
@@ -1135,7 +1183,6 @@ func (s *DockerSuite) TestBuildCopyWildcard(c *check.C) {
|
| 1135 | 1135 |
} |
| 1136 | 1136 |
|
| 1137 | 1137 |
func (s *DockerSuite) TestBuildCopyWildcardNoFind(c *check.C) {
|
| 1138 |
- testRequires(c, DaemonIsLinux) |
|
| 1139 | 1138 |
name := "testcopywildcardnofind" |
| 1140 | 1139 |
ctx, err := fakeContext(`FROM busybox |
| 1141 | 1140 |
COPY file*.txt /tmp/ |
| ... | ... |
@@ -1156,7 +1203,6 @@ func (s *DockerSuite) TestBuildCopyWildcardNoFind(c *check.C) {
|
| 1156 | 1156 |
} |
| 1157 | 1157 |
|
| 1158 | 1158 |
func (s *DockerSuite) TestBuildCopyWildcardInName(c *check.C) {
|
| 1159 |
- testRequires(c, DaemonIsLinux) |
|
| 1160 | 1159 |
name := "testcopywildcardinname" |
| 1161 | 1160 |
ctx, err := fakeContext(`FROM busybox |
| 1162 | 1161 |
COPY *.txt /tmp/ |
| ... | ... |
@@ -1181,7 +1227,6 @@ func (s *DockerSuite) TestBuildCopyWildcardInName(c *check.C) {
|
| 1181 | 1181 |
} |
| 1182 | 1182 |
|
| 1183 | 1183 |
func (s *DockerSuite) TestBuildCopyWildcardCache(c *check.C) {
|
| 1184 |
- testRequires(c, DaemonIsLinux) |
|
| 1185 | 1184 |
name := "testcopywildcardcache" |
| 1186 | 1185 |
ctx, err := fakeContext(`FROM busybox |
| 1187 | 1186 |
COPY file1.txt /tmp/`, |
| ... | ... |
@@ -1215,7 +1260,7 @@ func (s *DockerSuite) TestBuildCopyWildcardCache(c *check.C) {
|
| 1215 | 1215 |
} |
| 1216 | 1216 |
|
| 1217 | 1217 |
func (s *DockerSuite) TestBuildAddSingleFileToNonExistingDir(c *check.C) {
|
| 1218 |
- testRequires(c, DaemonIsLinux) |
|
| 1218 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1219 | 1219 |
name := "testaddsinglefiletononexistingdir" |
| 1220 | 1220 |
ctx, err := fakeContext(`FROM busybox |
| 1221 | 1221 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1241,7 +1286,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
| 1241 | 1241 |
} |
| 1242 | 1242 |
|
| 1243 | 1243 |
func (s *DockerSuite) TestBuildAddDirContentToRoot(c *check.C) {
|
| 1244 |
- testRequires(c, DaemonIsLinux) |
|
| 1244 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1245 | 1245 |
name := "testadddircontenttoroot" |
| 1246 | 1246 |
ctx, err := fakeContext(`FROM busybox |
| 1247 | 1247 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1265,7 +1310,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
| 1265 | 1265 |
} |
| 1266 | 1266 |
|
| 1267 | 1267 |
func (s *DockerSuite) TestBuildAddDirContentToExistingDir(c *check.C) {
|
| 1268 |
- testRequires(c, DaemonIsLinux) |
|
| 1268 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1269 | 1269 |
name := "testadddircontenttoexistingdir" |
| 1270 | 1270 |
ctx, err := fakeContext(`FROM busybox |
| 1271 | 1271 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1291,7 +1336,7 @@ RUN [ $(ls -l /exists/test_file | awk '{print $3":"$4}') = 'root:root' ]`,
|
| 1291 | 1291 |
} |
| 1292 | 1292 |
|
| 1293 | 1293 |
func (s *DockerSuite) TestBuildAddWholeDirToRoot(c *check.C) {
|
| 1294 |
- testRequires(c, DaemonIsLinux) |
|
| 1294 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1295 | 1295 |
name := "testaddwholedirtoroot" |
| 1296 | 1296 |
ctx, err := fakeContext(fmt.Sprintf(`FROM busybox |
| 1297 | 1297 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1319,9 +1364,16 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`, expecte
|
| 1319 | 1319 |
|
| 1320 | 1320 |
// Testing #5941 |
| 1321 | 1321 |
func (s *DockerSuite) TestBuildAddEtcToRoot(c *check.C) {
|
| 1322 |
- testRequires(c, DaemonIsLinux) |
|
| 1323 | 1322 |
name := "testaddetctoroot" |
| 1324 |
- ctx, err := fakeContext(`FROM scratch |
|
| 1323 |
+ |
|
| 1324 |
+ var baseImage string |
|
| 1325 |
+ if daemonPlatform == "windows" {
|
|
| 1326 |
+ baseImage = "windowsservercore" |
|
| 1327 |
+ } else {
|
|
| 1328 |
+ baseImage = "scratch" |
|
| 1329 |
+ } |
|
| 1330 |
+ |
|
| 1331 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 1325 | 1332 |
ADD . /`, |
| 1326 | 1333 |
map[string]string{
|
| 1327 | 1334 |
"etc/test_file": "test1", |
| ... | ... |
@@ -1338,7 +1390,7 @@ ADD . /`, |
| 1338 | 1338 |
|
| 1339 | 1339 |
// Testing #9401 |
| 1340 | 1340 |
func (s *DockerSuite) TestBuildAddPreservesFilesSpecialBits(c *check.C) {
|
| 1341 |
- testRequires(c, DaemonIsLinux) |
|
| 1341 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1342 | 1342 |
name := "testaddpreservesfilesspecialbits" |
| 1343 | 1343 |
ctx, err := fakeContext(`FROM busybox |
| 1344 | 1344 |
ADD suidbin /usr/bin/suidbin |
| ... | ... |
@@ -1361,7 +1413,7 @@ RUN [ $(ls -l /usr/bin/suidbin | awk '{print $1}') = '-rwsr-xr-x' ]`,
|
| 1361 | 1361 |
} |
| 1362 | 1362 |
|
| 1363 | 1363 |
func (s *DockerSuite) TestBuildCopySingleFileToRoot(c *check.C) {
|
| 1364 |
- testRequires(c, DaemonIsLinux) |
|
| 1364 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1365 | 1365 |
name := "testcopysinglefiletoroot" |
| 1366 | 1366 |
ctx, err := fakeContext(fmt.Sprintf(`FROM busybox |
| 1367 | 1367 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1387,7 +1439,6 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`, expecte
|
| 1387 | 1387 |
|
| 1388 | 1388 |
// Issue #3960: "ADD src ." hangs - adapted for COPY |
| 1389 | 1389 |
func (s *DockerSuite) TestBuildCopySingleFileToWorkdir(c *check.C) {
|
| 1390 |
- testRequires(c, DaemonIsLinux) |
|
| 1391 | 1390 |
name := "testcopysinglefiletoworkdir" |
| 1392 | 1391 |
ctx, err := fakeContext(`FROM busybox |
| 1393 | 1392 |
COPY test_file .`, |
| ... | ... |
@@ -1414,7 +1465,7 @@ COPY test_file .`, |
| 1414 | 1414 |
} |
| 1415 | 1415 |
|
| 1416 | 1416 |
func (s *DockerSuite) TestBuildCopySingleFileToExistDir(c *check.C) {
|
| 1417 |
- testRequires(c, DaemonIsLinux) |
|
| 1417 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1418 | 1418 |
name := "testcopysinglefiletoexistdir" |
| 1419 | 1419 |
ctx, err := fakeContext(`FROM busybox |
| 1420 | 1420 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1440,7 +1491,7 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
| 1440 | 1440 |
} |
| 1441 | 1441 |
|
| 1442 | 1442 |
func (s *DockerSuite) TestBuildCopySingleFileToNonExistDir(c *check.C) {
|
| 1443 |
- testRequires(c, DaemonIsLinux) |
|
| 1443 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1444 | 1444 |
name := "testcopysinglefiletononexistdir" |
| 1445 | 1445 |
ctx, err := fakeContext(`FROM busybox |
| 1446 | 1446 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1465,7 +1516,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
| 1465 | 1465 |
} |
| 1466 | 1466 |
|
| 1467 | 1467 |
func (s *DockerSuite) TestBuildCopyDirContentToRoot(c *check.C) {
|
| 1468 |
- testRequires(c, DaemonIsLinux) |
|
| 1468 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1469 | 1469 |
name := "testcopydircontenttoroot" |
| 1470 | 1470 |
ctx, err := fakeContext(`FROM busybox |
| 1471 | 1471 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1489,7 +1540,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
| 1489 | 1489 |
} |
| 1490 | 1490 |
|
| 1491 | 1491 |
func (s *DockerSuite) TestBuildCopyDirContentToExistDir(c *check.C) {
|
| 1492 |
- testRequires(c, DaemonIsLinux) |
|
| 1492 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1493 | 1493 |
name := "testcopydircontenttoexistdir" |
| 1494 | 1494 |
ctx, err := fakeContext(`FROM busybox |
| 1495 | 1495 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1515,7 +1566,7 @@ RUN [ $(ls -l /exists/test_file | awk '{print $3":"$4}') = 'root:root' ]`,
|
| 1515 | 1515 |
} |
| 1516 | 1516 |
|
| 1517 | 1517 |
func (s *DockerSuite) TestBuildCopyWholeDirToRoot(c *check.C) {
|
| 1518 |
- testRequires(c, DaemonIsLinux) |
|
| 1518 |
+ testRequires(c, DaemonIsLinux) // Linux specific test |
|
| 1519 | 1519 |
name := "testcopywholedirtoroot" |
| 1520 | 1520 |
ctx, err := fakeContext(fmt.Sprintf(`FROM busybox |
| 1521 | 1521 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| ... | ... |
@@ -1542,9 +1593,16 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`, expecte
|
| 1542 | 1542 |
} |
| 1543 | 1543 |
|
| 1544 | 1544 |
func (s *DockerSuite) TestBuildCopyEtcToRoot(c *check.C) {
|
| 1545 |
- testRequires(c, DaemonIsLinux) |
|
| 1546 | 1545 |
name := "testcopyetctoroot" |
| 1547 |
- ctx, err := fakeContext(`FROM scratch |
|
| 1546 |
+ |
|
| 1547 |
+ var baseImage string |
|
| 1548 |
+ if daemonPlatform == "windows" {
|
|
| 1549 |
+ baseImage = "windowsservercore" |
|
| 1550 |
+ } else {
|
|
| 1551 |
+ baseImage = "scratch" |
|
| 1552 |
+ } |
|
| 1553 |
+ |
|
| 1554 |
+ ctx, err := fakeContext(`FROM `+baseImage+` |
|
| 1548 | 1555 |
COPY . /`, |
| 1549 | 1556 |
map[string]string{
|
| 1550 | 1557 |
"etc/test_file": "test1", |
| ... | ... |
@@ -1560,9 +1618,16 @@ COPY . /`, |
| 1560 | 1560 |
} |
| 1561 | 1561 |
|
| 1562 | 1562 |
func (s *DockerSuite) TestBuildCopyDisallowRemote(c *check.C) {
|
| 1563 |
- testRequires(c, DaemonIsLinux) |
|
| 1564 | 1563 |
name := "testcopydisallowremote" |
| 1565 |
- _, out, err := buildImageWithOut(name, `FROM scratch |
|
| 1564 |
+ |
|
| 1565 |
+ var baseImage string |
|
| 1566 |
+ if daemonPlatform == "windows" {
|
|
| 1567 |
+ baseImage = "windowsservercore" |
|
| 1568 |
+ } else {
|
|
| 1569 |
+ baseImage = "scratch" |
|
| 1570 |
+ } |
|
| 1571 |
+ |
|
| 1572 |
+ _, out, err := buildImageWithOut(name, `FROM `+baseImage+` |
|
| 1566 | 1573 |
COPY https://index.docker.io/robots.txt /`, |
| 1567 | 1574 |
true) |
| 1568 | 1575 |
if err == nil || !strings.Contains(out, "Source can't be a URL for COPY") {
|
| ... | ... |
@@ -1571,15 +1636,14 @@ COPY https://index.docker.io/robots.txt /`, |
| 1571 | 1571 |
} |
| 1572 | 1572 |
|
| 1573 | 1573 |
func (s *DockerSuite) TestBuildAddBadLinks(c *check.C) {
|
| 1574 |
- testRequires(c, DaemonIsLinux) |
|
| 1575 |
- const ( |
|
| 1576 |
- dockerfile = ` |
|
| 1577 |
- FROM scratch |
|
| 1578 |
- ADD links.tar / |
|
| 1579 |
- ADD foo.txt /symlink/ |
|
| 1580 |
- ` |
|
| 1581 |
- targetFile = "foo.txt" |
|
| 1582 |
- ) |
|
| 1574 |
+ testRequires(c, DaemonIsLinux) // Not currently working on Windows |
|
| 1575 |
+ |
|
| 1576 |
+ dockerfile := ` |
|
| 1577 |
+ FROM scratch |
|
| 1578 |
+ ADD links.tar / |
|
| 1579 |
+ ADD foo.txt /symlink/ |
|
| 1580 |
+ ` |
|
| 1581 |
+ targetFile := "foo.txt" |
|
| 1583 | 1582 |
var ( |
| 1584 | 1583 |
name = "test-link-absolute" |
| 1585 | 1584 |
) |
| ... | ... |
@@ -1658,7 +1722,7 @@ func (s *DockerSuite) TestBuildAddBadLinks(c *check.C) {
|
| 1658 | 1658 |
} |
| 1659 | 1659 |
|
| 1660 | 1660 |
func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
|
| 1661 |
- testRequires(c, DaemonIsLinux) |
|
| 1661 |
+ testRequires(c, DaemonIsLinux) // ln not implemented on Windows busybox |
|
| 1662 | 1662 |
const ( |
| 1663 | 1663 |
dockerfileTemplate = ` |
| 1664 | 1664 |
FROM busybox |
| ... | ... |
@@ -1711,8 +1775,7 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
|
| 1711 | 1711 |
// Issue #5270 - ensure we throw a better error than "unexpected EOF" |
| 1712 | 1712 |
// when we can't access files in the context. |
| 1713 | 1713 |
func (s *DockerSuite) TestBuildWithInaccessibleFilesInContext(c *check.C) {
|
| 1714 |
- testRequires(c, DaemonIsLinux) |
|
| 1715 |
- testRequires(c, UnixCli) // test uses chown/chmod: not available on windows |
|
| 1714 |
+ testRequires(c, DaemonIsLinux, UnixCli) // test uses chown/chmod: not available on windows |
|
| 1716 | 1715 |
|
| 1717 | 1716 |
{
|
| 1718 | 1717 |
name := "testbuildinaccessiblefiles" |