add a test case for EXPOSE ports order

changing order of EXPOSE ports should not invalidate the cache as the content
doesnt change

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
This commit is contained in:
Daniel, Dao Quang Minh 2014-11-12 09:13:47 -05:00
Родитель a2a50aa35a
Коммит 1e7ba09b60
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -1732,6 +1732,29 @@ func TestBuildExpose(t *testing.T) {
logDone("build - expose")
}
func TestBuildExposeOrder(t *testing.T) {
buildID := func(name, exposed string) string {
_, err := buildImage(name, fmt.Sprintf(`FROM scratch
EXPOSE %s`, exposed), true)
if err != nil {
t.Fatal(err)
}
id, err := inspectField(name, "Id")
if err != nil {
t.Fatal(err)
}
return id
}
id1 := buildID("testbuildexpose1", "80 2375")
id2 := buildID("testbuildexpose2", "2375 80")
defer deleteImages("testbuildexpose1", "testbuildexpose2")
if id1 != id2 {
t.Errorf("EXPOSE should invalidate the cache only when ports actually changed")
}
logDone("build - expose order")
}
func TestBuildEmptyEntrypointInheritance(t *testing.T) {
name := "testbuildentrypointinheritance"
name2 := "testbuildentrypointinheritance2"