lib/model: Add option for overwriting names on connect (fixes #2912)

This commit is contained in:
Audrius Butkevicius
2016-04-09 07:43:47 +00:00
committed by Jakob Borg
parent 2eb8a9ef56
commit 4389bb037d
5 changed files with 18 additions and 1 deletions

View File

@@ -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) {