@@ -30,13 +30,13 @@ func TestCreateControlDevices(t *testing.T) {
30
30
logger , _ := testlog .NewNullLogger ()
31
31
32
32
nvidiaDevices := devices .New (
33
- devices .WithDeviceToMajor (map [string ]int {
33
+ devices .WithDeviceToMajor (map [string ]uint32 {
34
34
"nvidia-frontend" : 195 ,
35
35
"nvidia-uvm" : 243 ,
36
36
}),
37
37
)
38
38
nvidia550Devices := devices .New (
39
- devices .WithDeviceToMajor (map [string ]int {
39
+ devices .WithDeviceToMajor (map [string ]uint32 {
40
40
"nvidia" : 195 ,
41
41
"nvidia-uvm" : 243 ,
42
42
}),
@@ -52,8 +52,8 @@ func TestCreateControlDevices(t *testing.T) {
52
52
expectedError error
53
53
expectedCalls []struct {
54
54
S string
55
- N1 int
56
- N2 int
55
+ V1 uint32
56
+ V2 uint32
57
57
}
58
58
}{
59
59
{
@@ -63,8 +63,8 @@ func TestCreateControlDevices(t *testing.T) {
63
63
mknodeError : nil ,
64
64
expectedCalls : []struct {
65
65
S string
66
- N1 int
67
- N2 int
66
+ V1 uint32
67
+ V2 uint32
68
68
}{
69
69
{"/dev/nvidiactl" , 195 , 255 },
70
70
{"/dev/nvidia-modeset" , 195 , 254 },
@@ -79,8 +79,8 @@ func TestCreateControlDevices(t *testing.T) {
79
79
mknodeError : nil ,
80
80
expectedCalls : []struct {
81
81
S string
82
- N1 int
83
- N2 int
82
+ V1 uint32
83
+ V2 uint32
84
84
}{
85
85
{"/dev/nvidiactl" , 195 , 255 },
86
86
{"/dev/nvidia-modeset" , 195 , 254 },
@@ -95,8 +95,8 @@ func TestCreateControlDevices(t *testing.T) {
95
95
mknodeError : nil ,
96
96
expectedCalls : []struct {
97
97
S string
98
- N1 int
99
- N2 int
98
+ V1 uint32
99
+ V2 uint32
100
100
}{
101
101
{"/some/root/dev/nvidiactl" , 195 , 255 },
102
102
{"/some/root/dev/nvidia-modeset" , 195 , 254 },
@@ -112,8 +112,8 @@ func TestCreateControlDevices(t *testing.T) {
112
112
// We expect the first call to this to fail, and the rest to be skipped
113
113
expectedCalls : []struct {
114
114
S string
115
- N1 int
116
- N2 int
115
+ V1 uint32
116
+ V2 uint32
117
117
}{
118
118
{"/dev/nvidiactl" , 195 , 255 },
119
119
},
@@ -132,7 +132,7 @@ func TestCreateControlDevices(t *testing.T) {
132
132
for _ , tc := range testCases {
133
133
t .Run (tc .description , func (t * testing.T ) {
134
134
mknode := & mknoderMock {
135
- MknodeFunc : func (string , int , int ) error {
135
+ MknodeFunc : func (string , uint32 , uint32 ) error {
136
136
return tc .mknodeError
137
137
},
138
138
}
0 commit comments