tstest/integration/vms: log qemu output (#2047)

Most of the time qemu will output nothing when it is running. This is
expected behavior. However when qemu is unable to start due to some
problem, it prints that to either stdout or stderr. Previously this
output wasn't being captured. This patch captures that output to aid in
debugging qemu issues.

Updates #1988

Signed-off-by: Christine Dodrill <xe@tailscale.com>
This commit is contained in:
Christine Dodrill
2021-06-04 14:44:04 -04:00
committed by GitHub
parent 58cc2cc921
commit 6ce77b8eca

View File

@@ -294,7 +294,10 @@ func mkVM(t *testing.T, n int, d Distro, sshKey, hostURL, tdir string) func() {
t.Logf("running: qemu-system-x86_64 %s", strings.Join(args, " "))
cmd := exec.Command("qemu-system-x86_64", args...)
cmd.Stdout = log.Writer()
cmd.Stderr = log.Writer()
err = cmd.Start()
if err != nil {
t.Fatal(err)
}