1*7cea8fe3SThomas Huth#!/usr/bin/env python3
2*7cea8fe3SThomas Huth#
3*7cea8fe3SThomas Huth# Functional test that boots known good tuxboot images the same way
4*7cea8fe3SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
5*7cea8fe3SThomas Huth# the LKFT project to run regression tests on kernels.
6*7cea8fe3SThomas Huth#
7*7cea8fe3SThomas Huth# Copyright (c) 2023 Linaro Ltd.
8*7cea8fe3SThomas Huth#
9*7cea8fe3SThomas Huth# Author:
10*7cea8fe3SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
11*7cea8fe3SThomas Huth#
12*7cea8fe3SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
13*7cea8fe3SThomas Huth
14*7cea8fe3SThomas Huthfrom qemu_test import Asset
15*7cea8fe3SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
16*7cea8fe3SThomas Huth
17*7cea8fe3SThomas Huthclass TuxRunX86Test(TuxRunBaselineTest):
18*7cea8fe3SThomas Huth
19*7cea8fe3SThomas Huth    ASSET_X86_64_KERNEL = Asset(
20*7cea8fe3SThomas Huth        'https://storage.tuxboot.com/20230331/x86_64/bzImage',
21*7cea8fe3SThomas Huth        '2bc7480a669ee9b6b82500a236aba0c54233debe98cb968268fa230f52f03461')
22*7cea8fe3SThomas Huth    ASSET_X86_64_ROOTFS = Asset(
23*7cea8fe3SThomas Huth        'https://storage.tuxboot.com/20230331/x86_64/rootfs.ext4.zst',
24*7cea8fe3SThomas Huth        'b72ac729769b8f51c6dffb221113c9a063c774dbe1d66af30eb593c4e9999b4b')
25*7cea8fe3SThomas Huth
26*7cea8fe3SThomas Huth    def test_x86_64(self):
27*7cea8fe3SThomas Huth        self.set_machine('q35')
28*7cea8fe3SThomas Huth        self.cpu="Nehalem"
29*7cea8fe3SThomas Huth        self.root='sda'
30*7cea8fe3SThomas Huth        self.wait_for_shutdown=False
31*7cea8fe3SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_X86_64_KERNEL,
32*7cea8fe3SThomas Huth                           rootfs_asset=self.ASSET_X86_64_ROOTFS,
33*7cea8fe3SThomas Huth                           drive="driver=ide-hd,bus=ide.0,unit=0")
34*7cea8fe3SThomas Huth
35*7cea8fe3SThomas Huthif __name__ == '__main__':
36*7cea8fe3SThomas Huth    TuxRunBaselineTest.main()
37