xref: /qemu/tests/functional/test_arm_tuxrun.py (revision 08258d7e6b1da61fe534d0202286a0778d24a123)
1de9f57a6SThomas Huth#!/usr/bin/env python3
2de9f57a6SThomas Huth#
3de9f57a6SThomas Huth# Functional test that boots known good tuxboot images the same way
4de9f57a6SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
5de9f57a6SThomas Huth# the LKFT project to run regression tests on kernels.
6de9f57a6SThomas Huth#
7de9f57a6SThomas Huth# Copyright (c) 2023 Linaro Ltd.
8de9f57a6SThomas Huth#
9de9f57a6SThomas Huth# Author:
10de9f57a6SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
11de9f57a6SThomas Huth#
12de9f57a6SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
13de9f57a6SThomas Huth
14de9f57a6SThomas Huthfrom qemu_test import Asset
15de9f57a6SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
16de9f57a6SThomas Huth
17de9f57a6SThomas Huthclass TuxRunArmTest(TuxRunBaselineTest):
18de9f57a6SThomas Huth
19de9f57a6SThomas Huth    ASSET_ARMV5_KERNEL = Asset(
20*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv5/zImage',
21*08258d7eSAlex Bennée        '3931a3908dbcf0ec0fe292d035ffc4dfed95f797dedd4a59ccfcf7a46e6f92d4')
22de9f57a6SThomas Huth    ASSET_ARMV5_ROOTFS = Asset(
23*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv5/rootfs.ext4.zst',
24*08258d7eSAlex Bennée        '60ff78b68c7021df378e4fc2d66d3b016484d1acc7e07fb8920c1d8e30f4571f')
25de9f57a6SThomas Huth    ASSET_ARMV5_DTB = Asset(
26*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv5/versatile-pb.dtb',
27*08258d7eSAlex Bennée        '50988e69ef3f3b08bfb9146e8fe414129990029e8dfbed444953b7e14809530a')
28de9f57a6SThomas Huth
29de9f57a6SThomas Huth    def test_armv5(self):
30de9f57a6SThomas Huth        self.set_machine('versatilepb')
31de9f57a6SThomas Huth        self.cpu='arm926'
32de9f57a6SThomas Huth        self.console='ttyAMA0'
33de9f57a6SThomas Huth        self.wait_for_shutdown=False
34de9f57a6SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_ARMV5_KERNEL,
35de9f57a6SThomas Huth                           rootfs_asset=self.ASSET_ARMV5_ROOTFS,
36de9f57a6SThomas Huth                           dtb_asset=self.ASSET_ARMV5_DTB,
37de9f57a6SThomas Huth                           drive="virtio-blk-pci")
38de9f57a6SThomas Huth
39de9f57a6SThomas Huth    ASSET_ARMV7_KERNEL = Asset(
40*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv7/zImage',
41*08258d7eSAlex Bennée        '1377bc3d90de5ce57ab17cd67429fe8b15c2e9964248c775c682b67e6299b991')
42de9f57a6SThomas Huth    ASSET_ARMV7_ROOTFS = Asset(
43*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv7/rootfs.ext4.zst',
44*08258d7eSAlex Bennée        'ed2cbc69bd6b3fbd5cafb5ee961393c7cfbe726446f14301c67d6b1f28bfdb51')
45de9f57a6SThomas Huth
46de9f57a6SThomas Huth    def test_armv7(self):
47de9f57a6SThomas Huth        self.set_machine('virt')
48de9f57a6SThomas Huth        self.cpu='cortex-a15'
49de9f57a6SThomas Huth        self.console='ttyAMA0'
50de9f57a6SThomas Huth        self.wait_for_shutdown=False
51de9f57a6SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_ARMV7_KERNEL,
52de9f57a6SThomas Huth                           rootfs_asset=self.ASSET_ARMV7_ROOTFS)
53de9f57a6SThomas Huth
54de9f57a6SThomas Huth    ASSET_ARMV7BE_KERNEL = Asset(
55*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv7be/zImage',
56*08258d7eSAlex Bennée        'a244e6da99f1bbd254827ec7681bd4aac9eb1aa05aaebc6b15e5d289ebb683f3')
57de9f57a6SThomas Huth    ASSET_ARMV7BE_ROOTFS = Asset(
58*08258d7eSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/armv7be/rootfs.ext4.zst',
59*08258d7eSAlex Bennée        'd4f9c57860a512163f30ecc69b2174d1a1bdeb853a43dc49a09cfcfe84e428ea')
60de9f57a6SThomas Huth
61de9f57a6SThomas Huth    def test_armv7be(self):
62de9f57a6SThomas Huth        self.set_machine('virt')
63de9f57a6SThomas Huth        self.cpu='cortex-a15'
64de9f57a6SThomas Huth        self.console='ttyAMA0'
65de9f57a6SThomas Huth        self.wait_for_shutdown=False
66de9f57a6SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_ARMV7BE_KERNEL,
67de9f57a6SThomas Huth                           rootfs_asset=self.ASSET_ARMV7BE_ROOTFS)
68de9f57a6SThomas Huth
69de9f57a6SThomas Huthif __name__ == '__main__':
70de9f57a6SThomas Huth    TuxRunBaselineTest.main()
71