@@ -247,6 +247,7 @@ F: gdb-xml/hexagon*.xml
F: docs/system/target-hexagon.rst
F: docs/devel/hexagon-sys.rst
F: docs/devel/hexagon-l2vic.rst
+F: tests/functional/test_hexagon_minivm.py
T: git https://github.com/quic/qemu.git hex-next
Hexagon idef-parser
@@ -135,6 +135,14 @@ tests_i386_system_quick = [
'migration',
]
+test_timeouts += {
+ 'hexagon_minivm': 180,
+}
+
+tests_hexagon_system_quick = [
+ 'hexagon_minivm',
+]
+
tests_i386_system_thorough = [
'i386_tuxrun',
]
new file mode 100755
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+#
+# Copyright(c) 2024-2025 Qualcomm Innovation Center, Inc. All Rights Reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+from glob import glob
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern
+
+class MiniVMTest(QemuSystemTest):
+
+ timeout = 180
+ GUEST_ENTRY = 0xc0000000
+
+ REPO = 'https://artifacts.codelinaro.org/artifactory'
+ ASSET_TARBALL = \
+ Asset(f'{REPO}/codelinaro-toolchain-for-hexagon/'
+ '19.1.5/hexagon_minivm_2024_Dec_15.tar.gz',
+ 'd7920b5ff14bed5a10b23ada7d4eb927ede08635281f25067e0d5711feee2c2a')
+
+ def test_minivm(self):
+ self.set_machine('virt')
+ self.archive_extract(self.ASSET_TARBALL)
+ rootfs_path = f'{self.workdir}/hexagon-unknown-linux-musl-rootfs'
+ kernel_path = f'{rootfs_path}/boot/minivm'
+
+ assert(os.path.exists(kernel_path))
+ for test_bin_path in glob(f'{rootfs_path}/boot/test_*'):
+ print(f'# Testing "{os.path.basename(test_bin_path)}"')
+
+ vm = self.get_vm()
+ vm.add_args('-kernel', kernel_path,
+ '-device',
+ f'loader,addr={hex(self.GUEST_ENTRY)},file={test_bin_path}')
+ vm.launch()
+ vm.wait()
+ self.assertEqual(vm.exitcode(), 0)
+
+if __name__ == '__main__':
+ QemuSystemTest.main()