@@ -904,6 +904,7 @@ func TestNodePublishVolume(t *testing.T) {
904904 mockMounter .EXPECT ().MakeFile (targetPath ).Return (nil )
905905 mockMounter .EXPECT ().Mount (gomock .Eq (devicePath ), gomock .Eq (targetPath ), gomock .Eq ("" ), gomock .Eq ([]string {"bind" })).Return (nil )
906906 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (true , nil )
907+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
907908
908909 req := & csi.NodePublishVolumeRequest {
909910 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
@@ -950,6 +951,7 @@ func TestNodePublishVolume(t *testing.T) {
950951 mockMounter .EXPECT ().MakeDir (gomock .Eq ("/test" )).Return (nil )
951952 mockMounter .EXPECT ().MakeFile (targetPath ).Return (nil )
952953 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (false , nil )
954+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
953955
954956 req := & csi.NodePublishVolumeRequest {
955957 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
@@ -998,6 +1000,7 @@ func TestNodePublishVolume(t *testing.T) {
9981000 mockMounter .EXPECT ().MakeDir (gomock .Eq ("/test" )).Return (nil )
9991001 mockMounter .EXPECT ().MakeFile (targetPath ).Return (nil )
10001002 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (true , errors .New ("Internal System Error" ))
1003+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
10011004
10021005 req := & csi.NodePublishVolumeRequest {
10031006 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
@@ -1048,6 +1051,7 @@ func TestNodePublishVolume(t *testing.T) {
10481051 mockMounter .EXPECT ().Unmount (gomock .Eq (targetPath )).Return (nil )
10491052 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (true , errors .New ("Internal System Error" ))
10501053 mockMounter .EXPECT ().Mount (gomock .Eq (devicePath ), gomock .Eq (targetPath ), gomock .Any (), gomock .Any ()).Return (nil )
1054+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
10511055
10521056 req := & csi.NodePublishVolumeRequest {
10531057 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
@@ -1095,6 +1099,7 @@ func TestNodePublishVolume(t *testing.T) {
10951099 mockMounter .EXPECT ().MakeFile (targetPath ).Return (nil )
10961100 mockMounter .EXPECT ().Mount (gomock .Eq (devicePathWithPartition ), gomock .Eq (targetPath ), gomock .Eq ("" ), gomock .Eq ([]string {"bind" })).Return (nil )
10971101 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (true , nil )
1102+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
10981103
10991104 req := & csi.NodePublishVolumeRequest {
11001105 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
@@ -1143,6 +1148,7 @@ func TestNodePublishVolume(t *testing.T) {
11431148 mockMounter .EXPECT ().MakeFile (targetPath ).Return (nil )
11441149 mockMounter .EXPECT ().Mount (gomock .Eq (devicePath ), gomock .Eq (targetPath ), gomock .Eq ("" ), gomock .Eq ([]string {"bind" })).Return (nil )
11451150 mockMounter .EXPECT ().IsLikelyNotMountPoint (gomock .Eq (targetPath )).Return (true , nil )
1151+ mockDeviceIdentifier .EXPECT ().Lstat (gomock .Eq (nvmeName )).Return (nil , os .ErrNotExist )
11461152
11471153 req := & csi.NodePublishVolumeRequest {
11481154 PublishContext : map [string ]string {DevicePathKey : "/dev/fake" },
0 commit comments