mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
72c4a7b496
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>
11 lines
207 B
Go
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
|
|
}
|