MCPcopy
hub / github.com/fluid-cloudnative/fluid / TestMountRootWithoutEnvSet

Function TestMountRootWithoutEnvSet

pkg/utils/mount_test.go:53–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestMountRootWithoutEnvSet(t *testing.T) {
54 var testCases = []struct {
55 input string
56 expected string
57 }{
58 {"/var/lib/mymount", ""},
59 }
60 for _, tc := range testCases {
61 _ = os.Unsetenv(MountRoot)
62 mountRoot, err := GetMountRoot()
63 if err == nil {
64 t.Errorf("Expected error happened, but no error")
65 }
66
67 if err.Error() != "invalid mount root path '': the mount root path is empty" {
68 t.Errorf("Get unexpected error %v", err)
69 }
70
71 if tc.expected != mountRoot {
72 t.Errorf("Unexpected result %s", tc.expected)
73 }
74
75 }
76}
77
78func TestCheckMountReady(t *testing.T) {
79 Convey("TestCheckMountReady", t, func() {

Callers

nothing calls this directly

Calls 2

GetMountRootFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected