MCPcopy
hub / github.com/NVIDIA/aistore / TestConfigFSPaths

Function TestConfigFSPaths

cmn/tests/config_test.go:32–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func 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
57func thisFileDir(t *testing.T) string {
58 _, filename, _, ok := runtime.Caller(1)

Callers

nothing calls this directly

Calls 10

LoadMetaFunction · 0.92
CheckFatalFunction · 0.92
LoadConfigFunction · 0.92
FatalfFunction · 0.92
thisFileDirFunction · 0.85
JoinMethod · 0.80
BeginUpdateMethod · 0.80
CommitUpdateMethod · 0.80
GetMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected