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( 207746a6c4SThomas Huth 'https://storage.tuxboot.com/20230331/riscv64/Image', 217746a6c4SThomas Huth 'cd634badc65e52fb63465ec99e309c0de0369f0841b7d9486f9729e119bac25e') 227746a6c4SThomas Huth ASSET_RISCV64_ROOTFS = Asset( 237746a6c4SThomas Huth 'https://storage.tuxboot.com/20230331/riscv64/rootfs.ext4.zst', 247746a6c4SThomas Huth 'b18e3a3bdf27be03da0b285e84cb71bf09eca071c3a087b42884b6982ed679eb') 257746a6c4SThomas Huth 26*27652f9cSThomas Huth ASSET_RISCV32_KERNEL = Asset( 27*27652f9cSThomas Huth 'https://storage.tuxboot.com/20230331/riscv32/Image', 28*27652f9cSThomas Huth '89599407d7334de629a40e7ad6503c73670359eb5f5ae9d686353a3d6deccbd5') 29*27652f9cSThomas Huth ASSET_RISCV32_ROOTFS = Asset( 30*27652f9cSThomas Huth 'https://storage.tuxboot.com/20230331/riscv32/rootfs.ext4.zst', 31*27652f9cSThomas Huth '7168d296d0283238ea73cd5a775b3dd608e55e04c7b92b76ecce31bb13108cba') 32*27652f9cSThomas 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 44*27652f9cSThomas Huth def test_riscv64_rv32(self): 45*27652f9cSThomas Huth self.set_machine('virt') 46*27652f9cSThomas Huth self.cpu='rv32' 47*27652f9cSThomas Huth self.common_tuxrun(kernel_asset=self.ASSET_RISCV32_KERNEL, 48*27652f9cSThomas Huth rootfs_asset=self.ASSET_RISCV32_ROOTFS) 49*27652f9cSThomas Huth 507746a6c4SThomas Huthif __name__ == '__main__': 517746a6c4SThomas Huth TuxRunBaselineTest.main() 52