Skip to content

Commit 92b2933

Browse files
committed
T8065: Dehardcode qemu settings to allow run tests on arch arm64
1 parent 88897ba commit 92b2933

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ SHELL := /bin/bash
22

33
build_dir := build
44

5+
arch ?= $(shell dpkg --print-architecture 2>/dev/null || echo amd64)
6+
57
.PHONY: all
68
all:
79
@echo "Make what specifically?"
@@ -31,7 +33,7 @@ test-no-interfaces: checkiso
3133
.PHONY: test-no-interfaces-no-vpp
3234
.ONESHELL:
3335
test-no-interfaces-no-vpp: checkiso
34-
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp build/live-image-amd64.hybrid.iso
36+
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp --arch $(arch) build/live-image-$(arch).hybrid.iso
3537

3638
.PHONY: test-interfaces
3739
.ONESHELL:

scripts/check-qemu-install

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ now = datetime.now()
5454
tpm_folder = '/tmp/vyos_tpm_test'
5555
qemu_name = 'VyOS-QEMU'
5656

57+
# Map arch to QEMU binary and machine type
58+
QEMU_BIN = {
59+
"amd64": "qemu-system-x86_64",
60+
"arm64": "qemu-system-aarch64",
61+
}
62+
63+
MACHINE_TYPE = {
64+
"amd64": "pc",
65+
"arm64": "virt",
66+
}
67+
5768
# getch.py
5869
KEY_F2 = chr(27) + chr(91) + chr(49) + chr(50) + chr(126)
5970
KEY_F10 = chr(27) + chr(91) + chr(50) + chr(49) + chr(126)
@@ -148,7 +159,9 @@ if args.sbtest:
148159
def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False, vnc_enabled=False, secure_boot=False):
149160
uefi = ""
150161
uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52"
151-
machine = 'pc'
162+
arch = getattr(args, 'arch', 'amd64')
163+
qemu_bin = QEMU_BIN.get(arch, 'qemu-system-x86_64')
164+
machine = MACHINE_TYPE.get(arch, 'pc')
152165
vga = '-vga none'
153166
vnc = ''
154167
if vnc_enabled:
@@ -176,7 +189,7 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False
176189

177190
# RFC7042 section 2.1.2 MAC addresses used for documentation
178191
macbase = '00:00:5E:00:53'
179-
cmd = f'qemu-system-x86_64 \
192+
cmd = f'{qemu_bin} \
180193
-name "{name}" \
181194
-smp {args.cpu},sockets=1,cores={args.cpu},threads=1 \
182195
-cpu host \

0 commit comments

Comments
 (0)