summaryrefslogtreecommitdiffhomepage
path: root/test/iptables
diff options
context:
space:
mode:
Diffstat (limited to 'test/iptables')
-rw-r--r--test/iptables/filter_input.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/iptables/filter_input.go b/test/iptables/filter_input.go
index e9f0978eb..bd6059921 100644
--- a/test/iptables/filter_input.go
+++ b/test/iptables/filter_input.go
@@ -256,10 +256,12 @@ func (FilterInputDropAll) LocalAction(ip net.IP) error {
// misunderstand and save the wrong tables.
type FilterInputMultiUDPRules struct{}
+// Name implements TestCase.Name.
func (FilterInputMultiUDPRules) Name() string {
return "FilterInputMultiUDPRules"
}
+// ContainerAction implements TestCase.ContainerAction.
func (FilterInputMultiUDPRules) ContainerAction(ip net.IP) error {
if err := filterTable("-A", "INPUT", "-p", "udp", "-m", "udp", "--destination-port", fmt.Sprintf("%d", dropPort), "-j", "DROP"); err != nil {
return err
@@ -270,6 +272,7 @@ func (FilterInputMultiUDPRules) ContainerAction(ip net.IP) error {
return filterTable("-L")
}
+// LocalAction implements TestCase.LocalAction.
func (FilterInputMultiUDPRules) LocalAction(ip net.IP) error {
// No-op.
return nil
@@ -279,10 +282,12 @@ func (FilterInputMultiUDPRules) LocalAction(ip net.IP) error {
// specified.
type FilterInputRequireProtocolUDP struct{}
+// Name implements TestCase.Name.
func (FilterInputRequireProtocolUDP) Name() string {
return "FilterInputRequireProtocolUDP"
}
+// ContainerAction implements TestCase.ContainerAction.
func (FilterInputRequireProtocolUDP) ContainerAction(ip net.IP) error {
if err := filterTable("-A", "INPUT", "-m", "udp", "--destination-port", fmt.Sprintf("%d", dropPort), "-j", "DROP"); err == nil {
return errors.New("expected iptables to fail with out \"-p udp\", but succeeded")
@@ -290,6 +295,7 @@ func (FilterInputRequireProtocolUDP) ContainerAction(ip net.IP) error {
return nil
}
+// LocalAction implements TestCase.LocalAction.
func (FilterInputRequireProtocolUDP) LocalAction(ip net.IP) error {
// No-op.
return nil