Files
weave-scope/probe/host/system_test.go
Peter Bourgon 36212cea3e Fix probe/host for Darwin
Also, add explicit GOOS=darwin target for circle.
2015-06-29 18:27:22 +02:00

39 lines
578 B
Go

package host_test
import (
"strings"
"testing"
"github.com/weaveworks/scope/probe/host"
)
func TestGetKernelVersion(t *testing.T) {
have, err := host.GetKernelVersion()
if err != nil {
t.Fatal(err)
}
if strings.Contains(have, "unknown") {
t.Fatal(have)
}
t.Log(have)
}
func TestGetLoad(t *testing.T) {
have := host.GetLoad()
if strings.Contains(have, "unknown") {
t.Fatal(have)
}
t.Log(have)
}
func TestGetUptime(t *testing.T) {
have, err := host.GetUptime()
if err != nil {
t.Fatal(err)
}
if have == 0 {
t.Fatal(have)
}
t.Log(have.String())
}