@@ -52,8 +52,8 @@ func TestTable(t *testing.T) {
5252 assert .Check (t , is .Equal (tbl6 .Family (), IPv6 ))
5353
5454 // Update nftables and check what happened.
55- applyAndCheck (t , tbl4 , t .Name ()+ "_created4 .golden" )
56- applyAndCheck (t , tbl6 , t .Name ()+ "_created46 .golden" )
55+ applyAndCheck (t , tbl4 , t .Name ()+ "/created4 .golden" )
56+ applyAndCheck (t , tbl6 , t .Name ()+ "/created46 .golden" )
5757}
5858
5959func TestChain (t * testing.T ) {
@@ -95,7 +95,7 @@ func TestChain(t *testing.T) {
9595 assert .Check (t , err )
9696
9797 // Update nftables and check what happened.
98- applyAndCheck (t , tbl , t .Name ()+ "_created .golden" )
98+ applyAndCheck (t , tbl , t .Name ()+ "/created .golden" )
9999
100100 // Delete a rule from the base chain.
101101 f = tbl .ChainUpdateFunc (ctx , bcName , false )
@@ -116,7 +116,7 @@ func TestChain(t *testing.T) {
116116 assert .Check (t , is .ErrorContains (err , "not a base chain" ))
117117
118118 // Update nftables and check what happened.
119- applyAndCheck (t , tbl , t .Name ()+ "_modified .golden" )
119+ applyAndCheck (t , tbl , t .Name ()+ "/modified .golden" )
120120
121121 // Delete the base chain.
122122 err = tbl .DeleteChain (ctx , bcName )
@@ -131,7 +131,7 @@ func TestChain(t *testing.T) {
131131 assert .Check (t , is .ErrorContains (err , "does not exist" ))
132132
133133 // Update nftables and check what happened.
134- applyAndCheck (t , tbl , t .Name ()+ "_deleted .golden" )
134+ applyAndCheck (t , tbl , t .Name ()+ "/deleted .golden" )
135135}
136136
137137func TestChainRuleGroups (t * testing.T ) {
@@ -186,7 +186,7 @@ func TestVMap(t *testing.T) {
186186 assert .Check (t , err )
187187
188188 // Update nftables and check what happened.
189- applyAndCheck (t , tbl , t .Name ()+ "_created .golden" )
189+ applyAndCheck (t , tbl , t .Name ()+ "/created .golden" )
190190
191191 // Delete an element.
192192 err = m .DeleteElement (ctx , "eth1" )
@@ -197,7 +197,7 @@ func TestVMap(t *testing.T) {
197197 assert .Check (t , is .ErrorContains (err , "does not contain element" ))
198198
199199 // Update nftables and check what happened.
200- applyAndCheck (t , tbl , t .Name ()+ "_deleted .golden" )
200+ applyAndCheck (t , tbl , t .Name ()+ "/deleted .golden" )
201201}
202202
203203func TestSet (t * testing.T ) {
@@ -227,8 +227,8 @@ func TestSet(t *testing.T) {
227227 assert .Check (t , is .ErrorContains (err , "already contains element" ))
228228
229229 // Update nftables and check what happened.
230- applyAndCheck (t , tbl4 , t .Name ()+ "_created4 .golden" )
231- applyAndCheck (t , tbl6 , t .Name ()+ "_created46 .golden" )
230+ applyAndCheck (t , tbl4 , t .Name ()+ "/created4 .golden" )
231+ applyAndCheck (t , tbl6 , t .Name ()+ "/created46 .golden" )
232232
233233 // Delete elements.
234234 err = s4 .DeleteElement (ctx , "192.0.2.1/24" )
@@ -243,8 +243,8 @@ func TestSet(t *testing.T) {
243243 assert .Check (t , is .ErrorContains (err , "does not contain element" ))
244244
245245 // Update nftables and check what happened.
246- applyAndCheck (t , tbl4 , t .Name ()+ "_deleted4 .golden" )
247- applyAndCheck (t , tbl6 , t .Name ()+ "_deleted46 .golden" )
246+ applyAndCheck (t , tbl4 , t .Name ()+ "/deleted4 .golden" )
247+ applyAndCheck (t , tbl6 , t .Name ()+ "/deleted46 .golden" )
248248}
249249
250250func TestReload (t * testing.T ) {
@@ -266,7 +266,7 @@ func TestReload(t *testing.T) {
266266 assert .Check (t , err )
267267 err = tbl .PrefixSet (ctx , "set4" ).AddElement (ctx , "192.0.2.0/24" )
268268 assert .Check (t , err )
269- applyAndCheck (t , tbl , t .Name ()+ "_created .golden" )
269+ applyAndCheck (t , tbl , t .Name ()+ "/created .golden" )
270270
271271 // Delete the underlying nftables table.
272272 deleteTable := func () {
@@ -282,7 +282,7 @@ func TestReload(t *testing.T) {
282282 // Reconstruct the nftables table.
283283 err = tbl .Reload (context .Background ())
284284 assert .Check (t , err )
285- applyAndCheck (t , tbl , t .Name ()+ "_reloaded .golden" )
285+ applyAndCheck (t , tbl , t .Name ()+ "/reloaded .golden" )
286286
287287 // Delete again.
288288 deleteTable ()
@@ -291,5 +291,5 @@ func TestReload(t *testing.T) {
291291 // from a vmap/set will trigger this.
292292 err = m .DeleteElement (ctx , "eth1" )
293293 assert .Check (t , err )
294- applyAndCheck (t , tbl , t .Name ()+ "_recovered .golden" )
294+ applyAndCheck (t , tbl , t .Name ()+ "/recovered .golden" )
295295}
0 commit comments