summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/runner/dut.go
diff options
context:
space:
mode:
authorSam Balana <sbalana@google.com>2021-06-04 16:44:50 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-04 16:47:50 -0700
commita2d340739649862a23d86f3e32f1bb3b928697ef (patch)
tree5528a1a710b6455cb5571443c5fbea56fe89d986 /test/packetimpact/runner/dut.go
parentfb745d7d9d73482b5b9edce380e4564d9b49d783 (diff)
Forward verbose flag to packetimpact tester
Forwards the testing verbose flag to the packetimpact test runner. This is necessary for debugging inside packetimpact tests. When this flag is present, all t.Logs in the packetimpact test wil be shown in the resulting test output. PiperOrigin-RevId: 377614550
Diffstat (limited to 'test/packetimpact/runner/dut.go')
-rw-r--r--test/packetimpact/runner/dut.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/packetimpact/runner/dut.go b/test/packetimpact/runner/dut.go
index 4fb2f5c4b..02678a76a 100644
--- a/test/packetimpact/runner/dut.go
+++ b/test/packetimpact/runner/dut.go
@@ -363,6 +363,9 @@ func TestWithDUT(ctx context.Context, t *testing.T, mkDevice func(*dockerutil.Co
// and receives packets and also sends POSIX socket commands to the
// posix_server to be executed on the DUT.
testArgs := []string{containerTestbenchBinary}
+ if testing.Verbose() {
+ testArgs = append(testArgs, "-test.v")
+ }
testArgs = append(testArgs, extraTestArgs...)
testArgs = append(testArgs,
fmt.Sprintf("--native=%t", native),
@@ -395,6 +398,8 @@ func TestWithDUT(ctx context.Context, t *testing.T, mkDevice func(*dockerutil.Co
} else if expectFailure {
t.Logf(`test failed as expected: %v
%s`, err, testLogs)
+ } else if testing.Verbose() {
+ t.Log(testLogs)
}
}