Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: Remove old default value from NewTestAgent() calls #7562

Merged
merged 3 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions agent/acl_endpoint_legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func TestACL_Legacy_Disabled_Response(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), "")
a := NewTestAgent(t, "")
defer a.Shutdown()

tests := []func(resp http.ResponseWriter, req *http.Request) (interface{}, error){
Expand Down Expand Up @@ -71,7 +71,7 @@ func makeTestACL(t *testing.T, srv *HTTPServer) string {

func TestACL_Legacy_Update(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestACL_Legacy_Update(t *testing.T) {

func TestACL_Legacy_UpdateUpsert(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

body := bytes.NewBuffer(nil)
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestACL_Legacy_UpdateUpsert(t *testing.T) {

func TestACL_Legacy_Destroy(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestACL_Legacy_Destroy(t *testing.T) {

func TestACL_Legacy_Clone(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -207,7 +207,7 @@ func TestACL_Legacy_Clone(t *testing.T) {
func TestACL_Legacy_Get(t *testing.T) {
t.Parallel()
t.Run("wrong id", func(t *testing.T) {
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

req, _ := http.NewRequest("GET", "/v1/acl/info/nope", nil)
Expand All @@ -227,7 +227,7 @@ func TestACL_Legacy_Get(t *testing.T) {
})

t.Run("right id", func(t *testing.T) {
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand All @@ -251,7 +251,7 @@ func TestACL_Legacy_Get(t *testing.T) {

func TestACL_Legacy_List(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -280,7 +280,7 @@ func TestACL_Legacy_List(t *testing.T) {

func TestACLReplicationStatus(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

req, _ := http.NewRequest("GET", "/v1/acl/replication", nil)
Expand Down
12 changes: 6 additions & 6 deletions agent/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func TestACL_Disabled_Response(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), "")
a := NewTestAgent(t, "")
defer a.Shutdown()

type testCase struct {
Expand Down Expand Up @@ -79,7 +79,7 @@ func jsonBody(v interface{}) io.Reader {

func TestACL_Bootstrap(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig()+`
a := NewTestAgent(t, TestACLConfig()+`
acl_master_token = ""
`)
defer a.Shutdown()
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestACL_Bootstrap(t *testing.T) {

func TestACL_HTTP(t *testing.T) {
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -1092,7 +1092,7 @@ func TestACL_HTTP(t *testing.T) {
func TestACL_LoginProcedure_HTTP(t *testing.T) {
// This tests AuthMethods, BindingRules, Login, and Logout.
t.Parallel()
a := NewTestAgent(t, t.Name(), TestACLConfig())
a := NewTestAgent(t, TestACLConfig())
defer a.Shutdown()

testrpc.WaitForLeader(t, a.RPC, "dc1")
Expand Down Expand Up @@ -1592,7 +1592,7 @@ func TestACL_LoginProcedure_HTTP(t *testing.T) {

func TestACL_Authorize(t *testing.T) {
t.Parallel()
a1 := NewTestAgent(t, t.Name(), TestACLConfigWithParams(nil))
a1 := NewTestAgent(t, TestACLConfigWithParams(nil))
defer a1.Shutdown()

testrpc.WaitForTestAgent(t, a1.RPC, "dc1", testrpc.WithToken(TestDefaultMasterToken))
Expand Down Expand Up @@ -1628,7 +1628,7 @@ func TestACL_Authorize(t *testing.T) {
secondaryParams.ReplicationToken = secondaryParams.MasterToken
secondaryParams.EnableTokenReplication = true

a2 := NewTestAgent(t, t.Name(), `datacenter = "dc2" `+TestACLConfigWithParams(secondaryParams))
a2 := NewTestAgent(t, `datacenter = "dc2" `+TestACLConfigWithParams(secondaryParams))
defer a2.Shutdown()

addr := fmt.Sprintf("127.0.0.1:%d", a1.Config.SerfPortWAN)
Expand Down
Loading