1*9ca8239aSThomas Huth#!/usr/bin/env python3
2*9ca8239aSThomas Huth#
3*9ca8239aSThomas Huth# Functional test that boots known good tuxboot images the same way
4*9ca8239aSThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
5*9ca8239aSThomas Huth# the LKFT project to run regression tests on kernels.
6*9ca8239aSThomas Huth#
7*9ca8239aSThomas Huth# Copyright (c) 2023 Linaro Ltd.
8*9ca8239aSThomas Huth#
9*9ca8239aSThomas Huth# Author:
10*9ca8239aSThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
11*9ca8239aSThomas Huth#
12*9ca8239aSThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
13*9ca8239aSThomas Huth
14*9ca8239aSThomas Huthfrom qemu_test import Asset
15*9ca8239aSThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
16*9ca8239aSThomas Huth
17*9ca8239aSThomas Huthclass TuxRunPPC32Test(TuxRunBaselineTest):
18*9ca8239aSThomas Huth
19*9ca8239aSThomas Huth    ASSET_PPC32_KERNEL = Asset(
20*9ca8239aSThomas Huth        'https://storage.tuxboot.com/20230331/ppc32/uImage',
21*9ca8239aSThomas Huth        '1a68f74b860fda022fb12e03c5efece8c2b8b590d96cca37a8481a3ae0b3f81f')
22*9ca8239aSThomas Huth    ASSET_PPC32_ROOTFS = Asset(
23*9ca8239aSThomas Huth        'https://storage.tuxboot.com/20230331/ppc32/rootfs.ext4.zst',
24*9ca8239aSThomas Huth        '8885b9d999cc24d679542a02e9b6aaf48f718f2050ece6b8347074b6ee41dd09')
25*9ca8239aSThomas Huth
26*9ca8239aSThomas Huth    def test_ppc32(self):
27*9ca8239aSThomas Huth        self.set_machine('ppce500')
28*9ca8239aSThomas Huth        self.cpu='e500mc'
29*9ca8239aSThomas Huth        self.wait_for_shutdown=False
30*9ca8239aSThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_PPC32_KERNEL,
31*9ca8239aSThomas Huth                           rootfs_asset=self.ASSET_PPC32_ROOTFS,
32*9ca8239aSThomas Huth                           drive="virtio-blk-pci")
33*9ca8239aSThomas Huth
34*9ca8239aSThomas Huthif __name__ == '__main__':
35*9ca8239aSThomas Huth    TuxRunBaselineTest.main()
36