From bdcc7ac2fd9b56c17d9d31db3109c55e426d2752 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Tue, 27 Apr 2021 13:58:06 -0700 Subject: [PATCH] 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 --- staging/src/k8s.io/mount-utils/mount_helper_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/staging/src/k8s.io/mount-utils/mount_helper_test.go b/staging/src/k8s.io/mount-utils/mount_helper_test.go index 91be5cf956a..34137ca6ac9 100644 --- a/staging/src/k8s.io/mount-utils/mount_helper_test.go +++ b/staging/src/k8s.io/mount-utils/mount_helper_test.go @@ -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)