Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions mantle/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
PREFIX ?= /usr
DESTDIR ?=

GOARCH:=$(shell uname -m)
# Copied from coreos-assembler Makefile
ifeq ($(GOARCH),x86_64)
GOARCH=amd64
else ifeq ($(GOARCH),aarch64)
GOARCH=arm64
endif
ARCH:=$(shell uname -m)

.PHONY: build test vendor clean
build:
Expand All @@ -16,7 +10,7 @@ build:
.PHONY: install
install: bin/ore bin/kola bin/plume bin/kolet
install -D -t $(DESTDIR)$(PREFIX)/bin bin/{ore,kola,plume}
install -D -m 0755 -t $(DESTDIR)$(PREFIX)/lib/kola/$(GOARCH) bin/kolet
install -D -m 0755 -t $(DESTDIR)$(PREFIX)/lib/kola/$(ARCH) bin/kolet

test:
./test
Expand Down
18 changes: 3 additions & 15 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
isExcluded = true
break
}
allowedArchitecture, _ := isAllowed(architecture(platform), t.Architectures, t.ExcludeArchitectures)
allowedArchitecture, _ := isAllowed(system.RpmArch(), t.Architectures, t.ExcludeArchitectures)
allowed = allowed || (allowedPlatform && allowedArchitecture)
}
if isExcluded || !allowed {
Expand All @@ -327,7 +327,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri

// Check native tests for arch specific exclusion
for k, NativeFuncWrap := range t.NativeFuncs {
_, excluded := isAllowed(architecture(pltfrm), nil, NativeFuncWrap.ExcludeArchitectures)
_, excluded := isAllowed(system.RpmArch(), nil, NativeFuncWrap.ExcludeArchitectures)
if excluded {
delete(t.NativeFuncs, k)
}
Expand Down Expand Up @@ -766,7 +766,7 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig

// drop kolet binary on machines
if t.ExternalTest != "" || t.NativeFuncs != nil {
if err := scpKolet(tcluster.Machines(), architecture(pltfrm)); err != nil {
if err := scpKolet(tcluster.Machines(), system.RpmArch()); err != nil {
h.Fatal(err)
}
}
Expand Down Expand Up @@ -803,18 +803,6 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
t.Run(tcluster)
}

// architecture returns the machine architecture of the given platform.
func architecture(pltfrm string) string {
nativeArch := "amd64"
if (pltfrm == "qemu" || pltfrm == "qemu-unpriv") && QEMUOptions.Board != "" {
nativeArch = boardToArch(QEMUOptions.Board)
}
if pltfrm == "packet" && PacketOptions.Board != "" {
nativeArch = boardToArch(PacketOptions.Board)
}
return nativeArch
}

// returns the arch part of an sdk board name
func boardToArch(board string) string {
return strings.SplitN(board, "-", 2)[0]
Expand Down