MCPcopy
hub / github.com/apptainer/apptainer / TestCPUVariant

Function TestCPUVariant

internal/pkg/ociplatform/cpuinfo_linux_test.go:29–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestCPUVariant(t *testing.T) {
30 if !isArmArch(runtime.GOARCH) {
31 t.Skip("only relevant on linux/arm")
32 }
33
34 variants := []string{"v8", "v7", "v6", "v5", "v4", "v3"}
35
36 p, err := getCPUVariant()
37 if err != nil {
38 t.Fatalf("Error getting CPU variant: %v", err)
39 return
40 }
41
42 for _, variant := range variants {
43 if p == variant {
44 t.Logf("got valid variant as expected: %#v = %#v", p, variant)
45 return
46 }
47 }
48
49 t.Fatalf("could not get valid variant as expected: %v", variants)
50}
51
52func TestGetCPUVariantFromArch(t *testing.T) {
53 for _, testcase := range []struct {

Callers

nothing calls this directly

Calls 3

isArmArchFunction · 0.85
getCPUVariantFunction · 0.85
LogfMethod · 0.45

Tested by

no test coverage detected