Skip to content

Commit

Permalink
Fix consul test build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Apr 19, 2017
1 parent fb3b30b commit 58430bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions command/agent/consul/int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"io/ioutil"
"log"
"os"
"os/user"
"path/filepath"
"runtime"
"testing"
"time"

"golang.org/x/sys/unix"

consulapi "github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/testutil"
"github.com/hashicorp/nomad/client"
Expand Down Expand Up @@ -38,8 +38,10 @@ func TestConsul_Integration(t *testing.T) {
if testing.Short() {
t.Skip("-short set; skipping")
}
if unix.Geteuid() != 0 {
t.Skip("Must be run as root")
if runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil && u.Uid != "0" {
t.Skip("Must be run as root")
}
}
// Create an embedded Consul server
testconsul := testutil.NewTestServerConfig(t, func(c *testutil.TestServerConfig) {
Expand Down

0 comments on commit 58430bf

Please sign in to comment.