xref: /qemu/tests/functional/test_riscv32_tuxrun.py (revision dc26a2cd9cb68152d8528fa907346370d28bd240)
177bc76c7SThomas Huth#!/usr/bin/env python3
277bc76c7SThomas Huth#
377bc76c7SThomas Huth# Functional test that boots known good tuxboot images the same way
477bc76c7SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
577bc76c7SThomas Huth# the LKFT project to run regression tests on kernels.
677bc76c7SThomas Huth#
777bc76c7SThomas Huth# Copyright (c) 2023 Linaro Ltd.
877bc76c7SThomas Huth#
977bc76c7SThomas Huth# Author:
1077bc76c7SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
1177bc76c7SThomas Huth#
1277bc76c7SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
1377bc76c7SThomas Huth
1477bc76c7SThomas Huthfrom qemu_test import Asset
1577bc76c7SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
1677bc76c7SThomas Huth
1777bc76c7SThomas Huthclass TuxRunRiscV32Test(TuxRunBaselineTest):
1877bc76c7SThomas Huth
1977bc76c7SThomas Huth    ASSET_RISCV32_KERNEL = Asset(
20*f341873bSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv32/Image',
21*f341873bSAlex Bennée        '872bc8f8e0d4661825d5f47f7bec64988e9d0a8bd5db8917d57e16f66d83b329')
2277bc76c7SThomas Huth    ASSET_RISCV32_ROOTFS = Asset(
23*f341873bSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv32/rootfs.ext4.zst',
24*f341873bSAlex Bennée        '511ad34e63222db08d6c1da16fad224970de36517a784110956ba6a24a0ee5f6')
2577bc76c7SThomas Huth
2677bc76c7SThomas Huth    def test_riscv32(self):
2777bc76c7SThomas Huth        self.set_machine('virt')
2877bc76c7SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_RISCV32_KERNEL,
2977bc76c7SThomas Huth                           rootfs_asset=self.ASSET_RISCV32_ROOTFS)
3077bc76c7SThomas Huth
3177bc76c7SThomas Huth    def test_riscv32_maxcpu(self):
3277bc76c7SThomas Huth        self.set_machine('virt')
3377bc76c7SThomas Huth        self.cpu='max'
3477bc76c7SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_RISCV32_KERNEL,
3577bc76c7SThomas Huth                           rootfs_asset=self.ASSET_RISCV32_ROOTFS)
3677bc76c7SThomas Huth
3777bc76c7SThomas Huthif __name__ == '__main__':
3877bc76c7SThomas Huth    TuxRunBaselineTest.main()
39