Skip to content

Commit c5a22b5

Browse files
authored
[26.02.1]: Fix for ONTAP SAN import bypassing fstype mismatch detection
1 parent cdee58f commit c5a22b5

5 files changed

Lines changed: 150 additions & 9 deletions

File tree

storage_drivers/ontap/ontap_asa_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ func TestPublishASA(t *testing.T) {
15311531
mockAPI.EXPECT().VolumeInfo(ctx, volConfig.InternalName).Return(flexVol, nil).Times(1)
15321532
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Return("nodeName", nil).Times(1)
15331533
mockAPI.EXPECT().IscsiInterfaceGet(ctx, driver.Config.SVM).Return([]string{"iscsiInterfaces"}, nil).Times(1)
1534+
mockAPI.EXPECT().LunGetFSType(ctx, volConfig.InternalName).Return("xfs", nil).Times(1)
15341535
mockAPI.EXPECT().LunGetByName(ctx, volConfig.InternalName).Return(lun, nil).Times(1)
15351536
mockAPI.EXPECT().EnsureLunMapped(ctx, driver.Config.IgroupName, volConfig.InternalName).Return(1123, nil).Times(1)
15361537
},
@@ -1551,6 +1552,7 @@ func TestPublishASA(t *testing.T) {
15511552
}).Times(1)
15521553
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Return("nodeName", nil).Times(1)
15531554
mockAPI.EXPECT().IscsiInterfaceGet(ctx, driver.Config.SVM).Return([]string{"iscsiInterfaces"}, nil).Times(1)
1555+
mockAPI.EXPECT().LunGetFSType(ctx, volConfig.InternalName).Return("xfs", nil).Times(1)
15541556
mockAPI.EXPECT().LunGetByName(ctx, volConfig.InternalName).Return(lun, nil).Times(1)
15551557
mockAPI.EXPECT().EnsureLunMapped(ctx, getNodeSpecificIgroupName(publishInfo.HostName, publishInfo.TridentUUID), volConfig.InternalName).Return(1123, nil).Times(1)
15561558
},
@@ -1594,6 +1596,7 @@ func TestPublishASA(t *testing.T) {
15941596
mockAPI.EXPECT().VolumeInfo(ctx, volConfig.InternalName).Return(flexVol, nil).Times(1)
15951597
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Return("nodeName", nil).Times(1)
15961598
mockAPI.EXPECT().IscsiInterfaceGet(ctx, driver.Config.SVM).Return([]string{"iscsiInterfaces"}, nil).Times(1)
1599+
mockAPI.EXPECT().LunGetFSType(ctx, volConfig.InternalName).Return("xfs", nil).Times(1)
15971600
mockAPI.EXPECT().LunGetByName(ctx, volConfig.InternalName).Return(nil, errors.New("error")).Times(1)
15981601
},
15991602
verify: func(t *testing.T, err error) {
@@ -1615,6 +1618,7 @@ func TestPublishASA(t *testing.T) {
16151618
mockAPI.EXPECT().VolumeInfo(ctx, volConfig.InternalName).Return(flexVol, nil).Times(1)
16161619
mockAPI.EXPECT().FcpNodeGetNameRequest(ctx).Return("10:00:00:00:00:00:00:01", nil).Times(1)
16171620
mockAPI.EXPECT().FcpInterfaceGet(ctx, driver.Config.SVM).Return([]string{"10:00:00:00:00:00:00:01"}, nil).Times(1)
1621+
mockAPI.EXPECT().LunGetFSType(ctx, volConfig.InternalName).Return("xfs", nil).Times(1)
16181622
mockAPI.EXPECT().LunGetByName(ctx, volConfig.InternalName).Return(lun, nil).Times(1)
16191623
mockAPI.EXPECT().EnsureIgroupAdded(ctx, driver.Config.IgroupName, "10:00:00:00:00:00:00:01").Return(nil).AnyTimes()
16201624
mockAPI.EXPECT().EnsureLunMapped(ctx, driver.Config.IgroupName, volConfig.InternalName).Return(1123, nil).AnyTimes()
@@ -1685,6 +1689,7 @@ func TestPublishASA(t *testing.T) {
16851689
mockAPI.EXPECT().VolumeInfo(ctx, volConfig.InternalName).Return(flexVol, nil).Times(1)
16861690
mockAPI.EXPECT().FcpNodeGetNameRequest(ctx).Return("10:00:00:00:00:00:00:01", nil).Times(1)
16871691
mockAPI.EXPECT().FcpInterfaceGet(ctx, driver.Config.SVM).Return([]string{"10:00:00:00:00:00:00:01"}, nil).Times(1)
1692+
mockAPI.EXPECT().LunGetFSType(ctx, volConfig.InternalName).Return("xfs", nil).Times(1)
16881693
mockAPI.EXPECT().LunGetByName(ctx, volConfig.InternalName).Return(lun, nil).Times(1)
16891694
mockAPI.EXPECT().EnsureLunMapped(ctx, driver.Config.IgroupName, volConfig.InternalName).Return(1123, nil).AnyTimes()
16901695
},

storage_drivers/ontap/ontap_common.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,20 +1108,25 @@ func PublishLUN(
11081108
}
11091109
}
11101110

1111-
// Resolve fstype: prefer volume config (orchestrator), then LUN attribute, then driver default.
1111+
// Prefer the LUN attribute fstype (authoritative, records what is on disk) over volConfig
1112+
// to catch import mismatches. Fall back to volConfig, then driver default if absent.
11121113
fstype := volConfig.FileSystem
1113-
if fstype == "" {
1114-
fstype, err = clientAPI.LunGetFSType(ctx, lunPath)
1115-
if err != nil || fstype == "" {
1116-
if err != nil {
1117-
Logc(ctx).WithError(err).Error("failed to get fstype for LUN")
1118-
}
1114+
lunFstype, lunErr := clientAPI.LunGetFSType(ctx, lunPath)
1115+
if lunErr != nil || lunFstype == "" {
1116+
if lunErr != nil {
1117+
Logc(ctx).WithError(lunErr).Error("failed to get fstype for LUN")
1118+
}
1119+
if fstype == "" {
11191120
Logc(ctx).WithFields(LogFields{
11201121
"LUN": lunPath,
11211122
"fstype": fstype,
11221123
}).Error("LUN attribute fstype not found, using default.")
11231124
fstype = drivers.DefaultFileSystemType
11241125
}
1126+
// else: keep volConfig value ("raw", "ext4", "xfs", etc.) — LUN has no attribute
1127+
} else {
1128+
// LUN attribute is present; it takes precedence over volConfig.
1129+
fstype = lunFstype
11251130
}
11261131

11271132
// Get the format options

storage_drivers/ontap/ontap_common_test.go

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"github.com/netapp/trident/storage_drivers/ontap/api/rest/client/svm"
3939
"github.com/netapp/trident/storage_drivers/ontap/api/rest/models"
4040
"github.com/netapp/trident/utils/errors"
41+
"github.com/netapp/trident/utils/filesystem"
4142
tridentmodels "github.com/netapp/trident/utils/models"
4243
)
4344

@@ -6762,7 +6763,8 @@ func TestPublishLun(t *testing.T) {
67626763
assert.NoError(t, err)
67636764
assert.Equal(t, tempFormatOptions, publishInfo.FormatOptions)
67646765

6765-
// Test 11 - volume FileSystem (volConfig) is "xfs", LunGetFSType should NOT be called
6766+
// Test 11 - volConfig is "xfs" and LUN attribute also returns "xfs" (normal Trident-created volume).
6767+
// LunGetFSType is now always called; the LUN attribute matches volConfig so the result is unchanged.
67666768
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
67676769
publishInfo = &tridentmodels.VolumePublishInfo{
67686770
BackendUUID: "fakeBackendUUID",
@@ -6772,6 +6774,7 @@ func TestPublishLun(t *testing.T) {
67726774
HostIQN: []string{"host_iqn"},
67736775
}
67746776
config.FileSystemType = ""
6777+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("xfs", nil)
67756778
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("formatOptions", nil)
67766779
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
67776780
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
@@ -6786,7 +6789,8 @@ func TestPublishLun(t *testing.T) {
67866789
assert.Equal(t, "xfs", publishInfo.FilesystemType)
67876790
assert.Contains(t, publishInfo.MountOptions, "nouuid")
67886791

6789-
// Test 11b - FileSystem and FormatOptions from vol (as after Create); no LunGetFSType or LunGetAttribute
6792+
// Test 11b - volConfig has both FileSystem and FormatOptions (as set after Create); LunGetFSType is
6793+
// called (always) and returns matching "xfs". LunGetAttribute is skipped because FormatOptions is set.
67906794
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
67916795
publishInfo = &tridentmodels.VolumePublishInfo{
67926796
BackendUUID: "fakeBackendUUID",
@@ -6796,6 +6800,7 @@ func TestPublishLun(t *testing.T) {
67966800
HostIQN: []string{"host_iqn"},
67976801
}
67986802
volFmtOpts := "-b 4096 -T stride=256"
6803+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("xfs", nil)
67996804
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
68006805
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
68016806
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
@@ -6854,6 +6859,125 @@ func TestPublishLun(t *testing.T) {
68546859

68556860
assert.NoError(t, err)
68566861
assert.Equal(t, drivers.DefaultFileSystemType, publishInfo.FilesystemType)
6862+
6863+
// Test 14 - volConfig "raw", LUN attribute returns "ext4": LUN attribute wins.
6864+
// Surfaces the real on-disk fstype so the node-side mismatch guard can fire.
6865+
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
6866+
publishInfo = &tridentmodels.VolumePublishInfo{
6867+
BackendUUID: "fakeBackendUUID",
6868+
Localhost: false,
6869+
Unmanaged: true,
6870+
Nodes: nodeList,
6871+
HostIQN: []string{"host_iqn"},
6872+
}
6873+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("ext4", nil)
6874+
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("", nil)
6875+
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
6876+
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
6877+
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
6878+
mockAPI.EXPECT().LunMapGetReportingNodes(ctx, igroupName, lunPath).Return([]string{"Node1"}, nil)
6879+
mockAPI.EXPECT().GetSLMDataLifs(ctx, ips, []string{"Node1"}).Return([]string{}, nil)
6880+
6881+
err = PublishLUN(ctx, mockAPI, config, ips, publishInfo, lunPath, igroupName, iSCSINodeName,
6882+
publishVolCfg(filesystem.Raw, ""))
6883+
6884+
assert.NoError(t, err)
6885+
assert.Equal(t, "ext4", publishInfo.FilesystemType)
6886+
6887+
// Test 15 - volConfig "xfs", LUN attribute returns "ext4": LUN attribute wins (fstype mismatch on import).
6888+
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
6889+
publishInfo = &tridentmodels.VolumePublishInfo{
6890+
BackendUUID: "fakeBackendUUID",
6891+
Localhost: false,
6892+
Unmanaged: true,
6893+
Nodes: nodeList,
6894+
HostIQN: []string{"host_iqn"},
6895+
}
6896+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("ext4", nil)
6897+
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("", nil)
6898+
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
6899+
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
6900+
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
6901+
mockAPI.EXPECT().LunMapGetReportingNodes(ctx, igroupName, lunPath).Return([]string{"Node1"}, nil)
6902+
mockAPI.EXPECT().GetSLMDataLifs(ctx, ips, []string{"Node1"}).Return([]string{}, nil)
6903+
6904+
err = PublishLUN(ctx, mockAPI, config, ips, publishInfo, lunPath, igroupName, iSCSINodeName,
6905+
publishVolCfg("xfs", ""))
6906+
6907+
assert.NoError(t, err)
6908+
assert.Equal(t, "ext4", publishInfo.FilesystemType)
6909+
6910+
// Test 16 - volConfig "raw", LUN has no attribute (externally-created LUN).
6911+
// LunGetFSType returns empty: fall back to volConfig "raw", preserving raw block intent.
6912+
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
6913+
publishInfo = &tridentmodels.VolumePublishInfo{
6914+
BackendUUID: "fakeBackendUUID",
6915+
Localhost: false,
6916+
Unmanaged: true,
6917+
Nodes: nodeList,
6918+
HostIQN: []string{"host_iqn"},
6919+
}
6920+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("", nil)
6921+
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("", nil)
6922+
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
6923+
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
6924+
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
6925+
mockAPI.EXPECT().LunMapGetReportingNodes(ctx, igroupName, lunPath).Return([]string{"Node1"}, nil)
6926+
mockAPI.EXPECT().GetSLMDataLifs(ctx, ips, []string{"Node1"}).Return([]string{}, nil)
6927+
6928+
err = PublishLUN(ctx, mockAPI, config, ips, publishInfo, lunPath, igroupName, iSCSINodeName,
6929+
publishVolCfg(filesystem.Raw, ""))
6930+
6931+
assert.NoError(t, err)
6932+
assert.Equal(t, filesystem.Raw, publishInfo.FilesystemType)
6933+
6934+
// Test 17 - volConfig "raw", LunGetFSType returns error (externally-created LUN, API failure).
6935+
// Fall back to volConfig "raw", preserving raw block intent.
6936+
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
6937+
publishInfo = &tridentmodels.VolumePublishInfo{
6938+
BackendUUID: "fakeBackendUUID",
6939+
Localhost: false,
6940+
Unmanaged: true,
6941+
Nodes: nodeList,
6942+
HostIQN: []string{"host_iqn"},
6943+
}
6944+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("", errors.New("LunGetFSType returned error"))
6945+
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("", nil)
6946+
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
6947+
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
6948+
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
6949+
mockAPI.EXPECT().LunMapGetReportingNodes(ctx, igroupName, lunPath).Return([]string{"Node1"}, nil)
6950+
mockAPI.EXPECT().GetSLMDataLifs(ctx, ips, []string{"Node1"}).Return([]string{}, nil)
6951+
6952+
err = PublishLUN(ctx, mockAPI, config, ips, publishInfo, lunPath, igroupName, iSCSINodeName,
6953+
publishVolCfg(filesystem.Raw, ""))
6954+
6955+
assert.NoError(t, err)
6956+
assert.Equal(t, filesystem.Raw, publishInfo.FilesystemType)
6957+
6958+
// Test 18 - volConfig "ext4", LUN has no attribute (externally-created LUN).
6959+
// LunGetFSType returns empty: fall back to volConfig "ext4".
6960+
mockAPI = mockapi.NewMockOntapAPI(mockCtrl)
6961+
publishInfo = &tridentmodels.VolumePublishInfo{
6962+
BackendUUID: "fakeBackendUUID",
6963+
Localhost: false,
6964+
Unmanaged: true,
6965+
Nodes: nodeList,
6966+
HostIQN: []string{"host_iqn"},
6967+
}
6968+
mockAPI.EXPECT().LunGetFSType(ctx, lunPath).Return("", nil)
6969+
mockAPI.EXPECT().LunGetAttribute(ctx, lunPath, "formatOptions").Return("", nil)
6970+
mockAPI.EXPECT().LunGetByName(ctx, lunPath).Return(dummyLun, nil)
6971+
mockAPI.EXPECT().EnsureIgroupAdded(ctx, igroupName, publishInfo.HostIQN[0])
6972+
mockAPI.EXPECT().EnsureLunMapped(ctx, igroupName, lunPath).Return(1111, nil)
6973+
mockAPI.EXPECT().LunMapGetReportingNodes(ctx, igroupName, lunPath).Return([]string{"Node1"}, nil)
6974+
mockAPI.EXPECT().GetSLMDataLifs(ctx, ips, []string{"Node1"}).Return([]string{}, nil)
6975+
6976+
err = PublishLUN(ctx, mockAPI, config, ips, publishInfo, lunPath, igroupName, iSCSINodeName,
6977+
publishVolCfg("ext4", ""))
6978+
6979+
assert.NoError(t, err)
6980+
assert.Equal(t, "ext4", publishInfo.FilesystemType)
68576981
}
68586982

68596983
func TestValidateSANDriver(t *testing.T) {

storage_drivers/ontap/ontap_san_economy_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,7 @@ func TestOntapSanEconomyVolumePublish(t *testing.T) {
26272627
mockAPI.EXPECT().IgroupCreate(ctx, gomock.Any(), "iscsi", "linux").Return(nil)
26282628
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
26292629
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
2630+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/volumeName/lunName").Return("xfs", nil)
26302631
mockAPI.EXPECT().LunGetByName(ctx, "/vol/volumeName/lunName").Return(dummyLun, nil)
26312632
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
26322633
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)
@@ -2675,6 +2676,7 @@ func TestOntapSanEconomyVolumePublish_InternalID(t *testing.T) {
26752676
mockAPI.EXPECT().IgroupCreate(ctx, gomock.Any(), "iscsi", "linux").Return(nil)
26762677
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
26772678
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
2679+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/volumeName/lunName").Return("xfs", nil)
26782680
mockAPI.EXPECT().LunGetByName(ctx, "/vol/volumeName/lunName").Return(dummyLun, nil)
26792681
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
26802682
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)
@@ -2717,6 +2719,7 @@ func TestOntapSanEconomyVolumePublishSLMError(t *testing.T) {
27172719
gomock.Any()).Times(1).Return(api.Luns{api.Lun{Size: "1g", Name: "lunName", VolumeName: "volumeName"}}, nil)
27182720
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
27192721
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
2722+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/volumeName/lunName").Return("xfs", nil)
27202723
mockAPI.EXPECT().LunGetByName(ctx, "/vol/volumeName/lunName").Return(dummyLun, nil)
27212724
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
27222725
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)

storage_drivers/ontap/ontap_san_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ func TestOntapSanVolumePublishManaged(t *testing.T) {
704704
mockAPI.EXPECT().VolumeInfo(ctx, gomock.Any()).Times(1).Return(&api.Volume{AccessType: VolTypeRW}, nil)
705705
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
706706
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
707+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/lunName/lun0").Return("xfs", nil)
707708
mockAPI.EXPECT().LunGetByName(ctx, "/vol/lunName/lun0").Return(dummyLun, nil)
708709
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
709710
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)
@@ -750,6 +751,7 @@ func TestOntapSanVolumePublishUnmanaged(t *testing.T) {
750751
mockAPI.EXPECT().VolumeInfo(ctx, gomock.Any()).Times(1).Return(&api.Volume{AccessType: VolTypeRW}, nil)
751752
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
752753
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
754+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/lunName/lun0").Return("xfs", nil)
753755
mockAPI.EXPECT().LunGetByName(ctx, "/vol/lunName/lun0").Return(dummyLun, nil)
754756
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
755757
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)
@@ -796,6 +798,7 @@ func TestOntapSanVolumePublishSLMError(t *testing.T) {
796798
mockAPI.EXPECT().VolumeInfo(ctx, gomock.Any()).Times(1).Return(&api.Volume{AccessType: VolTypeRW}, nil)
797799
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
798800
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
801+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/lunName/lun0").Return("xfs", nil)
799802
mockAPI.EXPECT().LunGetByName(ctx, "/vol/lunName/lun0").Return(dummyLun, nil)
800803
mockAPI.EXPECT().EnsureIgroupAdded(ctx, gomock.Any(), gomock.Any()).Times(1)
801804
mockAPI.EXPECT().EnsureLunMapped(ctx, gomock.Any(), gomock.Any()).Times(1).Return(1, nil)
@@ -3849,6 +3852,7 @@ func TestOntapSanVolumePublishisFlexvolRW(t *testing.T) {
38493852
mockAPI.EXPECT().IgroupCreate(ctx, gomock.Any(), "iscsi", "linux").Return(nil)
38503853
mockAPI.EXPECT().IscsiNodeGetNameRequest(ctx).Times(1).Return("node1", nil)
38513854
mockAPI.EXPECT().IscsiInterfaceGet(ctx, gomock.Any()).Return([]string{"iscsi_if"}, nil).Times(1)
3855+
mockAPI.EXPECT().LunGetFSType(ctx, "/vol/lunName/lun0").Return("xfs", nil)
38523856
mockAPI.EXPECT().LunGetByName(ctx, "/vol/lunName/lun0").Return(dummyLun, nil)
38533857

38543858
err := driver.Publish(ctx, &volConfig, publishInfo)

0 commit comments

Comments
 (0)