lib/model: Add option for overwriting names on connect (fixes #2912)
This commit is contained in:
committed by
Jakob Borg
parent
2eb8a9ef56
commit
4389bb037d
@@ -357,6 +357,19 @@ func TestDeviceRename(t *testing.T) {
|
||||
if cfgw.Devices()[device1].Name != "tester" {
|
||||
t.Errorf("Device name not saved in config")
|
||||
}
|
||||
|
||||
m.Close(device1, protocol.ErrTimeout)
|
||||
|
||||
opts := cfg.Options()
|
||||
opts.OverwriteNames = true
|
||||
cfg.SetOptions(opts)
|
||||
|
||||
hello.DeviceName = "tester2"
|
||||
m.AddConnection(conn, hello)
|
||||
|
||||
if cfg.Devices()[device1].Name != "tester2" {
|
||||
t.Errorf("Device name not overwritten")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClusterConfig(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user