From 23602de816b9ee3e92a8cbac295e955ba43fa283 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Fri, 5 Apr 2019 19:49:36 -0500 Subject: Revert "Switch to golangci-lint" Signed-off-by: baude --- cmd/podman/common_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cmd/podman/common_test.go (limited to 'cmd/podman/common_test.go') diff --git a/cmd/podman/common_test.go b/cmd/podman/common_test.go new file mode 100644 index 000000000..a24173003 --- /dev/null +++ b/cmd/podman/common_test.go @@ -0,0 +1,15 @@ +package main + +import ( + "os/user" + "testing" +) + +func skipTestIfNotRoot(t *testing.T) { + u, err := user.Current() + if err != nil { + t.Skip("Could not determine user. Running without root may cause tests to fail") + } else if u.Uid != "0" { + t.Skip("tests will fail unless run as root") + } +} -- cgit v1.2.3-54-g00ecf