Browse Source

Move cmd build test to integration-cli

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
LK4D4 11 years ago
parent
commit
c58991f31a
2 changed files with 14 additions and 20 deletions
  1. 14 0
      integration-cli/docker_cli_build_test.go
  2. 0 20
      integration/buildfile_test.go

+ 14 - 0
integration-cli/docker_cli_build_test.go

@@ -511,6 +511,20 @@ func TestBuildEnv(t *testing.T) {
 	logDone("build - env")
 	logDone("build - env")
 }
 }
 
 
+func TestBuildCmd(t *testing.T) {
+	checkSimpleBuild(t,
+		`
+        FROM scratch
+        CMD ["/bin/echo", "Hello World"]
+        `,
+		"testbuildimg",
+		"{{json .config.Cmd}}",
+		`["/bin/echo","Hello World"]`)
+
+	deleteImages("testbuildimg")
+	logDone("build - cmd")
+}
+
 // TODO: TestCaching
 // TODO: TestCaching
 
 
 // TODO: TestADDCacheInvalidation
 // TODO: TestADDCacheInvalidation

+ 0 - 20
integration/buildfile_test.go

@@ -414,26 +414,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
 	return image, err
 	return image, err
 }
 }
 
 
-func TestBuildCmd(t *testing.T) {
-	img, err := buildImage(testContextTemplate{`
-        from {IMAGE}
-        cmd ["/bin/echo", "Hello World"]
-        `,
-		nil, nil}, t, nil, true)
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	if img.Config.Cmd[0] != "/bin/echo" {
-		t.Log(img.Config.Cmd[0])
-		t.Fail()
-	}
-	if img.Config.Cmd[1] != "Hello World" {
-		t.Log(img.Config.Cmd[1])
-		t.Fail()
-	}
-}
-
 func TestBuildExpose(t *testing.T) {
 func TestBuildExpose(t *testing.T) {
 	img, err := buildImage(testContextTemplate{`
 	img, err := buildImage(testContextTemplate{`
         from {IMAGE}
         from {IMAGE}