Add unit test for clean up mountpoint logic if path does not exist

Add the unit test case for path does not exist when cleanup mountpoint

Change-Id: I4aa3599e62bde59513764421a146c502421014ed
This commit is contained in:
Jing Xu 2021-04-27 13:58:06 -07:00
parent fbc93bd34c
commit bdcc7ac2fd

View File

@ -53,6 +53,12 @@ func TestDoCleanupMountPoint(t *testing.T) {
return MountPoint{Device: "/dev/sdb", Path: path}, nil, nil
},
},
"path-not-exist": {
prepare: func(base string) (MountPoint, error, error) {
path := filepath.Join(base, testMount)
return MountPoint{Device: "/dev/sdb", Path: path}, nil, nil
},
},
"mount-corrupted": {
prepare: func(base string) (MountPoint, error, error) {
path := filepath.Join(base, testMount)