summaryrefslogtreecommitdiff
path: root/cmd/podman/common_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2019-04-05 19:49:36 -0500
committerbaude <bbaude@redhat.com>2019-04-05 20:09:45 -0500
commit23602de816b9ee3e92a8cbac295e955ba43fa283 (patch)
tree8ae6789a7e7e5e52de2270bb3854f01dc55b9949 /cmd/podman/common_test.go
parentbc320be00bc584bd88525266d23a9d5edb9d44f8 (diff)
downloadpodman-23602de816b9ee3e92a8cbac295e955ba43fa283.tar.gz
podman-23602de816b9ee3e92a8cbac295e955ba43fa283.tar.bz2
podman-23602de816b9ee3e92a8cbac295e955ba43fa283.zip
Revert "Switch to golangci-lint"
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/common_test.go')
-rw-r--r--cmd/podman/common_test.go15
1 files changed, 15 insertions, 0 deletions
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")
+ }
+}