summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/tests
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-05-11 15:52:42 -0700
committergVisor bot <gvisor-bot@google.com>2020-05-11 15:54:08 -0700
commit633e1b89bb403edb2cfe2b0c2e1c902f68743743 (patch)
treeac575d8ee3b223f8cb026dd4d32c881ec21729b9 /test/packetimpact/tests
parente838e7ab3406ff55faf034f67fe91a31cca18ab5 (diff)
Internal change.
PiperOrigin-RevId: 311011004
Diffstat (limited to 'test/packetimpact/tests')
-rw-r--r--test/packetimpact/tests/fin_wait2_timeout_test.go5
-rw-r--r--test/packetimpact/tests/icmpv6_param_problem_test.go5
-rw-r--r--test/packetimpact/tests/tcp_close_wait_ack_test.go5
-rw-r--r--test/packetimpact/tests/tcp_noaccept_close_rst_test.go5
-rw-r--r--test/packetimpact/tests/tcp_outside_the_window_test.go5
-rw-r--r--test/packetimpact/tests/tcp_should_piggyback_test.go5
-rw-r--r--test/packetimpact/tests/tcp_user_timeout_test.go5
-rw-r--r--test/packetimpact/tests/tcp_window_shrink_test.go5
-rw-r--r--test/packetimpact/tests/tcp_zero_window_probe_retransmit_test.go5
-rw-r--r--test/packetimpact/tests/tcp_zero_window_probe_test.go5
-rw-r--r--test/packetimpact/tests/tcp_zero_window_probe_usertimeout_test.go5
-rw-r--r--test/packetimpact/tests/udp_icmp_error_propagation_test.go5
-rw-r--r--test/packetimpact/tests/udp_recv_multicast_test.go5
-rw-r--r--test/packetimpact/tests/udp_send_recv_dgram_test.go5
14 files changed, 70 insertions, 0 deletions
diff --git a/test/packetimpact/tests/fin_wait2_timeout_test.go b/test/packetimpact/tests/fin_wait2_timeout_test.go
index 99dc77f9a..c26ab78d9 100644
--- a/test/packetimpact/tests/fin_wait2_timeout_test.go
+++ b/test/packetimpact/tests/fin_wait2_timeout_test.go
@@ -15,6 +15,7 @@
package fin_wait2_timeout_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestFinWait2Timeout(t *testing.T) {
for _, tt := range []struct {
description string
diff --git a/test/packetimpact/tests/icmpv6_param_problem_test.go b/test/packetimpact/tests/icmpv6_param_problem_test.go
index b48e55df4..bb1fc26fc 100644
--- a/test/packetimpact/tests/icmpv6_param_problem_test.go
+++ b/test/packetimpact/tests/icmpv6_param_problem_test.go
@@ -16,6 +16,7 @@ package icmpv6_param_problem_test
import (
"encoding/binary"
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
// TestICMPv6ParamProblemTest sends a packet with a bad next header. The DUT
// should respond with an ICMPv6 Parameter Problem message.
func TestICMPv6ParamProblemTest(t *testing.T) {
diff --git a/test/packetimpact/tests/tcp_close_wait_ack_test.go b/test/packetimpact/tests/tcp_close_wait_ack_test.go
index 153ce285b..70a22a2db 100644
--- a/test/packetimpact/tests/tcp_close_wait_ack_test.go
+++ b/test/packetimpact/tests/tcp_close_wait_ack_test.go
@@ -15,6 +15,7 @@
package tcp_close_wait_ack_test
import (
+ "flag"
"fmt"
"testing"
"time"
@@ -25,6 +26,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestCloseWaitAck(t *testing.T) {
for _, tt := range []struct {
description string
diff --git a/test/packetimpact/tests/tcp_noaccept_close_rst_test.go b/test/packetimpact/tests/tcp_noaccept_close_rst_test.go
index 7ebdd1950..2c1ec27d3 100644
--- a/test/packetimpact/tests/tcp_noaccept_close_rst_test.go
+++ b/test/packetimpact/tests/tcp_noaccept_close_rst_test.go
@@ -15,6 +15,7 @@
package tcp_noaccept_close_rst_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestTcpNoAcceptCloseReset(t *testing.T) {
dut := tb.NewDUT(t)
defer dut.TearDown()
diff --git a/test/packetimpact/tests/tcp_outside_the_window_test.go b/test/packetimpact/tests/tcp_outside_the_window_test.go
index db3d3273b..351df193e 100644
--- a/test/packetimpact/tests/tcp_outside_the_window_test.go
+++ b/test/packetimpact/tests/tcp_outside_the_window_test.go
@@ -15,6 +15,7 @@
package tcp_outside_the_window_test
import (
+ "flag"
"fmt"
"testing"
"time"
@@ -25,6 +26,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
// TestTCPOutsideTheWindows tests the behavior of the DUT when packets arrive
// that are inside or outside the TCP window. Packets that are outside the
// window should force an extra ACK, as described in RFC793 page 69:
diff --git a/test/packetimpact/tests/tcp_should_piggyback_test.go b/test/packetimpact/tests/tcp_should_piggyback_test.go
index b0be6ba23..0240dc2f9 100644
--- a/test/packetimpact/tests/tcp_should_piggyback_test.go
+++ b/test/packetimpact/tests/tcp_should_piggyback_test.go
@@ -15,6 +15,7 @@
package tcp_should_piggyback_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestPiggyback(t *testing.T) {
dut := tb.NewDUT(t)
defer dut.TearDown()
diff --git a/test/packetimpact/tests/tcp_user_timeout_test.go b/test/packetimpact/tests/tcp_user_timeout_test.go
index 3cf82badb..ce31917ee 100644
--- a/test/packetimpact/tests/tcp_user_timeout_test.go
+++ b/test/packetimpact/tests/tcp_user_timeout_test.go
@@ -15,6 +15,7 @@
package tcp_user_timeout_test
import (
+ "flag"
"fmt"
"testing"
"time"
@@ -24,6 +25,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func sendPayload(conn *tb.TCPIPv4, dut *tb.DUT, fd int32) error {
sampleData := make([]byte, 100)
for i := range sampleData {
diff --git a/test/packetimpact/tests/tcp_window_shrink_test.go b/test/packetimpact/tests/tcp_window_shrink_test.go
index c9354074e..58ec1d740 100644
--- a/test/packetimpact/tests/tcp_window_shrink_test.go
+++ b/test/packetimpact/tests/tcp_window_shrink_test.go
@@ -15,6 +15,7 @@
package tcp_window_shrink_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestWindowShrink(t *testing.T) {
dut := tb.NewDUT(t)
defer dut.TearDown()
diff --git a/test/packetimpact/tests/tcp_zero_window_probe_retransmit_test.go b/test/packetimpact/tests/tcp_zero_window_probe_retransmit_test.go
index 864e5a634..dd43a24db 100644
--- a/test/packetimpact/tests/tcp_zero_window_probe_retransmit_test.go
+++ b/test/packetimpact/tests/tcp_zero_window_probe_retransmit_test.go
@@ -15,6 +15,7 @@
package tcp_zero_window_probe_retransmit_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
// TestZeroWindowProbeRetransmit tests retransmits of zero window probes
// to be sent at exponentially inreasing time intervals.
func TestZeroWindowProbeRetransmit(t *testing.T) {
diff --git a/test/packetimpact/tests/tcp_zero_window_probe_test.go b/test/packetimpact/tests/tcp_zero_window_probe_test.go
index 4fa3d0cd4..6c453505d 100644
--- a/test/packetimpact/tests/tcp_zero_window_probe_test.go
+++ b/test/packetimpact/tests/tcp_zero_window_probe_test.go
@@ -15,6 +15,7 @@
package tcp_zero_window_probe_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
// TestZeroWindowProbe tests few cases of zero window probing over the
// same connection.
func TestZeroWindowProbe(t *testing.T) {
diff --git a/test/packetimpact/tests/tcp_zero_window_probe_usertimeout_test.go b/test/packetimpact/tests/tcp_zero_window_probe_usertimeout_test.go
index 7d81c276c..193427fb9 100644
--- a/test/packetimpact/tests/tcp_zero_window_probe_usertimeout_test.go
+++ b/test/packetimpact/tests/tcp_zero_window_probe_usertimeout_test.go
@@ -15,6 +15,7 @@
package tcp_zero_window_probe_usertimeout_test
import (
+ "flag"
"testing"
"time"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
// TestZeroWindowProbeUserTimeout sanity tests user timeout when we are
// retransmitting zero window probes.
func TestZeroWindowProbeUserTimeout(t *testing.T) {
diff --git a/test/packetimpact/tests/udp_icmp_error_propagation_test.go b/test/packetimpact/tests/udp_icmp_error_propagation_test.go
index 1462f360e..ca4df2ab0 100644
--- a/test/packetimpact/tests/udp_icmp_error_propagation_test.go
+++ b/test/packetimpact/tests/udp_icmp_error_propagation_test.go
@@ -16,6 +16,7 @@ package udp_icmp_error_propagation_test
import (
"context"
+ "flag"
"fmt"
"net"
"sync"
@@ -28,6 +29,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
type connectionMode bool
func (c connectionMode) String() string {
diff --git a/test/packetimpact/tests/udp_recv_multicast_test.go b/test/packetimpact/tests/udp_recv_multicast_test.go
index 61fd17050..0bae18ba3 100644
--- a/test/packetimpact/tests/udp_recv_multicast_test.go
+++ b/test/packetimpact/tests/udp_recv_multicast_test.go
@@ -15,6 +15,7 @@
package udp_recv_multicast_test
import (
+ "flag"
"net"
"testing"
@@ -23,6 +24,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func TestUDPRecvMulticast(t *testing.T) {
dut := tb.NewDUT(t)
defer dut.TearDown()
diff --git a/test/packetimpact/tests/udp_send_recv_dgram_test.go b/test/packetimpact/tests/udp_send_recv_dgram_test.go
index 1c682831c..350875a6f 100644
--- a/test/packetimpact/tests/udp_send_recv_dgram_test.go
+++ b/test/packetimpact/tests/udp_send_recv_dgram_test.go
@@ -15,6 +15,7 @@
package udp_send_recv_dgram_test
import (
+ "flag"
"math/rand"
"net"
"testing"
@@ -24,6 +25,10 @@ import (
tb "gvisor.dev/gvisor/test/packetimpact/testbench"
)
+func init() {
+ tb.RegisterFlags(flag.CommandLine)
+}
+
func generateRandomPayload(t *testing.T, n int) string {
t.Helper()
buf := make([]byte, n)