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

Function TestBasicRunWait

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

Source from the content-addressed store, hash-verified

124}
125
126func TestBasicRunWait(t *testing.T) {
127 t.Parallel()
128
129 command := &com.Command{
130 Binary: "printf",
131 Args: []string{"one"},
132 }
133
134 err := command.Run(context.WithValue(context.Background(), com.LoggerKey, t))
135
136 assertive.ErrorIsNil(t, err, "Err")
137
138 res, err := command.Wait()
139
140 assertive.ErrorIsNil(t, err, "Err")
141 assertive.IsEqual(t, 0, res.ExitCode, "ExitCode")
142 assertive.IsEqual(t, "one", res.Stdout, "Stdout")
143 assertive.IsEqual(t, "", res.Stderr, "Stderr")
144}
145
146func TestBasicFail(t *testing.T) {
147 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…