(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func 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 | |
| 78 | func TestCheckMountReady(t *testing.T) { |
| 79 | Convey("TestCheckMountReady", t, func() { |
nothing calls this directly
no test coverage detected