@@ -131,16 +131,11 @@ func TestPrerouting(t *testing.T) {
131131 t .Fatal (err )
132132 }
133133
134- rule := []string {
135- "-j" , natChain .Name }
136-
137- rule = append (rule , args ... )
138-
139- if ! Exists (natChain .Table , "PREROUTING" , rule ... ) {
134+ if ! Exists (natChain .Table , "PREROUTING" , args ... ) {
140135 t .Fatalf ("rule does not exist" )
141136 }
142137
143- delRule := append ([]string {"-D" , "PREROUTING" , "-t" , string (Nat )}, rule ... )
138+ delRule := append ([]string {"-D" , "PREROUTING" , "-t" , string (Nat )}, args ... )
144139 if _ , err = Raw (delRule ... ); err != nil {
145140 t .Fatal (err )
146141 }
@@ -156,17 +151,12 @@ func TestOutput(t *testing.T) {
156151 t .Fatal (err )
157152 }
158153
159- rule := []string {
160- "-j" , natChain .Name }
161-
162- rule = append (rule , args ... )
163-
164- if ! Exists (natChain .Table , "OUTPUT" , rule ... ) {
154+ if ! Exists (natChain .Table , "OUTPUT" , args ... ) {
165155 t .Fatalf ("rule does not exist" )
166156 }
167157
168158 delRule := append ([]string {"-D" , "OUTPUT" , "-t" ,
169- string (natChain .Table )}, rule ... )
159+ string (natChain .Table )}, args ... )
170160 if _ , err = Raw (delRule ... ); err != nil {
171161 t .Fatal (err )
172162 }
0 commit comments