summaryrefslogtreecommitdiffhomepage
path: root/test/iptables/iptables_test.go
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2020-01-13 09:11:40 -0800
committerNayana Bidari <nybidari@google.com>2020-01-13 09:11:40 -0800
commit98327a94cce7597589ac22b8557c5d9a2a03464d (patch)
treef1e7ce4fdcaeb7bd1064b56ed9ce68fc977501e2 /test/iptables/iptables_test.go
parent9aeb053bbaf834aab5b716b8645996943262b525 (diff)
Add test for iptables TCP rule
Added tests for tcp protocol with input and output rules including options sport and dport Increased timeout in iptables_test as TCP tests were timing out with existing value.
Diffstat (limited to 'test/iptables/iptables_test.go')
-rw-r--r--test/iptables/iptables_test.go26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/iptables/iptables_test.go b/test/iptables/iptables_test.go
index 05f27569f..3eeb75b8b 100644
--- a/test/iptables/iptables_test.go
+++ b/test/iptables/iptables_test.go
@@ -28,7 +28,7 @@ import (
"gvisor.dev/gvisor/runsc/testutil"
)
-const timeout time.Duration = 10 * time.Second
+const timeout time.Duration = 18 * time.Second
var image = flag.String("image", "bazel/test/iptables/runner:runner", "image to run tests in")
@@ -189,3 +189,27 @@ func TestNATDropUDP(t *testing.T) {
t.Fatal(err)
}
}
+
+func TestFilterInputDropTCPDestPort(t *testing.T) {
+ if err := singleTest(FilterInputDropTCPDestPort{}); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestFilterInputDropTCPSrcPort(t *testing.T) {
+ if err := singleTest(FilterInputDropTCPSrcPort{}); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestFilterOutputDropTCPDestPort(t *testing.T) {
+ if err := singleTest(FilterOutputDropTCPDestPort{}); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestFilterOutputDropTCPSrcPort(t *testing.T) {
+ if err := singleTest(FilterOutputDropTCPSrcPort{}); err != nil {
+ t.Fatal(err)
+ }
+}