Skip to content

Commit

Permalink
Fixed the tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Madhu Venugopal <madhu@docker.com>
  • Loading branch information
mavenugo authored and Arnaud Porterie committed Jun 16, 2015
1 parent 6c07f50 commit 78fef19
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions iptables/iptables_test.go
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 78fef19

Please sign in to comment.