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

Function TestPauseServiceAlreadyPaused

pkg/e2e/pause_test.go:92–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestPauseServiceAlreadyPaused(t *testing.T) {
93 cli := NewParallelCLI(t, WithEnv(
94 "COMPOSE_PROJECT_NAME=e2e-pause-svc-already-paused",
95 "COMPOSE_FILE=./fixtures/pause/compose.yaml"))
96
97 cleanup := func() {
98 cli.RunDockerComposeCmd(t, "down", "-v", "--remove-orphans", "-t", "0")
99 }
100 cleanup()
101 t.Cleanup(cleanup)
102
103 // launch a and wait for it to come up
104 cli.RunDockerComposeCmd(t, "up", "--menu=false", "--wait", "a")
105 HTTPGetWithRetry(t, urlForService(t, cli, "a", 80), http.StatusOK, 50*time.Millisecond, 10*time.Second)
106
107 // pause a twice - first time should pass, second time fail
108 cli.RunDockerComposeCmd(t, "pause", "a")
109 res := cli.RunDockerComposeCmdNoCheck(t, "pause", "a")
110 res.Assert(t, icmd.Expected{ExitCode: 1, Err: "already paused"})
111}
112
113func TestPauseServiceDoesNotExist(t *testing.T) {
114 cli := NewParallelCLI(t, WithEnv(

Callers

nothing calls this directly

Calls 6

NewParallelCLIFunction · 0.85
WithEnvFunction · 0.85
HTTPGetWithRetryFunction · 0.85
urlForServiceFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected