(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestConfigFSPaths(t *testing.T) { |
| 33 | var ( |
| 34 | oldConfig = cmn.GCO.Get() |
| 35 | confPath = filepath.Join(thisFileDir(t), "configs", "config.json") |
| 36 | localConfPath = filepath.Join(thisFileDir(t), "configs", "configmpaths.json") |
| 37 | ) |
| 38 | defer func() { |
| 39 | cmn.GCO.BeginUpdate() |
| 40 | cmn.GCO.CommitUpdate(oldConfig) |
| 41 | }() |
| 42 | |
| 43 | var localConf cmn.LocalConfig |
| 44 | _, err := jsp.LoadMeta(localConfPath, &localConf) |
| 45 | tassert.CheckFatal(t, err) |
| 46 | newConfig := cmn.Config{} |
| 47 | err = cmn.LoadConfig(confPath, localConfPath, apc.Target, &newConfig) |
| 48 | tassert.CheckFatal(t, err) |
| 49 | |
| 50 | mpaths := localConf.FSP.Paths |
| 51 | tassert.Fatalf(t, len(newConfig.FSP.Paths) == len(mpaths), "mountpath count %v != %v", len(newConfig.FSP.Paths), len(mpaths)) |
| 52 | for p := range mpaths { |
| 53 | tassert.Fatalf(t, newConfig.FSP.Paths.Contains(p), "%q not in config FSP", p) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func thisFileDir(t *testing.T) string { |
| 58 | _, filename, _, ok := runtime.Caller(1) |
nothing calls this directly
no test coverage detected