From 05eb06f5686be1a14f33cdc0c23785d6da0feccb Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 17 Feb 2021 23:06:43 -0500 Subject: Turn on journald and k8s file logging tests Signed-off-by: Ashley Cui --- test/utils/utils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/utils/utils.go') diff --git a/test/utils/utils.go b/test/utils/utils.go index 6790f31cd..80af7fb7c 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -482,3 +482,13 @@ func RandomString(n int) string { } return string(b) } + +//SkipIfInContainer skips a test if the test is run inside a container +func SkipIfInContainer(reason string) { + if len(reason) < 5 { + panic("SkipIfInContainer must specify a reason to skip") + } + if os.Getenv("TEST_ENVIRON") == "container" { + Skip("[container]: " + reason) + } +} -- cgit v1.2.3-54-g00ecf