From 3a8213e40aaad9e2071f988da74b61906c2d979a Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Tue, 16 Jun 2015 07:07:51 -0700 Subject: [PATCH] Fixed the tests. Signed-off-by: Madhu Venugopal --- libnetwork/iptables/iptables_test.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libnetwork/iptables/iptables_test.go b/libnetwork/iptables/iptables_test.go index 61257d0322..63d931c8ab 100644 --- a/libnetwork/iptables/iptables_test.go +++ b/libnetwork/iptables/iptables_test.go @@ -131,16 +131,11 @@ func TestPrerouting(t *testing.T) { t.Fatal(err) } - rule := []string{ - "-j", natChain.Name} - - rule = append(rule, args...) - - if !Exists(natChain.Table, "PREROUTING", rule...) { + if !Exists(natChain.Table, "PREROUTING", args...) { t.Fatalf("rule does not exist") } - delRule := append([]string{"-D", "PREROUTING", "-t", string(Nat)}, rule...) + delRule := append([]string{"-D", "PREROUTING", "-t", string(Nat)}, args...) if _, err = Raw(delRule...); err != nil { t.Fatal(err) } @@ -156,17 +151,12 @@ func TestOutput(t *testing.T) { t.Fatal(err) } - rule := []string{ - "-j", natChain.Name} - - rule = append(rule, args...) - - if !Exists(natChain.Table, "OUTPUT", rule...) { + if !Exists(natChain.Table, "OUTPUT", args...) { t.Fatalf("rule does not exist") } delRule := append([]string{"-D", "OUTPUT", "-t", - string(natChain.Table)}, rule...) + string(natChain.Table)}, args...) if _, err = Raw(delRule...); err != nil { t.Fatal(err) }