d/libnet: TestIptabler: move golden files into subdir

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton
2025-08-25 10:39:41 +02:00
parent ce4a331287
commit 28afa75c39
286 changed files with 6 additions and 6 deletions

View File

@@ -142,7 +142,7 @@ func TestIptabler(t *testing.T) {
resName = fmt.Sprintf("hairpin=%v,internal=%v,icc=%v,masq=%v,snat=%v,gwm=%v,bindlh=%v",
p(hairpin), p(internal), p(icc), p(masq), p(snat), gwmode, p(bindLocalhost))
}
testIptabler(t, tn, config, netConfig, p(bindLocalhost), tn+"_"+resName)
testIptabler(t, tn, config, netConfig, p(bindLocalhost), tn+"/"+resName)
})
}
}
@@ -168,7 +168,7 @@ func testIptabler(t *testing.T, tn string, config firewaller.Config, netConfig f
res := icmd.RunCommand(cmd+"-save", "-t", table)
assert.Assert(t, res.Error)
if !en {
name = tn + "_no"
name = tn + "/no"
}
dump += res.Combined()
}
@@ -199,8 +199,8 @@ func testIptabler(t *testing.T, tn string, config firewaller.Config, netConfig f
// end of the test (after deleting per-network and per-port rules).
fw, err := NewIptabler(context.Background(), config)
assert.NilError(t, err)
checkResults("iptables", rnWSL2Mirrored(fmt.Sprintf("%s_cleaned,hairpin=%v", tn, config.Hairpin)), config.IPv4)
checkResults("ip6tables", fmt.Sprintf("%s_cleaned,hairpin=%v", tn, config.Hairpin), config.IPv6)
checkResults("iptables", rnWSL2Mirrored(fmt.Sprintf("%s/cleaned,hairpin=%v", tn, config.Hairpin)), config.IPv4)
checkResults("ip6tables", fmt.Sprintf("%s/cleaned,hairpin=%v", tn, config.Hairpin), config.IPv6)
// Add the network.
nw, err := fw.NewNetwork(context.Background(), netConfig)
@@ -235,6 +235,6 @@ func testIptabler(t *testing.T, tn string, config firewaller.Config, netConfig f
assert.NilError(t, err)
err = nw.DelNetworkLevelRules(context.Background())
assert.NilError(t, err)
checkResults("iptables", rnWSL2Mirrored(fmt.Sprintf("%s_cleaned,hairpin=%v", tn, config.Hairpin)), config.IPv4)
checkResults("ip6tables", fmt.Sprintf("%s_cleaned,hairpin=%v", tn, config.Hairpin), config.IPv6)
checkResults("iptables", rnWSL2Mirrored(fmt.Sprintf("%s/cleaned,hairpin=%v", tn, config.Hairpin)), config.IPv4)
checkResults("ip6tables", fmt.Sprintf("%s/cleaned,hairpin=%v", tn, config.Hairpin), config.IPv6)
}

Some files were not shown because too many files have changed in this diff Show More