Browse code

Add integration test for xz path issue

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>

Conflicts:
integration-cli/docker_cli_build_test.go

Arnaud Porterie authored on 2014/12/09 07:33:46
Showing 1 changed files
... ...
@@ -3885,3 +3885,32 @@ func TestBuildSymlinkBreakout(t *testing.T) {
3885 3885
 	}
3886 3886
 	logDone("build - symlink breakout")
3887 3887
 }
3888
+
3889
+func TestBuildXZHost(t *testing.T) {
3890
+	name := "testbuildxzhost"
3891
+	defer deleteImages(name)
3892
+
3893
+	ctx, err := fakeContext(`
3894
+FROM busybox
3895
+ADD xz /usr/local/sbin/
3896
+RUN chmod 755 /usr/local/sbin/xz
3897
+ADD test.xz /
3898
+RUN [ ! -e /injected ]`,
3899
+		map[string]string{
3900
+			"test.xz": "\xfd\x37\x7a\x58\x5a\x00\x00\x04\xe6\xd6\xb4\x46\x02\x00" +
3901
+				"\x21\x01\x16\x00\x00\x00\x74\x2f\xe5\xa3\x01\x00\x3f\xfd" +
3902
+				"\x37\x7a\x58\x5a\x00\x00\x04\xe6\xd6\xb4\x46\x02\x00\x21",
3903
+			"xz": "#!/bin/sh\ntouch /injected",
3904
+		})
3905
+
3906
+	if err != nil {
3907
+		t.Fatal(err)
3908
+	}
3909
+	defer ctx.Close()
3910
+
3911
+	if _, err := buildImageFromContext(name, ctx, true); err != nil {
3912
+		t.Fatal(err)
3913
+	}
3914
+
3915
+	logDone("build - xz host is being used")
3916
+}