test: skip chown test if nonroot (#14738)

CI always runs this as root, so it worked there and always scared me
when I ran it locally.
This commit is contained in:
Michael Schurter
2022-09-28 14:45:38 -07:00
committed by GitHub
parent 58e76c64d5
commit 0eb711925e

View File

@@ -25,6 +25,7 @@ import (
"github.com/hashicorp/nomad/client/allocdir"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/client/taskenv"
clienttestutil "github.com/hashicorp/nomad/client/testutil"
"github.com/hashicorp/nomad/helper/pointer"
"github.com/hashicorp/nomad/helper/testlog"
"github.com/hashicorp/nomad/helper/uuid"
@@ -184,7 +185,7 @@ func newTestHarness(t *testing.T, templates []*structs.Template, consul, vault b
if consul {
var err error
harness.consul, err = ctestutil.NewTestServerConfigT(t, func(c *ctestutil.TestServerConfig) {
c.Peering = nil // fix for older versions of Consul (<1.13.0) that don't support peering
c.Peering = nil // fix for older versions of Consul (<1.13.0) that don't support peering
})
if err != nil {
t.Fatalf("error starting test Consul server: %v", err)
@@ -513,6 +514,7 @@ func TestTaskTemplateManager_Unblock_Static(t *testing.T) {
}
func TestTaskTemplateManager_Permissions(t *testing.T) {
clienttestutil.RequireRoot(t)
ci.Parallel(t)
// Make a template that will render immediately
content := "hello, world!"