diff options
Diffstat (limited to 'test/packetimpact/runner')
-rw-r--r-- | test/packetimpact/runner/defs.bzl | 6 | ||||
-rw-r--r-- | test/packetimpact/runner/dut.go | 30 |
2 files changed, 22 insertions, 14 deletions
diff --git a/test/packetimpact/runner/defs.bzl b/test/packetimpact/runner/defs.bzl index 34e83ec49..634c15727 100644 --- a/test/packetimpact/runner/defs.bzl +++ b/test/packetimpact/runner/defs.bzl @@ -246,6 +246,12 @@ ALL_TESTS = [ expect_netstack_failure = True, ), PacketimpactTestInfo( + name = "tcp_listen_backlog", + ), + PacketimpactTestInfo( + name = "tcp_syncookie", + ), + PacketimpactTestInfo( name = "icmpv6_param_problem", ), PacketimpactTestInfo( diff --git a/test/packetimpact/runner/dut.go b/test/packetimpact/runner/dut.go index b271bd47e..4fb2f5c4b 100644 --- a/test/packetimpact/runner/dut.go +++ b/test/packetimpact/runner/dut.go @@ -369,30 +369,32 @@ func TestWithDUT(ctx context.Context, t *testing.T, mkDevice func(*dockerutil.Co "--dut_infos_json", string(dutInfosBytes), ) testbenchLogs, err := testbenchContainer.Exec(ctx, dockerutil.ExecOpts{}, testArgs...) - if (err != nil) != expectFailure { - var dutLogs string - for i, dut := range duts { - logs, err := dut.Logs(ctx) - if err != nil { - logs = fmt.Sprintf("failed to fetch DUT logs: %s", err) - } - dutLogs = fmt.Sprintf(`%s====== Begin of DUT-%d Logs ====== + var dutLogs string + for i, dut := range duts { + logs, err := dut.Logs(ctx) + if err != nil { + logs = fmt.Sprintf("failed to fetch DUT logs: %s", err) + } + dutLogs = fmt.Sprintf(`%s====== Begin of DUT-%d Logs ====== %s ====== End of DUT-%d Logs ====== `, dutLogs, i, logs, i) - } - - t.Errorf(`test error: %v, expect failure: %t - + } + testLogs := fmt.Sprintf(` %s====== Begin of Testbench Logs ====== %s -====== End of Testbench Logs ======`, - err, expectFailure, dutLogs, testbenchLogs) +====== End of Testbench Logs ======`, dutLogs, testbenchLogs) + if (err != nil) != expectFailure { + t.Errorf(`test error: %v, expect failure: %t +%s`, err, expectFailure, testLogs) + } else if expectFailure { + t.Logf(`test failed as expected: %v +%s`, err, testLogs) } } |