Skip to content

Commit

Permalink
kola/harness.go: Update the arch detection for kola tests
Browse files Browse the repository at this point in the history
While running the kola tests on cloud platforms, our
arch processing would pick the architecture of the host
instead of the machine that we were running on. This
caused an error where our tests were running on arch where
they were not supposed to as per their architectures arg
in their test description
  • Loading branch information
gursewak1997 authored and dustymabe committed Dec 9, 2023
1 parent 4636b1a commit ff273ba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import (
"github.com/coreos/coreos-assembler/mantle/platform/machine/qemuiso"
"github.com/coreos/coreos-assembler/mantle/system"
"github.com/coreos/coreos-assembler/mantle/util"
coreosarch "github.com/coreos/stream-metadata-go/arch"
)

// InstalledTestsDir is a directory where "installed" external
Expand Down Expand Up @@ -599,7 +598,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
isExcluded = true
break
}
allowedArchitecture, _ := isAllowed(coreosarch.CurrentRpmArch(), t.Architectures, t.ExcludeArchitectures)
allowedArchitecture, _ := isAllowed(Options.CosaBuildArch, t.Architectures, t.ExcludeArchitectures)
allowed = allowed || (allowedPlatform && allowedArchitecture)
}
if isExcluded || !allowed {
Expand All @@ -622,7 +621,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
delete(t.NativeFuncs, k)
continue
}
_, excluded = isAllowed(coreosarch.CurrentRpmArch(), nil, NativeFuncWrap.Exclusions)
_, excluded = isAllowed(Options.CosaBuildArch, nil, NativeFuncWrap.Exclusions)
if excluded {
delete(t.NativeFuncs, k)
}
Expand Down Expand Up @@ -717,7 +716,7 @@ func runProvidedTests(testsBank map[string]*register.Test, patterns []string, mu
}

if len(tests) == 0 {
plog.Fatalf("There are no matching tests to run on this architecture/platform: %s %s", coreosarch.CurrentRpmArch(), pltfrm)
plog.Fatalf("There are no matching tests to run on this architecture/platform: %s %s", Options.CosaBuildArch, pltfrm)
}

tests, err = filterDenylistedTests(tests)
Expand Down Expand Up @@ -1216,7 +1215,7 @@ ExecStart=%s
// Architectures using 64k pages use slightly more memory, ask for more than requested
// to make sure that we don't run out of it. Currently, only ppc64le uses 64k pages by default.
// See similar logic in boot-mirror.go and luks.go.
switch coreosarch.CurrentRpmArch() {
switch Options.CosaBuildArch {
case "ppc64le":
if targetMeta.MinMemory <= 4096 {
targetMeta.MinMemory = targetMeta.MinMemory * 2
Expand Down

0 comments on commit ff273ba

Please sign in to comment.