1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--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
}