Migrate config.json from config-dir to backend (#6195)

This PR is the first set of changes to move the config
to the backend, the changes use the existing `config.json`
allows it to be migrated such that we can save it in on
backend disks.

In future releases, we will slowly migrate out of the
current architecture.

Fixes #6182
This commit is contained in:
Harshavardhana
2018-08-14 21:41:47 -07:00
committed by Nitish Tiwari
parent 380524ae27
commit 0e02328c98
46 changed files with 818 additions and 845 deletions

View File

@@ -106,7 +106,7 @@ func TestSaveFailOnDir(t *testing.T) {
}
func TestCheckData(t *testing.T) {
err := checkData(nil)
err := CheckData(nil)
if err == nil {
t.Fatal("Unexpected should fail")
}
@@ -117,7 +117,7 @@ func TestCheckData(t *testing.T) {
Directories []string
}
saveMeBadNoVersion := myStructBadNoVersion{"guest", "nopassword", []string{"Work", "Documents", "Music"}}
err = checkData(&saveMeBadNoVersion)
err = CheckData(&saveMeBadNoVersion)
if err == nil {
t.Fatal("Unexpected should fail if Version is not set")
}
@@ -128,7 +128,7 @@ func TestCheckData(t *testing.T) {
Password string
}
saveMeBadVersionInt := myStructBadVersionInt{1, "guest", "nopassword"}
err = checkData(&saveMeBadVersionInt)
err = CheckData(&saveMeBadVersionInt)
if err == nil {
t.Fatal("Unexpected should fail if Version is integer")
}
@@ -141,7 +141,7 @@ func TestCheckData(t *testing.T) {
}
saveMeGood := myStructGood{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
err = checkData(&saveMeGood)
err = CheckData(&saveMeGood)
if err != nil {
t.Fatal(err)
}