(t *testing.T)
| 306 | } |
| 307 | |
| 308 | func TestUpdateConfig(t *testing.T) { |
| 309 | // Save and restore the default config path |
| 310 | origPath := DefaultConfigPath |
| 311 | defer func() { DefaultConfigPath = origPath }() |
| 312 | |
| 313 | dir := testutil.TempDir(t) |
| 314 | configPath := filepath.Join(dir, ConfigDirName, ConfigFileName) |
| 315 | DefaultConfigPath = configPath |
| 316 | |
| 317 | conf := &MainConfig{} |
| 318 | conf.Main.Ports = []string{"22"} |
| 319 | conf.Main.Users = []string{"testuser"} |
| 320 | conf.Main.Passwords = []string{"testpass"} |
| 321 | conf.Main.Keys = []string{} |
| 322 | |
| 323 | err := UpdateConfig(conf) |
| 324 | assert.NoError(t, err) |
| 325 | assert.FileExists(t, configPath) |
| 326 | } |
| 327 | |
| 328 | |
| 329 | func TestServerListConfig_String(t *testing.T) { |
nothing calls this directly
no test coverage detected