mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
30 lines
580 B
Go
30 lines
580 B
Go
package testutil
|
|
|
|
import (
|
|
"runtime"
|
|
"syscall"
|
|
"testing"
|
|
)
|
|
|
|
func ExecCompatible(t *testing.T) {
|
|
if runtime.GOOS != "windows" && syscall.Geteuid() != 0 {
|
|
t.Skip("Must be root on non-windows environments to run test")
|
|
}
|
|
}
|
|
|
|
func QemuCompatible(t *testing.T) {
|
|
if runtime.GOOS != "windows" && syscall.Geteuid() != 0 {
|
|
t.Skip("Must be root on non-windows environments to run test")
|
|
}
|
|
}
|
|
|
|
func MountCompatible(t *testing.T) {
|
|
if runtime.GOOS == "windows" {
|
|
t.Skip("Windows does not support mount")
|
|
}
|
|
|
|
if syscall.Geteuid() != 0 {
|
|
t.Skip("Must be root to run test")
|
|
}
|
|
}
|