MCPcopy
hub / github.com/docker/compose / TestStopAlreadyStopped

Function TestStopAlreadyStopped

pkg/e2e/start_stop_test.go:197–218  ·  pkg/e2e/start_stop_test.go::TestStopAlreadyStopped
(t *testing.T)

Source from the content-addressed store, hash-verified

195}
196
197func TestStopAlreadyStopped(t *testing.T) {
198 cli := NewParallelCLI(t, WithEnv(
199 "COMPOSE_PROJECT_NAME=e2e-start-stop-svc-already-stopped",
200 "COMPOSE_FILE=./fixtures/start-stop/compose.yaml"))
201 t.Cleanup(func() {
202 cli.RunDockerComposeCmd(t, "down", "--remove-orphans", "-v", "-t", "0")
203 })
204
205 cli.RunDockerComposeCmd(t, "up", "-d", "--wait")
206
207 // stop the container
208 cli.RunDockerComposeCmd(t, "stop", "simple")
209
210 // attempt to stop it again
211 res := cli.RunDockerComposeCmdNoCheck(t, "stop", "simple")
212 // TODO: for consistency, this should NOT write any output because the
213 // container is already stopped
214 res.Assert(t, icmd.Expected{
215 ExitCode: 0,
216 Err: "Container e2e-start-stop-svc-already-stopped-simple-1 Stopped",
217 })
218}
219
220func TestStartStopMultipleServices(t *testing.T) {
221 cli := NewParallelCLI(t, WithEnv(

Callers

nothing calls this directly

Calls 4

NewParallelCLIFunction · 0.85
WithEnvFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected