diff --git a/platforms/cpuinfo_test.go b/platforms/cpuinfo_test.go new file mode 100644 index 000000000..95911efe0 --- /dev/null +++ b/platforms/cpuinfo_test.go @@ -0,0 +1,24 @@ +package platforms + +import ( + "runtime" + "testing" +) + +func TestCPUVariant(t *testing.T) { + if !isArmArch(runtime.GOARCH) || !isLinuxOS(runtime.GOOS) { + t.Skip("only relevant on linux/arm") + } + + variants := []string{"v8", "v7", "v6", "v5", "v4", "v3"} + + p := getCPUVariant() + for _, variant := range variants { + if p == variant { + t.Logf("got valid variant as expected: %#v = %#v\n", p, variant) + return + } + } + + t.Fatalf("could not get valid variant as expected: %v\n", variants) +}