@@ -21,10 +21,10 @@ import (
21
21
mockcore "github.com/netapp/trident/mocks/mock_core"
22
22
mockControllerAPI "github.com/netapp/trident/mocks/mock_frontend/mock_csi/mock_controller_api"
23
23
mockNodeHelpers "github.com/netapp/trident/mocks/mock_frontend/mock_csi/mock_node_helpers"
24
- mockUtils "github.com/netapp/trident/mocks/mock_utils"
25
24
"github.com/netapp/trident/mocks/mock_utils/mock_devices"
26
25
"github.com/netapp/trident/mocks/mock_utils/mock_iscsi"
27
26
"github.com/netapp/trident/mocks/mock_utils/mock_mount"
27
+ mock_nvme "github.com/netapp/trident/mocks/mock_utils/nvme"
28
28
"github.com/netapp/trident/pkg/collection"
29
29
"github.com/netapp/trident/pkg/convert"
30
30
sa "github.com/netapp/trident/storage_attribute"
@@ -35,6 +35,7 @@ import (
35
35
"github.com/netapp/trident/utils/iscsi"
36
36
"github.com/netapp/trident/utils/models"
37
37
"github.com/netapp/trident/utils/mount"
38
+ "github.com/netapp/trident/utils/nvme"
38
39
"github.com/netapp/trident/utils/osutils"
39
40
)
40
41
@@ -1543,22 +1544,22 @@ func TestUpdateNodePublicationState_SuccessfullyUpdatesNodeAsCleaned(t *testing.
1543
1544
1544
1545
func TestPerformNVMeSelfHealing (t * testing.T ) {
1545
1546
mockCtrl := gomock .NewController (t )
1546
- mockNVMeHandler := mockUtils .NewMockNVMeInterface (mockCtrl )
1547
+ mockNVMeHandler := mock_nvme .NewMockNVMeInterface (mockCtrl )
1547
1548
nodeServer := & Plugin {nvmeHandler : mockNVMeHandler }
1548
1549
1549
1550
// Empty Published sessions case.
1550
1551
nodeServer .performNVMeSelfHealing (ctx )
1551
1552
1552
1553
// Error populating current sessions.
1553
- publishedNVMeSessions .AddNVMeSession (utils .NVMeSubsystem {NQN : "nqn" }, []string {})
1554
+ publishedNVMeSessions .AddNVMeSession (nvme .NVMeSubsystem {NQN : "nqn" }, []string {})
1554
1555
mockNVMeHandler .EXPECT ().PopulateCurrentNVMeSessions (ctx , gomock .Any ()).
1555
1556
Return (errors .New ("failed to populate current sessions" ))
1556
1557
1557
1558
nodeServer .performNVMeSelfHealing (ctx )
1558
1559
1559
1560
// Self-healing process done.
1560
1561
mockNVMeHandler .EXPECT ().PopulateCurrentNVMeSessions (ctx , gomock .Any ()).Return (nil )
1561
- mockNVMeHandler .EXPECT ().InspectNVMeSessions (ctx , gomock .Any (), gomock .Any ()).Return ([]utils .NVMeSubsystem {})
1562
+ mockNVMeHandler .EXPECT ().InspectNVMeSessions (ctx , gomock .Any (), gomock .Any ()).Return ([]nvme .NVMeSubsystem {})
1562
1563
1563
1564
nodeServer .performNVMeSelfHealing (ctx )
1564
1565
// Cleanup of global objects.
@@ -1567,10 +1568,10 @@ func TestPerformNVMeSelfHealing(t *testing.T) {
1567
1568
1568
1569
func TestFixNVMeSessions (t * testing.T ) {
1569
1570
mockCtrl := gomock .NewController (t )
1570
- mockNVMeHandler := mockUtils .NewMockNVMeInterface (mockCtrl )
1571
+ mockNVMeHandler := mock_nvme .NewMockNVMeInterface (mockCtrl )
1571
1572
nodeServer := & Plugin {nvmeHandler : mockNVMeHandler }
1572
- subsystem1 := utils .NVMeSubsystem {NQN : "nqn1" }
1573
- subsystems := []utils .NVMeSubsystem {subsystem1 }
1573
+ subsystem1 := nvme .NVMeSubsystem {NQN : "nqn1" }
1574
+ subsystems := []nvme .NVMeSubsystem {subsystem1 }
1574
1575
1575
1576
// Subsystem not present in published sessions case.
1576
1577
nodeServer .fixNVMeSessions (ctx , time .UnixMicro (0 ), subsystems )
@@ -1751,7 +1752,7 @@ func TestNodeRegisterWithController_Success(t *testing.T) {
1751
1752
mockCtrl := gomock .NewController (t )
1752
1753
mockClient := mockControllerAPI .NewMockTridentController (mockCtrl )
1753
1754
mockOrchestrator := mockcore .NewMockOrchestrator (mockCtrl )
1754
- mockNVMeHandler := mockUtils .NewMockNVMeInterface (mockCtrl )
1755
+ mockNVMeHandler := mock_nvme .NewMockNVMeInterface (mockCtrl )
1755
1756
1756
1757
iscsiClient , _ := iscsi .New ()
1757
1758
// Create a node server plugin
@@ -1796,7 +1797,7 @@ func TestNodeRegisterWithController_TopologyLabels(t *testing.T) {
1796
1797
mockCtrl := gomock .NewController (t )
1797
1798
mockClient := mockControllerAPI .NewMockTridentController (mockCtrl )
1798
1799
mockOrchestrator := mockcore .NewMockOrchestrator (mockCtrl )
1799
- mockNVMeHandler := mockUtils .NewMockNVMeInterface (mockCtrl )
1800
+ mockNVMeHandler := mock_nvme .NewMockNVMeInterface (mockCtrl )
1800
1801
iscsiClient , _ := iscsi .New ()
1801
1802
1802
1803
// Create a node server plugin
@@ -1882,7 +1883,7 @@ func TestNodeRegisterWithController_Failure(t *testing.T) {
1882
1883
mockCtrl := gomock .NewController (t )
1883
1884
mockClient := mockControllerAPI .NewMockTridentController (mockCtrl )
1884
1885
mockOrchestrator := mockcore .NewMockOrchestrator (mockCtrl )
1885
- mockNVMeHandler := mockUtils .NewMockNVMeInterface (mockCtrl )
1886
+ mockNVMeHandler := mock_nvme .NewMockNVMeInterface (mockCtrl )
1886
1887
iscsiClient , _ := iscsi .New ()
1887
1888
1888
1889
// Create a node server plugin
0 commit comments