Handle namespaces with care

- After creating new netns, switch back to main netns
- Lock thread during test and test setup
This commit is contained in:
zachgersh
2016-02-21 19:23:14 -08:00
parent 2708bdf2f5
commit 1e3d680d13
2 changed files with 27 additions and 8 deletions

View File

@ -57,7 +57,7 @@ var _ = Describe("Loopback", func() {
Eventually(session).Should(gexec.Exit(0))
var lo *net.Interface
err = ns.WithNetNSPath(networkNS, false, func(hostNS *os.File) error {
err = ns.WithNetNSPath(networkNS, true, func(hostNS *os.File) error {
var err error
lo, err = net.InterfaceByName("lo")
return err