summaryrefslogtreecommitdiff
path: root/test/e2e/libpod_suite_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/libpod_suite_test.go')
-rw-r--r--test/e2e/libpod_suite_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index fa8cd128f..88ec6bc19 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -727,3 +727,19 @@ func WriteJsonFile(data []byte, filePath string) error {
func getTestContext() context.Context {
return context.Background()
}
+
+func containerized() bool {
+ container := os.Getenv("container")
+ if container != "" {
+ return true
+ }
+ b, err := ioutil.ReadFile("/proc/1/cgroup")
+ if err != nil {
+ // shrug, if we cannot read that file, return false
+ return false
+ }
+ if strings.Index(string(b), "docker") > -1 {
+ return true
+ }
+ return false
+}