mirror of https://github.com/status-im/consul.git
test: a.config -> a.Config
This commit is contained in:
parent
0be63d7060
commit
0c905a0df8
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue