mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Move cmd build test to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
b05be686ec
commit
c58991f31a
2 changed files with 14 additions and 20 deletions
|
@ -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
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Add table
Reference in a new issue