Skip to content

Commit 00d446a

Browse files
committed
wip
Signed-off-by: Pierrick Bouvier <[email protected]>
1 parent 13980b0 commit 00d446a

File tree

2 files changed

+13
-78
lines changed

2 files changed

+13
-78
lines changed

tests/functional/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ test_timeouts = {
1919
'aarch64_sbsaref_freebsd' : 720,
2020
'aarch64_tuxrun' : 240,
2121
'aarch64_virt' : 720,
22+
'aarch64_virt_windows' : 720,
2223
'acpi_bits' : 420,
2324
'arm_aspeed_palmetto' : 120,
2425
'arm_aspeed_romulus' : 120,

tests/functional/test_aarch64_virt_windows.py

Lines changed: 12 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -16,102 +16,36 @@
1616

1717
from qemu_test import BUILD_DIR
1818
from qemu_test import QemuSystemTest, Asset
19-
from qemu_test import exec_command, wait_for_console_pattern
20-
from qemu_test import get_qemu_img, run_cmd
19+
from qemu_test import exec_command
2120

2221

2322
class Aarch64VirtWindowsMachine(QemuSystemTest):
24-
25-
ASSET_WINVOS_ISO = Asset(
26-
('https://aka.ms/DownloadValidationOS_arm64',
27-
''))
23+
# VM image comes from iso download at:
24+
# https://aka.ms/DownloadValidationOS_arm64
25+
ASSET_WINVOS_IMG = Asset(
26+
('https://fileserver.linaro.org/s/iTFEgXfpa9FfrGk/'
27+
'download/ValidationOS.vhdx'),
28+
'ae6d95d6657a2d644ecff42abd713b11c808756416ee610a1fcf86cb34d49675')
2829

2930
def test_win_virt_tcg(self):
3031
self.set_machine('virt')
3132
self.vm.set_console()
3233
self.require_accelerator("tcg")
3334

34-
iso_path = self.ASSET_WINVOS_ISO.fetch()
35+
img_path = self.ASSET_WINVOS_IMG.fetch()
3536

3637
self.vm.add_args("-accel", "tcg")
3738
self.vm.add_args("-cpu", "max,pauth-impdef=on")
3839
self.vm.add_args("-machine",
39-
"virt,acpi=on,"
40-
"virtualization=on,"
41-
"mte=on,"
42-
"gic-version=max,iommu=smmuv3")
43-
self.vm.add_args("-smp", "2", "-m", "1024")
40+
"virt,its=on,"
41+
"virtualization=false,"
42+
"gic-version=3")
43+
self.vm.add_args("-smp", "1", "-m", "1024")
4444
self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios',
4545
'edk2-aarch64-code.fd'))
4646
self.vm.add_args("-drive", f"file={iso_path},media=cdrom,format=raw")
47-
self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
48-
self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
49-
50-
self.vm.launch()
51-
self.wait_for_console_pattern('Welcome to Alpine Linux 3.17')
52-
53-
54-
ASSET_KERNEL = Asset(
55-
('https://fileserver.linaro.org/s/'
56-
'z6B2ARM7DQT3HWN/download'),
57-
'12a54d4805cda6ab647cb7c7bbdb16fafb3df400e0d6f16445c1a0436100ef8d')
58-
59-
def common_aarch64_virt(self, machine):
60-
"""
61-
Common code to launch basic virt machine with kernel+initrd
62-
and a scratch disk.
63-
"""
64-
logger = logging.getLogger('aarch64_virt')
65-
66-
kernel_path = self.ASSET_KERNEL.fetch()
67-
68-
self.set_machine('virt')
69-
self.vm.set_console()
70-
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
71-
'console=ttyAMA0')
72-
self.require_accelerator("tcg")
73-
self.vm.add_args('-cpu', 'max,pauth-impdef=on',
74-
'-machine', machine,
75-
'-accel', 'tcg',
76-
'-kernel', kernel_path,
77-
'-append', kernel_command_line)
78-
79-
# A RNG offers an easy way to generate a few IRQs
80-
self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
81-
self.vm.add_args('-object',
82-
'rng-random,id=rng0,filename=/dev/urandom')
83-
84-
# Also add a scratch block device
85-
logger.info('creating scratch qcow2 image')
86-
image_path = os.path.join(self.workdir, 'scratch.qcow2')
87-
qemu_img = get_qemu_img(self)
88-
run_cmd([qemu_img, 'create', '-f', 'qcow2', image_path, '8M'])
89-
90-
# Add the device
91-
self.vm.add_args('-blockdev',
92-
f"driver=qcow2,file.driver=file,file.filename={image_path},node-name=scratch")
93-
self.vm.add_args('-device',
94-
'virtio-blk-device,drive=scratch')
9547

9648
self.vm.launch()
97-
self.wait_for_console_pattern('Welcome to Buildroot')
98-
time.sleep(0.1)
99-
exec_command(self, 'root')
100-
time.sleep(0.1)
101-
exec_command(self, 'dd if=/dev/hwrng of=/dev/vda bs=512 count=4')
102-
time.sleep(0.1)
103-
exec_command(self, 'md5sum /dev/vda')
104-
time.sleep(0.1)
105-
exec_command(self, 'cat /proc/interrupts')
106-
time.sleep(0.1)
107-
exec_command(self, 'cat /proc/self/maps')
108-
time.sleep(0.1)
109-
110-
def test_aarch64_virt_gicv3(self):
111-
self.common_aarch64_virt("virt,gic_version=3")
112-
113-
def test_aarch64_virt_gicv2(self):
114-
self.common_aarch64_virt("virt,gic-version=2")
11549

11650

11751
if __name__ == '__main__':

0 commit comments

Comments
 (0)