xref: /openbmc/qemu/tests/functional/test_aarch64_tuxrun.py (revision b8ee011e40e4b83a32ea0e7dca24e1ab089f1e7f)
137136902SThomas Huth#!/usr/bin/env python3
237136902SThomas Huth#
337136902SThomas Huth# Functional test that boots known good tuxboot images the same way
437136902SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
537136902SThomas Huth# the LKFT project to run regression tests on kernels.
637136902SThomas Huth#
737136902SThomas Huth# Copyright (c) 2023 Linaro Ltd.
837136902SThomas Huth#
937136902SThomas Huth# Author:
1037136902SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
1137136902SThomas Huth#
1237136902SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
1337136902SThomas Huth
1437136902SThomas Huthfrom qemu_test import Asset
1537136902SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
1637136902SThomas Huth
1737136902SThomas Huthclass TuxRunAarch64Test(TuxRunBaselineTest):
1837136902SThomas Huth
1937136902SThomas Huth    ASSET_ARM64_KERNEL = Asset(
20*abf7c0f1SAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/arm64/Image',
21*abf7c0f1SAlex Bennée        'b74743c5e89e1cea0f73368d24ae0ae85c5204ff84be3b5e9610417417d2f235')
2237136902SThomas Huth    ASSET_ARM64_ROOTFS = Asset(
23*abf7c0f1SAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/arm64/rootfs.ext4.zst',
24*abf7c0f1SAlex Bennée        'a1acaaae2068df4648d04ff75f532aaa8c5edcd6b936122b6f0db4848a07b465')
2537136902SThomas Huth
2637136902SThomas Huth    def test_arm64(self):
2737136902SThomas Huth        self.set_machine('virt')
2837136902SThomas Huth        self.cpu='cortex-a57'
2937136902SThomas Huth        self.console='ttyAMA0'
3037136902SThomas Huth        self.wait_for_shutdown=False
3137136902SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_ARM64_KERNEL,
3237136902SThomas Huth                           rootfs_asset=self.ASSET_ARM64_ROOTFS)
3337136902SThomas Huth
3437136902SThomas Huth    ASSET_ARM64BE_KERNEL = Asset(
35*abf7c0f1SAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/arm64be/Image',
36*abf7c0f1SAlex Bennée        'fd6af4f16689d17a2c24fe0053cc212edcdf77abdcaf301800b8d38fa9f6e109')
3737136902SThomas Huth    ASSET_ARM64BE_ROOTFS = Asset(
38*abf7c0f1SAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/arm64be/rootfs.ext4.zst',
39*abf7c0f1SAlex Bennée        'f5e9371b62701aab8dead52592ca7488c8a9e255c9be8d7635c7f30f477c2c21')
4037136902SThomas Huth
4137136902SThomas Huth    def test_arm64be(self):
4237136902SThomas Huth        self.set_machine('virt')
4337136902SThomas Huth        self.cpu='cortex-a57'
4437136902SThomas Huth        self.console='ttyAMA0'
4537136902SThomas Huth        self.wait_for_shutdown=False
4637136902SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_ARM64BE_KERNEL,
4737136902SThomas Huth                           rootfs_asset=self.ASSET_ARM64BE_ROOTFS)
4837136902SThomas Huth
4937136902SThomas Huthif __name__ == '__main__':
5037136902SThomas Huth    TuxRunBaselineTest.main()
51