[process][linux] copy test for missing iotime in SmartOS lx containers to v3

pull/1083/head
Lars Meyer 4 years ago
parent e42c52cb35
commit e89412a81e

@ -114,4 +114,28 @@ func Test_fillFromStatusWithContext(t *testing.T) {
t.Error(err) t.Error(err)
} }
} }
} }
func Test_fillFromTIDStatWithContext_lx_brandz(t *testing.T) {
pids, err := ioutil.ReadDir("testdata/lx_brandz/")
if err != nil {
t.Error(err)
}
f := common.MockEnv("HOST_PROC", "testdata/lx_brandz")
defer f()
for _, pid := range pids {
pid, err := strconv.ParseInt(pid.Name(), 0, 32)
if err != nil {
continue
}
if _, err := os.Stat(fmt.Sprintf("testdata/lx_brandz/%d/stat", pid)); err != nil {
continue
}
p, _ := NewProcess(int32(pid))
_, _, cpuTimes, _, _, _, _, err := p.fillFromTIDStatWithContext(context.Background(), -1)
if err != nil {
t.Error(err)
}
assert.Equal(t, float64(0), cpuTimes.Iowait)
}
}

@ -0,0 +1 @@
1 (systemd) S 0 0 0 0 -1 0 0 0 0 0 8 15 48 52 1 0 0 0 25 31883264 1413 18446744073709551615 0 0 140737487261696 0 0 0 0 0 0 18446741901776689794 0 0 17 0
Loading…
Cancel
Save