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

Function TestSearchWithASuffixToAnotherValue

fs/dutils_test.go:54–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestSearchWithASuffixToAnotherValue(t *testing.T) {
55 config := cmn.GCO.BeginUpdate()
56 config.TestFSP.Count = 2
57 cmn.GCO.CommitUpdate(config)
58
59 TestNew(nil)
60 dirs := []string{"/tmp/x/z/abc", "/tmp/x/zabc", "/tmp/x/y/abc", "/tmp/x/yabc"}
61 createDirs(dirs...)
62 defer removeDirs(dirs...)
63
64 oldMPs := setAvailableMountPaths(t, "/tmp/x/y", "/tmp/x/z")
65
66 mpathInfo, err := Path2Mpath("z/abc")
67 tassert.Errorf(t, err != nil && mpathInfo == nil, "Expected a nil mountpath info for fqn %q (%v)", "z/abc", err)
68
69 mpathInfo, err = Path2Mpath("/tmp/../tmp/x/z/abc")
70 tassert.Errorf(t, err == nil && mpathInfo.Path == "/tmp/x/z", "Actual: [%s]. Expected: [%s] (%v)",
71 mpathInfo, "/tmp/x/z", err)
72
73 mpathInfo, err = Path2Mpath("/tmp/../tmp/x/y/abc")
74 tassert.Errorf(t, err == nil && mpathInfo.Path == "/tmp/x/y", "Actual: [%s]. Expected: [%s] (%v)",
75 mpathInfo, "/tmp/x/y", err)
76 setAvailableMountPaths(t, oldMPs...)
77}
78
79func TestSimilarCases(t *testing.T) {
80 TestNew(nil)

Callers

nothing calls this directly

Calls 8

ErrorfFunction · 0.92
TestNewFunction · 0.85
createDirsFunction · 0.85
removeDirsFunction · 0.85
setAvailableMountPathsFunction · 0.85
Path2MpathFunction · 0.85
BeginUpdateMethod · 0.80
CommitUpdateMethod · 0.80

Tested by

no test coverage detected