mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 08:56:43 +00:00
Adds a test to make sure we get the same ID on the second run.
This commit is contained in:
parent
bd605e330c
commit
e719ff8ef1
@ -322,6 +322,15 @@ func TestAgent_NodeID(t *testing.T) {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
// Running again should get the same ID (persisted in the file).
|
||||
c.NodeID = ""
|
||||
if err := agent.setupNodeID(c); err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if newID := agent.consulConfig().NodeID; id != newID {
|
||||
t.Fatalf("bad: %q vs %q", id, newID)
|
||||
}
|
||||
|
||||
// Set an invalid ID via config.
|
||||
c.NodeID = types.NodeID("nope")
|
||||
err := agent.setupNodeID(c)
|
||||
|
Loading…
x
Reference in New Issue
Block a user