5
5
"testing"
6
6
7
7
"github.com/jaypipes/ghw"
8
+ "github.com/jaypipes/ghw/pkg/block"
8
9
"go.uber.org/mock/gomock"
9
10
10
11
"github.com/linode/linode-blockstorage-csi-driver/mocks"
@@ -67,8 +68,9 @@ func TestAttachedVolumeCount(t *testing.T) {
67
68
blkInfo : & ghw.BlockInfo {
68
69
Disks : []* ghw.Disk {
69
70
{
70
- DriveType : DRIVE_TYPE_VIRTUAL ,
71
- IsRemovable : false ,
71
+ DriveType : DRIVE_TYPE_VIRTUAL ,
72
+ StorageController : block .StorageControllerUnknown ,
73
+ IsRemovable : false ,
72
74
Partitions : []* ghw.Partition {
73
75
{
74
76
Name : "vd1p1" ,
@@ -77,6 +79,18 @@ func TestAttachedVolumeCount(t *testing.T) {
77
79
},
78
80
},
79
81
},
82
+ {
83
+ DriveType : DRIVE_TYPE_VIRTUAL ,
84
+ StorageController : block .StorageControllerLoop ,
85
+ IsRemovable : false ,
86
+ Partitions : []* ghw.Partition {
87
+ {
88
+ Name : "loop1" ,
89
+ MountPoint : "/mnt/virtual1" ,
90
+ SizeBytes : 1024 * 1024 * 1024 ,
91
+ },
92
+ },
93
+ },
80
94
},
81
95
},
82
96
},
@@ -86,8 +100,9 @@ func TestAttachedVolumeCount(t *testing.T) {
86
100
blkInfo : & ghw.BlockInfo {
87
101
Disks : []* ghw.Disk {
88
102
{
89
- DriveType : DRIVE_TYPE_VIRTUAL ,
90
- IsRemovable : false ,
103
+ DriveType : DRIVE_TYPE_VIRTUAL ,
104
+ IsRemovable : false ,
105
+ StorageController : block .StorageControllerUnknown ,
91
106
Partitions : []* ghw.Partition {
92
107
{
93
108
Name : "vd1p1" ,
@@ -97,8 +112,9 @@ func TestAttachedVolumeCount(t *testing.T) {
97
112
},
98
113
},
99
114
{
100
- DriveType : DRIVE_TYPE_VIRTUAL ,
101
- IsRemovable : false ,
115
+ DriveType : DRIVE_TYPE_VIRTUAL ,
116
+ IsRemovable : false ,
117
+ StorageController : block .StorageControllerLoop ,
102
118
Partitions : []* ghw.Partition {
103
119
{
104
120
Name : "loop1" ,
@@ -108,8 +124,9 @@ func TestAttachedVolumeCount(t *testing.T) {
108
124
},
109
125
},
110
126
{
111
- DriveType : DRIVE_TYPE_SSD ,
112
- IsRemovable : false ,
127
+ DriveType : DRIVE_TYPE_SSD ,
128
+ IsRemovable : false ,
129
+ StorageController : block .StorageControllerSCSI ,
113
130
Partitions : []* ghw.Partition {
114
131
{
115
132
Name : "nvme0n1" ,
0 commit comments