Skip to content

Commit b405d1f

Browse files
committed
Use CombinedOutput in vm_test
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
1 parent 66533f7 commit b405d1f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

initramfs/vm_test.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package initramfs_test
99
import (
1010
"context"
1111
"errors"
12-
"io"
1312
"os"
1413
"path/filepath"
1514
"testing"
@@ -60,17 +59,11 @@ func TestCPU(t *testing.T) {
6059
t.Fatalf("CPUCommand: got %v, want nil", err)
6160
}
6261
client.SetVerbose(t.Logf)
63-
r, w, err := os.Pipe()
64-
cpu.Stdout, cpu.Stderr = w, w
6562

66-
err = cpu.Run()
63+
b, err := cpu.CombinedOutput()
6764
if err == nil != tt.ok {
6865
t.Errorf("%s %s: got %v, want %v", tt.cmd, tt.args, err == nil != tt.ok, err == nil == tt.ok)
6966
}
70-
b, err := io.ReadAll(r)
71-
if err != nil {
72-
t.Errorf("reading pipe output: got %v, want nil", err)
73-
}
7467
t.Logf("%q", string(b))
7568
}
7669
b, err := os.ReadFile(filepath.Join(d, "b"))

0 commit comments

Comments
 (0)