|
|
|
@ -121,7 +121,7 @@ func Test_Process_Status(t *testing.T) {
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("geting ppid error %v", err)
|
|
|
|
|
}
|
|
|
|
|
if !strings.HasPrefix(v, "S") && v != "running"{
|
|
|
|
|
if !strings.HasPrefix(v, "S") && v != "running" && v != "sleeping" {
|
|
|
|
|
t.Errorf("could not get state %v", v)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -133,9 +133,11 @@ func Test_Process_Terminal(t *testing.T) {
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("geting terminal error %v", err)
|
|
|
|
|
}
|
|
|
|
|
if v == "" {
|
|
|
|
|
t.Errorf("could not get terminal %v", v)
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
if v == "" {
|
|
|
|
|
t.Errorf("could not get terminal %v", v)
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func Test_Process_IOCounters(t *testing.T) {
|
|
|
|
@ -169,7 +171,7 @@ func Test_Process_Nice(t *testing.T) {
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("geting nice error %v", err)
|
|
|
|
|
}
|
|
|
|
|
if n != 0 && n != 20{
|
|
|
|
|
if n != 0 && n != 20 {
|
|
|
|
|
t.Errorf("invalid nice: %d", n)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -201,7 +203,7 @@ func Test_Process_CpuPercent(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
numcpu := runtime.NumCPU()
|
|
|
|
|
if percent < 0.0 || percent > 100.0*float64(numcpu) {
|
|
|
|
|
t.Fatalf("CPUPercent value is invalid: %f", percent)
|
|
|
|
|
t.Fatalf("CPUPercent value is invalid: %f, %d", percent, numcpu)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -216,7 +218,7 @@ func Test_Process_CpuPercentLoop(t *testing.T) {
|
|
|
|
|
t.Errorf("error %v", err)
|
|
|
|
|
}
|
|
|
|
|
if percent < 0.0 || percent > 100.0*float64(numcpu) {
|
|
|
|
|
t.Fatalf("CPUPercent value is invalid: %f", percent)
|
|
|
|
|
t.Fatalf("CPUPercent value is invalid: %f, %d", percent, numcpu)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|