moby/libnetwork/testutils/net.go
Brian Goff 72c4a7b496 Fix issues running libnetwork tests.
libnetwork does different stuff depending on if you are running the
tests in a container or not... without telling it we are in a container
a bunch of the tests actually fail.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 22:14:41 +00:00

11 lines
207 B
Go

package testutils
import (
"os"
)
// IsRunningInContainer returns whether the test is running inside a container.
func IsRunningInContainer() bool {
_, err := os.Stat("/.dockerenv")
return err == nil
}