2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-08-31 08:11:28 +00:00
|
|
|
package acl
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/nomad/e2e/e2eutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestACL(t *testing.T) {
|
|
|
|
|
2022-09-02 06:56:00 +00:00
|
|
|
// Wait until we have a usable cluster before running the tests. While the
|
|
|
|
// test does not run client workload, some do perform listings of nodes. It
|
|
|
|
// is therefore better to wait until we have a node, so these tests can
|
|
|
|
// check for a non-empty node list response object.
|
2022-08-31 08:11:28 +00:00
|
|
|
nomadClient := e2eutil.NomadClient(t)
|
|
|
|
e2eutil.WaitForLeader(t, nomadClient)
|
2022-09-02 06:56:00 +00:00
|
|
|
e2eutil.WaitForNodesReady(t, nomadClient, 1)
|
2022-08-31 08:11:28 +00:00
|
|
|
|
|
|
|
// Run our test cases.
|
|
|
|
t.Run("TestACL_Role", testACLRole)
|
2022-09-01 07:36:09 +00:00
|
|
|
t.Run("TestACL_TokenExpiration", testACLTokenExpiration)
|
2022-09-02 06:56:00 +00:00
|
|
|
t.Run("TestACL_TokenRolePolicyAssignment", testACLTokenRolePolicyAssignment)
|
2022-08-31 08:11:28 +00:00
|
|
|
}
|