(t *testing.T)
| 1335 | } |
| 1336 | |
| 1337 | func TestGetBlockDeviceInfo(t *testing.T) { |
| 1338 | fakeSys := fakesysfs.FakeSysFs{} |
| 1339 | disks, err := GetBlockDeviceInfo(&fakeSys) |
| 1340 | if err != nil { |
| 1341 | t.Errorf("expected call to GetBlockDeviceInfo() to succeed. Failed with %s", err) |
| 1342 | } |
| 1343 | if len(disks) != 1 { |
| 1344 | t.Errorf("expected to get one disk entry. Got %d", len(disks)) |
| 1345 | } |
| 1346 | key := "8:0" |
| 1347 | disk, ok := disks[key] |
| 1348 | if !ok { |
| 1349 | t.Fatalf("expected key 8:0 to exist in the disk map.") |
| 1350 | } |
| 1351 | if disk.Name != "sda" { |
| 1352 | t.Errorf("expected to get disk named sda. Got %q", disk.Name) |
| 1353 | } |
| 1354 | size := uint64(1234567 * 512) |
| 1355 | if disk.Size != size { |
| 1356 | t.Errorf("expected to get disk size of %d. Got %d", size, disk.Size) |
| 1357 | } |
| 1358 | if disk.Scheduler != "cfq" { |
| 1359 | t.Errorf("expected to get scheduler type of cfq. Got %q", disk.Scheduler) |
| 1360 | } |
| 1361 | } |
| 1362 | |
| 1363 | func TestGetNetworkDevices(t *testing.T) { |
| 1364 | fakeSys := fakesysfs.FakeSysFs{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…