Skip to content

Commit ae0b912

Browse files
committed
control spew in TestIP with environment VMTEST_SPEW
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
1 parent a0a8257 commit ae0b912

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

vm/ip_linux_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func none(s string, t []string) bool {
4242
// TestIP tests creation and removal of addresses, tunnels, and
4343
// ARP entries with the u-root ip command.
4444
func TestIP(t *testing.T) {
45+
_, spew := os.LookupEnv("VMTEST_SPEW")
4546
d := t.TempDir()
4647
for _, arch := range []string{"amd64", "arm", "arm64", "riscv64"} {
4748
i, err := vm.New("linux", arch)
@@ -66,7 +67,7 @@ func TestIP(t *testing.T) {
6667

6768
// For debug. It's been needed, but we do not want this spew in
6869
// CI logs, so leave it off.
69-
if false {
70+
if spew {
7071
c.Stdout, c.Stderr = os.Stdout, os.Stderr
7172
}
7273
if err := i.StartVM(c); err != nil {
@@ -206,13 +207,13 @@ func TestIP(t *testing.T) {
206207
t.Errorf("CPUCommand: got %v, want nil", err)
207208
continue
208209
}
209-
if false {
210+
if spew {
210211
client.SetVerbose(t.Logf)
211212
}
212213

213214
b, err := cpu.CombinedOutput()
214215

215-
if false { // Only enable this if you want to see console output/errors.
216+
if spew { // Only enable this if you want to see console output/errors.
216217
t.Logf("%s %v", string(b), err)
217218
}
218219

0 commit comments

Comments
 (0)