1#!/usr/bin/env python3
2#
3# Functional test that boots known good tuxboot images the same way
4# that tuxrun (www.tuxrun.org) does. This tool is used by things like
5# the LKFT project to run regression tests on kernels.
6#
7# Copyright (c) 2023 Linaro Ltd.
8#
9# Author:
10#  Alex Bennée <alex.bennee@linaro.org>
11#
12# SPDX-License-Identifier: GPL-2.0-or-later
13
14from qemu_test import Asset
15from qemu_test.tuxruntest import TuxRunBaselineTest
16
17class TuxRunAarch64Test(TuxRunBaselineTest):
18
19    ASSET_ARM64_KERNEL = Asset(
20        'https://storage.tuxboot.com/buildroot/20241119/arm64/Image',
21        'b74743c5e89e1cea0f73368d24ae0ae85c5204ff84be3b5e9610417417d2f235')
22    ASSET_ARM64_ROOTFS = Asset(
23        'https://storage.tuxboot.com/buildroot/20241119/arm64/rootfs.ext4.zst',
24        'a1acaaae2068df4648d04ff75f532aaa8c5edcd6b936122b6f0db4848a07b465')
25
26    def test_arm64(self):
27        self.set_machine('virt')
28        self.cpu='cortex-a57'
29        self.console='ttyAMA0'
30        self.wait_for_shutdown=False
31        self.common_tuxrun(kernel_asset=self.ASSET_ARM64_KERNEL,
32                           rootfs_asset=self.ASSET_ARM64_ROOTFS)
33
34    ASSET_ARM64BE_KERNEL = Asset(
35        'https://storage.tuxboot.com/buildroot/20241119/arm64be/Image',
36        'fd6af4f16689d17a2c24fe0053cc212edcdf77abdcaf301800b8d38fa9f6e109')
37    ASSET_ARM64BE_ROOTFS = Asset(
38        'https://storage.tuxboot.com/buildroot/20241119/arm64be/rootfs.ext4.zst',
39        'f5e9371b62701aab8dead52592ca7488c8a9e255c9be8d7635c7f30f477c2c21')
40
41    def test_arm64be(self):
42        self.set_machine('virt')
43        self.cpu='cortex-a57'
44        self.console='ttyAMA0'
45        self.wait_for_shutdown=False
46        self.common_tuxrun(kernel_asset=self.ASSET_ARM64BE_KERNEL,
47                           rootfs_asset=self.ASSET_ARM64BE_ROOTFS)
48
49if __name__ == '__main__':
50    TuxRunBaselineTest.main()
51