Skip to content

Commit 367dbb7

Browse files
dongjiang1989jiangdong
authored andcommitted
fix unittest case
Signed-off-by: dongjiang1989 <[email protected]> Signed-off-by: jiangdong <[email protected]>
1 parent 68704b3 commit 367dbb7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

blockdevice/stats_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestBlockDevice(t *testing.T) {
7575
if err != nil {
7676
t.Fatal(err)
7777
}
78-
expectedNumOfDevices := 8
78+
expectedNumOfDevices := 9
7979
if len(devices) != expectedNumOfDevices {
8080
t.Fatalf(failMsgFormat, "Incorrect number of devices", expectedNumOfDevices, len(devices))
8181
}
@@ -95,18 +95,18 @@ func TestBlockDevice(t *testing.T) {
9595
if device0stats.WeightedIOTicks != 6088971 {
9696
t.Errorf(failMsgFormat, "Incorrect time in queue", 6088971, device0stats.WeightedIOTicks)
9797
}
98-
device7stats, count, err := blockdevice.SysBlockDeviceStat(devices[7])
98+
device8stats, count, err := blockdevice.SysBlockDeviceStat(devices[8])
9999
if count != 15 {
100100
t.Errorf(failMsgFormat, "Incorrect number of stats read", 15, count)
101101
}
102102
if err != nil {
103103
t.Fatal(err)
104104
}
105-
if device7stats.WriteSectors != 286915323 {
106-
t.Errorf(failMsgFormat, "Incorrect write merges", 286915323, device7stats.WriteSectors)
105+
if device8stats.WriteSectors != 286915323 {
106+
t.Errorf(failMsgFormat, "Incorrect write merges", 286915323, device8stats.WriteSectors)
107107
}
108-
if device7stats.DiscardTicks != 12 {
109-
t.Errorf(failMsgFormat, "Incorrect discard ticks", 12, device7stats.DiscardTicks)
108+
if device8stats.DiscardTicks != 12 {
109+
t.Errorf(failMsgFormat, "Incorrect discard ticks", 12, device8stats.DiscardTicks)
110110
}
111111
blockQueueStatExpected := BlockQueueStats{
112112
AddRandom: 1,
@@ -147,7 +147,7 @@ func TestBlockDevice(t *testing.T) {
147147
WriteZeroesMaxBytes: 0,
148148
}
149149

150-
blockQueueStat, err := blockdevice.SysBlockDeviceQueueStats(devices[7])
150+
blockQueueStat, err := blockdevice.SysBlockDeviceQueueStats(devices[8])
151151
if err != nil {
152152
t.Fatal(err)
153153
}
@@ -232,12 +232,12 @@ func TestSysBlockDeviceSize(t *testing.T) {
232232
if err != nil {
233233
t.Fatal(err)
234234
}
235-
size7, err := blockdevice.SysBlockDeviceSize(devices[7])
235+
size8, err := blockdevice.SysBlockDeviceSize(devices[8])
236236
if err != nil {
237237
t.Fatal(err)
238238
}
239-
size7Expected := uint64(1920383410176)
240-
if size7 != size7Expected {
241-
t.Errorf("Incorrect BlockDeviceSize, expected: \n%+v, got: \n%+v", size7Expected, size7)
239+
size8Expected := uint64(1920383410176)
240+
if size8 != size8Expected {
241+
t.Errorf("Incorrect BlockDeviceSize, expected: \n%+v, got: \n%+v", size8Expected, size8)
242242
}
243243
}

0 commit comments

Comments
 (0)