MCPcopy
hub / github.com/hashicorp/packer / Check

Method Check

packer_test/common/check/pipe_checker.go:216–239  ·  view source on GitHub ↗
(stdout, stderr string, _ error)

Source from the content-addressed store, hash-verified

214}
215
216func (pc PipeChecker) Check(stdout, stderr string, _ error) error {
217 if pc.check == nil {
218 return fmt.Errorf("%s - missing tester", pc.Name())
219 }
220
221 var pipeStr string
222 switch pc.stream {
223 case OnlyStdout:
224 pipeStr = stdout
225 case OnlyStderr:
226 pipeStr = stderr
227 case BothStreams:
228 pipeStr = fmt.Sprintf("%s\n%s", stdout, stderr)
229 }
230
231 var err error
232 for i, pp := range pc.pipers {
233 pipeStr, err = pp.Process(pipeStr)
234 if err != nil {
235 return fmt.Errorf("pipeline failed during execution (%d): %s", i, err)
236 }
237 }
238 return pc.check.Check(pipeStr)
239}
240
241func (pc PipeChecker) Name() string {
242 rawName := "|>?"

Callers

nothing calls this directly

Calls 4

NameMethod · 0.95
ProcessMethod · 0.65
CheckMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected