|
16 | 16 |
|
17 | 17 | from qemu_test import BUILD_DIR
|
18 | 18 | 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 |
21 | 20 |
|
22 | 21 |
|
23 | 22 | 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') |
28 | 29 |
|
29 | 30 | def test_win_virt_tcg(self):
|
30 | 31 | self.set_machine('virt')
|
31 | 32 | self.vm.set_console()
|
32 | 33 | self.require_accelerator("tcg")
|
33 | 34 |
|
34 |
| - iso_path = self.ASSET_WINVOS_ISO.fetch() |
| 35 | + img_path = self.ASSET_WINVOS_IMG.fetch() |
35 | 36 |
|
36 | 37 | self.vm.add_args("-accel", "tcg")
|
37 | 38 | self.vm.add_args("-cpu", "max,pauth-impdef=on")
|
38 | 39 | 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") |
44 | 44 | self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios',
|
45 | 45 | 'edk2-aarch64-code.fd'))
|
46 | 46 | 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') |
95 | 47 |
|
96 | 48 | 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") |
115 | 49 |
|
116 | 50 |
|
117 | 51 | if __name__ == '__main__':
|
|
0 commit comments