xref: /qemu/tests/functional/test_riscv64_tuxrun.py (revision f051adae86ae544ec47a7666d77f7a95ef6d2721)
17746a6c4SThomas Huth#!/usr/bin/env python3
27746a6c4SThomas Huth#
37746a6c4SThomas Huth# Functional test that boots known good tuxboot images the same way
47746a6c4SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
57746a6c4SThomas Huth# the LKFT project to run regression tests on kernels.
67746a6c4SThomas Huth#
77746a6c4SThomas Huth# Copyright (c) 2023 Linaro Ltd.
87746a6c4SThomas Huth#
97746a6c4SThomas Huth# Author:
107746a6c4SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
117746a6c4SThomas Huth#
127746a6c4SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
137746a6c4SThomas Huth
147746a6c4SThomas Huthfrom qemu_test import Asset
157746a6c4SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
167746a6c4SThomas Huth
177746a6c4SThomas Huthclass TuxRunRiscV64Test(TuxRunBaselineTest):
187746a6c4SThomas Huth
197746a6c4SThomas Huth    ASSET_RISCV64_KERNEL = Asset(
20*f051adaeSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv64/Image',
21*f051adaeSAlex Bennée        '2bd8132a3bf21570290042324fff48c987f42f2a00c08de979f43f0662ebadba')
227746a6c4SThomas Huth    ASSET_RISCV64_ROOTFS = Asset(
23*f051adaeSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv64/rootfs.ext4.zst',
24*f051adaeSAlex Bennée        'aa4736a9872651dfc0d95e709465eedf1134fd19d42b8cb305bfd776f9801004')
257746a6c4SThomas Huth
2627652f9cSThomas Huth    ASSET_RISCV32_KERNEL = Asset(
27*f051adaeSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv32/Image',
28*f051adaeSAlex Bennée        '872bc8f8e0d4661825d5f47f7bec64988e9d0a8bd5db8917d57e16f66d83b329')
2927652f9cSThomas Huth    ASSET_RISCV32_ROOTFS = Asset(
30*f051adaeSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/riscv32/rootfs.ext4.zst',
31*f051adaeSAlex Bennée        '511ad34e63222db08d6c1da16fad224970de36517a784110956ba6a24a0ee5f6')
3227652f9cSThomas Huth
337746a6c4SThomas Huth    def test_riscv64(self):
347746a6c4SThomas Huth        self.set_machine('virt')
357746a6c4SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_RISCV64_KERNEL,
367746a6c4SThomas Huth                           rootfs_asset=self.ASSET_RISCV64_ROOTFS)
377746a6c4SThomas Huth
387746a6c4SThomas Huth    def test_riscv64_maxcpu(self):
397746a6c4SThomas Huth        self.set_machine('virt')
407746a6c4SThomas Huth        self.cpu='max'
417746a6c4SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_RISCV64_KERNEL,
427746a6c4SThomas Huth                           rootfs_asset=self.ASSET_RISCV64_ROOTFS)
437746a6c4SThomas Huth
4427652f9cSThomas Huth    def test_riscv64_rv32(self):
4527652f9cSThomas Huth        self.set_machine('virt')
4627652f9cSThomas Huth        self.cpu='rv32'
4727652f9cSThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_RISCV32_KERNEL,
4827652f9cSThomas Huth                           rootfs_asset=self.ASSET_RISCV32_ROOTFS)
4927652f9cSThomas Huth
507746a6c4SThomas Huthif __name__ == '__main__':
517746a6c4SThomas Huth    TuxRunBaselineTest.main()
52