Properly tear down netns at the end of test

Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
This commit is contained in:
Alessandro Boch
2017-11-27 22:59:57 -08:00
committed by Vish (Ishaya) Abrams
parent 016ba6f67a
commit f67b75edbf
4 changed files with 7 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ import (
func TestRuleAddDel(t *testing.T) { func TestRuleAddDel(t *testing.T) {
skipUnlessRoot(t) skipUnlessRoot(t)
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
srcNet := &net.IPNet{IP: net.IPv4(172, 16, 0, 1), Mask: net.CIDRMask(16, 32)} srcNet := &net.IPNet{IP: net.IPv4(172, 16, 0, 1), Mask: net.CIDRMask(16, 32)}
dstNet := &net.IPNet{IP: net.IPv4(172, 16, 1, 1), Mask: net.CIDRMask(24, 32)} dstNet := &net.IPNet{IP: net.IPv4(172, 16, 1, 1), Mask: net.CIDRMask(24, 32)}

View File

@@ -9,7 +9,7 @@ import (
) )
func TestXfrmMonitorExpire(t *testing.T) { func TestXfrmMonitorExpire(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
ch := make(chan XfrmMsg) ch := make(chan XfrmMsg)
done := make(chan struct{}) done := make(chan struct{})

View File

@@ -92,7 +92,7 @@ func TestXfrmPolicyAddUpdateDel(t *testing.T) {
} }
func TestXfrmPolicyFlush(t *testing.T) { func TestXfrmPolicyFlush(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
p1 := getPolicy() p1 := getPolicy()
if err := XfrmPolicyAdd(p1); err != nil { if err := XfrmPolicyAdd(p1); err != nil {

View File

@@ -63,7 +63,7 @@ func testXfrmStateAddGetDel(t *testing.T, state *XfrmState) {
} }
func TestXfrmStateAllocSpi(t *testing.T) { func TestXfrmStateAllocSpi(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
state := getBaseState() state := getBaseState()
state.Spi = 0 state.Spi = 0
@@ -83,7 +83,7 @@ func TestXfrmStateAllocSpi(t *testing.T) {
} }
func TestXfrmStateFlush(t *testing.T) { func TestXfrmStateFlush(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
state1 := getBaseState() state1 := getBaseState()
state2 := getBaseState() state2 := getBaseState()
@@ -134,7 +134,7 @@ func TestXfrmStateFlush(t *testing.T) {
} }
func TestXfrmStateUpdateLimits(t *testing.T) { func TestXfrmStateUpdateLimits(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
// Program state with limits // Program state with limits
state := getBaseState() state := getBaseState()
@@ -182,7 +182,7 @@ func TestXfrmStateUpdateLimits(t *testing.T) {
} }
func TestXfrmStateStats(t *testing.T) { func TestXfrmStateStats(t *testing.T) {
setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
// Program state and record time // Program state and record time
state := getBaseState() state := getBaseState()