Skip to content

Commit

Permalink
Merge pull request #929 from kdomanski/test-panic
Browse files Browse the repository at this point in the history
tests: don't panic after failing to run Ignition
  • Loading branch information
Stephen Lowrie authored Mar 16, 2020
2 parents a25df69 + 214ac58 commit 0f686c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ func runIgnition(t *testing.T, ctx context.Context, stage, root, cwd string, app
cmd.Dir = cwd
cmd.Env = append(os.Environ(), appendEnv...)
out, err := cmd.CombinedOutput()
t.Logf("PID: %d", cmd.Process.Pid)
if cmd != nil && cmd.Process != nil {
t.Logf("PID: %d", cmd.Process.Pid)
}
t.Logf("Ignition output:\n%s", string(out))
if strings.Contains(string(out), "panic") {
return fmt.Errorf("ignition panicked")
Expand Down

0 comments on commit 0f686c0

Please sign in to comment.