Skip TestTopology on non-amd64 (#2391)
* Skip TestTopology tests on unsupported platforms
This commit is contained in:
parent
f1ef936cc3
commit
31a5e4f095
@ -17,6 +17,7 @@ package machine
|
||||
import (
|
||||
"io/ioutil"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
@ -25,6 +26,9 @@ import (
|
||||
)
|
||||
|
||||
func TestTopology(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("cpuinfo testdata is for amd64")
|
||||
}
|
||||
testfile := "./testdata/cpuinfo"
|
||||
testcpuinfo, err := ioutil.ReadFile(testfile)
|
||||
if err != nil {
|
||||
@ -78,6 +82,9 @@ func TestTopology(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTopologyWithSimpleCpuinfo(t *testing.T) {
|
||||
if isSystemZ() {
|
||||
t.Skip("systemZ has no topology info")
|
||||
}
|
||||
sysFs := &fakesysfs.FakeSysFs{}
|
||||
c := sysfs.CacheInfo{
|
||||
Size: 32 * 1024,
|
||||
@ -114,6 +121,9 @@ func TestTopologyWithSimpleCpuinfo(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTopologyEmptyCpuinfo(t *testing.T) {
|
||||
if isSystemZ() {
|
||||
t.Skip("systemZ has no topology info")
|
||||
}
|
||||
_, _, err := GetTopology(&fakesysfs.FakeSysFs{}, "")
|
||||
if err == nil {
|
||||
t.Errorf("Expected empty cpuinfo to fail.")
|
||||
|
Loading…
Reference in New Issue
Block a user