libnetwork/iptables: TestReloaded(): minor cleanup
- remove local bridgeName variable that shadowed the const, but used the same value - remove some redundant `var` declarations, and changed fixed values to a const Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b216669a02
commit
126525c03e
2 changed files with 5 additions and 9 deletions
|
@ -19,15 +19,11 @@ func TestFirewalldInit(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestReloaded(t *testing.T) {
|
||||
var err error
|
||||
var fwdChain *ChainInfo
|
||||
|
||||
iptable := GetIptable(IPv4)
|
||||
fwdChain, err = iptable.NewChain("FWD", Filter, false)
|
||||
fwdChain, err := iptable.NewChain("FWD", Filter, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
bridgeName := "lo"
|
||||
|
||||
err = iptable.ProgramChain(fwdChain, bridgeName, false, true)
|
||||
if err != nil {
|
||||
|
@ -38,8 +34,8 @@ func TestReloaded(t *testing.T) {
|
|||
// copy-pasted from iptables_test:TestLink
|
||||
ip1 := net.ParseIP("192.168.1.1")
|
||||
ip2 := net.ParseIP("192.168.1.2")
|
||||
port := 1234
|
||||
proto := "tcp"
|
||||
const port = 1234
|
||||
const proto = "tcp"
|
||||
|
||||
err = fwdChain.Link(Append, ip1, ip2, port, proto, bridgeName)
|
||||
if err != nil {
|
||||
|
|
|
@ -252,8 +252,8 @@ func TestCleanup(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExistsRaw(t *testing.T) {
|
||||
testChain1 := "ABCD"
|
||||
testChain2 := "EFGH"
|
||||
const testChain1 = "ABCD"
|
||||
const testChain2 = "EFGH"
|
||||
|
||||
iptable := GetIptable(IPv4)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue