test: a.config -> a.Config

This commit is contained in:
Frank Schroeder 2017-05-21 20:32:48 +02:00
parent 0be63d7060
commit 0c905a0df8
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
4 changed files with 17 additions and 17 deletions

View File

@ -485,14 +485,14 @@ func TestACLResolution(t *testing.T) {
defer a.Shutdown()
// Check when no token is set
a.config.ACLToken = ""
a.Config.ACLToken = ""
a.srv.parseToken(req, &token)
if token != "" {
t.Fatalf("bad: %s", token)
}
// Check when ACLToken set
a.config.ACLToken = "agent"
a.Config.ACLToken = "agent"
a.srv.parseToken(req, &token)
if token != "agent" {
t.Fatalf("bad: %s", token)

View File

@ -430,7 +430,7 @@ func TestOperator_ServerHealth(t *testing.T) {
}
if len(out.Servers) != 1 ||
!out.Servers[0].Healthy ||
out.Servers[0].Name != a.config.NodeName ||
out.Servers[0].Name != a.Config.NodeName ||
out.Servers[0].SerfStatus != "alive" ||
out.FailureTolerance != 0 {
r.Fatalf("bad: %v", out)
@ -464,7 +464,7 @@ func TestOperator_ServerHealth_Unhealthy(t *testing.T) {
}
if len(out.Servers) != 1 ||
out.Healthy ||
out.Servers[0].Name != a.config.NodeName {
out.Servers[0].Name != a.Config.NodeName {
r.Fatalf("bad: %#v", out.Servers)
}
})

View File

@ -289,8 +289,8 @@ func TestPreparedQuery_Execute(t *testing.T) {
Node: "my-node",
},
Agent: structs.QuerySource{
Datacenter: a.config.Datacenter,
Node: a.config.NodeName,
Datacenter: a.Config.Datacenter,
Node: a.Config.NodeName,
},
QueryOptions: structs.QueryOptions{
Token: "my-token",
@ -340,8 +340,8 @@ func TestPreparedQuery_Execute(t *testing.T) {
t.Fatalf("expect node to be empty, got %q", args.Source.Node)
}
expect := structs.QuerySource{
Datacenter: a.config.Datacenter,
Node: a.config.NodeName,
Datacenter: a.Config.Datacenter,
Node: a.Config.NodeName,
}
if !reflect.DeepEqual(args.Agent, expect) {
t.Fatalf("expect: %#v\nactual: %#v", expect, args.Agent)
@ -493,8 +493,8 @@ func TestPreparedQuery_Explain(t *testing.T) {
Node: "my-node",
},
Agent: structs.QuerySource{
Datacenter: a.config.Datacenter,
Node: a.config.NodeName,
Datacenter: a.Config.Datacenter,
Node: a.Config.NodeName,
},
QueryOptions: structs.QueryOptions{
Token: "my-token",
@ -808,7 +808,7 @@ func TestPreparedQuery_Integration(t *testing.T) {
{
args := &structs.RegisterRequest{
Datacenter: "dc1",
Node: a.config.NodeName,
Node: a.Config.NodeName,
Address: "127.0.0.1",
Service: &structs.NodeService{
Service: "my-service",

View File

@ -22,11 +22,11 @@ func TestSessionCreate(t *testing.T) {
// Create a health check
args := &structs.RegisterRequest{
Datacenter: "dc1",
Node: a.config.NodeName,
Node: a.Config.NodeName,
Address: "127.0.0.1",
Check: &structs.HealthCheck{
CheckID: "consul",
Node: a.config.NodeName,
Node: a.Config.NodeName,
Name: "consul",
ServiceID: "consul",
Status: api.HealthPassing,
@ -42,7 +42,7 @@ func TestSessionCreate(t *testing.T) {
enc := json.NewEncoder(body)
raw := map[string]interface{}{
"Name": "my-cool-session",
"Node": a.config.NodeName,
"Node": a.Config.NodeName,
"Checks": []types.CheckID{consul.SerfCheckID, "consul"},
"LockDelay": "20s",
}
@ -68,11 +68,11 @@ func TestSessionCreateDelete(t *testing.T) {
// Create a health check
args := &structs.RegisterRequest{
Datacenter: "dc1",
Node: a.config.NodeName,
Node: a.Config.NodeName,
Address: "127.0.0.1",
Check: &structs.HealthCheck{
CheckID: "consul",
Node: a.config.NodeName,
Node: a.Config.NodeName,
Name: "consul",
ServiceID: "consul",
Status: api.HealthPassing,
@ -88,7 +88,7 @@ func TestSessionCreateDelete(t *testing.T) {
enc := json.NewEncoder(body)
raw := map[string]interface{}{
"Name": "my-cool-session",
"Node": a.config.NodeName,
"Node": a.Config.NodeName,
"Checks": []types.CheckID{consul.SerfCheckID, "consul"},
"LockDelay": "20s",
"Behavior": structs.SessionKeysDelete,