MCPcopy Create free account
hub / github.com/containerd/nerdctl / TestBasicFail

Function TestBasicFail

mod/tigron/internal/com/command_test.go:146–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

144}
145
146func TestBasicFail(t *testing.T) {
147 t.Parallel()
148
149 command := &com.Command{
150 Binary: "bash",
151 Args: []string{"-c", "--", "does-not-exist"},
152 }
153
154 err := command.Run(context.WithValue(context.Background(), com.LoggerKey, t))
155
156 assertive.ErrorIsNil(t, err, "Err")
157
158 res, err := command.Wait()
159
160 assertive.ErrorIs(t, err, com.ErrExecutionFailed, "Err")
161 assertive.IsEqual(t, 127, res.ExitCode, "ExitCode")
162 assertive.IsEqual(t, "", res.Stdout, "Stdout")
163 assertive.HasSuffix(t, res.Stderr, "does-not-exist: command not found\n", "Stderr")
164}
165
166func TestWorkingDir(t *testing.T) {
167 t.Parallel()

Callers

nothing calls this directly

Calls 3

RunMethod · 0.95
WaitMethod · 0.95
BackgroundMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…