mirror of
https://github.com/moby/moby.git
synced 2025-07-30 18:23:29 +03:00
Move expose build test to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
@ -525,6 +525,21 @@ func TestBuildCmd(t *testing.T) {
|
|||||||
logDone("build - cmd")
|
logDone("build - cmd")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildExpose(t *testing.T) {
|
||||||
|
checkSimpleBuild(t,
|
||||||
|
`
|
||||||
|
FROM scratch
|
||||||
|
EXPOSE 4243
|
||||||
|
`,
|
||||||
|
|
||||||
|
"testbuildimg",
|
||||||
|
"{{json .config.ExposedPorts}}",
|
||||||
|
`{"4243/tcp":{}}`)
|
||||||
|
|
||||||
|
deleteImages("testbuildimg")
|
||||||
|
logDone("build - expose")
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: TestCaching
|
// TODO: TestCaching
|
||||||
|
|
||||||
// TODO: TestADDCacheInvalidation
|
// TODO: TestADDCacheInvalidation
|
||||||
|
@ -414,21 +414,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
|
|||||||
return image, err
|
return image, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildExpose(t *testing.T) {
|
|
||||||
img, err := buildImage(testContextTemplate{`
|
|
||||||
from {IMAGE}
|
|
||||||
expose 4243
|
|
||||||
`,
|
|
||||||
nil, nil}, t, nil, true)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, exists := img.Config.ExposedPorts[nat.NewPort("tcp", "4243")]; !exists {
|
|
||||||
t.Fail()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBuildEntrypoint(t *testing.T) {
|
func TestBuildEntrypoint(t *testing.T) {
|
||||||
img, err := buildImage(testContextTemplate{`
|
img, err := buildImage(testContextTemplate{`
|
||||||
from {IMAGE}
|
from {IMAGE}
|
||||||
|
Reference in New Issue
Block a user