summaryrefslogtreecommitdiff
path: root/cmd/podman/common_test.go
blob: a2417300306bebadb541b1ab8c15a13f4a090b7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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")
	}
}