Fix TestPersistConfig

testutil.InitConfig writes sample configs to files,
 and if we just check that these files exist after
 calling PersistConfig function, then don't test anything.

 We have to change config file paths before calling PersistConfig
 and then we can check if these files exist.

Change-Id: Ibaee17a57a86251f7016bb57b2d8bd9976cefac0
This commit is contained in:
Vladimir Kozhukalov 2020-09-15 14:13:47 +03:00
parent 06029bc1bc
commit b76ddc98ac

View File

@ -113,6 +113,9 @@ func TestPersistConfig(t *testing.T) {
conf, cleanup := testutil.InitConfig(t)
defer cleanup(t)
conf.SetLoadedConfigPath(conf.LoadedConfigPath() + ".new")
conf.SetKubeConfigPath(conf.KubeConfigPath() + ".new")
err := conf.PersistConfig(true)
require.NoError(t, err)