@@ -29,10 +29,21 @@ func TestCascadeStop(t *testing.T) {
2929
3030 const projectName = "compose-e2e-logs"
3131
32- res := c .RunDockerCmd ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--abort-on-container-exit" )
33- res .Assert (t , icmd.Expected {Out : `PING localhost (127.0.0.1)` })
34- res .Assert (t , icmd.Expected {Out : `/does_not_exist: No such file or directory` })
35- res .Assert (t , icmd.Expected {Out : `should_fail_1 exited with code 1` })
36- res .Assert (t , icmd.Expected {Out : `Aborting on container exit...` })
37- // FIXME res.Assert(t, icmd.Expected{ExitCode: 1})
32+ t .Run ("abort-on-container-exit" , func (t * testing.T ) {
33+ res := c .RunDockerCmd ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--abort-on-container-exit" )
34+ res .Assert (t , icmd.Expected {Out : `/does_not_exist: No such file or directory` })
35+ res .Assert (t , icmd.Expected {Out : `should_fail_1 exited with code 1` })
36+ res .Assert (t , icmd.Expected {Out : `Aborting on container exit...` })
37+ res .Assert (t , icmd.Expected {Out : `ERROR 1` })
38+ res .Assert (t , icmd.Expected {ExitCode : 1 })
39+ })
40+
41+ t .Run ("exit-code-from" , func (t * testing.T ) {
42+ res := c .RunDockerCmd ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--exit-code-from=sleep" )
43+ res .Assert (t , icmd.Expected {Out : `/does_not_exist: No such file or directory` })
44+ res .Assert (t , icmd.Expected {Out : `should_fail_1 exited with code 1` })
45+ res .Assert (t , icmd.Expected {Out : `Aborting on container exit...` })
46+ res .Assert (t , icmd.Expected {Out : `ERROR 143` })
47+ res .Assert (t , icmd.Expected {ExitCode : 143 })
48+ })
3849}
0 commit comments