summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2020-02-25 15:03:51 -0800
committerNayana Bidari <nybidari@google.com>2020-02-25 15:03:51 -0800
commitacc405ba60834f5dce9ce04cd762d5cda02224cb (patch)
tree6571786bd38f1a5755a09dc717e9b0012d5c7d7a /test
parentb30b7f3422202232ad1c385a7ac0d775151fee2f (diff)
Add nat table support for iptables.
- commit the changes for the comments.
Diffstat (limited to 'test')
-rw-r--r--test/iptables/nat.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/iptables/nat.go b/test/iptables/nat.go
index 306cbd1b3..899d1c9d3 100644
--- a/test/iptables/nat.go
+++ b/test/iptables/nat.go
@@ -71,20 +71,12 @@ func (NATRedirectTCPPort) ContainerAction(ip net.IP) error {
}
// Listen for TCP packets on redirect port.
- if err := listenTCP(redirectPort, sendloopDuration); err != nil {
- return fmt.Errorf("connection on port %d should be accepted, but got error %v", redirectPort, err)
- }
-
- return nil
+ return listenTCP(redirectPort, sendloopDuration)
}
// LocalAction implements TestCase.LocalAction.
func (NATRedirectTCPPort) LocalAction(ip net.IP) error {
- if err := connectTCP(ip, dropPort, acceptPort, sendloopDuration); err != nil {
- return fmt.Errorf("connection destined to port %d should be accepted, but got error %v", dropPort, err)
- }
-
- return nil
+ return connectTCP(ip, dropPort, acceptPort, sendloopDuration)
}
// NATDropUDP tests that packets are not received in ports other than redirect port.