mirror of https://github.com/status-im/consul.git
Verify that consul service is registered
This commit is contained in:
parent
5c6596fa8a
commit
0507568a37
|
@ -30,7 +30,7 @@ func TestLeader_RegisterMember(t *testing.T) {
|
|||
// Wait for registration
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
// Should be registered
|
||||
// Client should be registered
|
||||
state := s1.fsm.State()
|
||||
found, _ := state.GetNode(c1.config.NodeName)
|
||||
if !found {
|
||||
|
@ -51,6 +51,18 @@ func TestLeader_RegisterMember(t *testing.T) {
|
|||
if checks[0].Status != structs.HealthPassing {
|
||||
t.Fatalf("bad check: %v", checks[0])
|
||||
}
|
||||
|
||||
// Server should be registered
|
||||
found, _ = state.GetNode(s1.config.NodeName)
|
||||
if !found {
|
||||
t.Fatalf("server not registered")
|
||||
}
|
||||
|
||||
// Service should be registered
|
||||
services := state.NodeServices(s1.config.NodeName)
|
||||
if _, ok := services.Services["consul"]; !ok {
|
||||
t.Fatalf("consul service not registered: %v", services)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLeader_FailedMember(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue