MCPcopy Create free account
hub / github.com/prometheus/procfs / TestSysBlockDeviceSize

Function TestSysBlockDeviceSize

blockdevice/stats_test.go:226–243  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

224}
225
226func TestSysBlockDeviceSize(t *testing.T) {
227 blockdevice, err := NewFS("testdata/fixtures/proc", "testdata/fixtures/sys")
228 if err != nil {
229 t.Fatalf("failed to access blockdevice fs: %v", err)
230 }
231 devices, err := blockdevice.SysBlockDevices()
232 if err != nil {
233 t.Fatal(err)
234 }
235 size11, err := blockdevice.SysBlockDeviceSize(devices[11])
236 if err != nil {
237 t.Fatal(err)
238 }
239 size11Expected := uint64(1920383410176)
240 if size11 != size11Expected {
241 t.Errorf("Incorrect BlockDeviceSize, expected: \n%+v, got: \n%+v", size11Expected, size11)
242 }
243}
244
245func TestSysBlockDeviceRotational(t *testing.T) {
246 blockdevice, err := NewFS("testdata/fixtures/proc", "testdata/fixtures/sys")

Callers

nothing calls this directly

Calls 3

SysBlockDevicesMethod · 0.95
SysBlockDeviceSizeMethod · 0.95
NewFSFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…