xref: /qemu/tests/functional/test_s390x_tuxrun.py (revision 92fbc2ffc92f387c2ccb00b38ac800ca924c079a)
1a7a9f513SThomas Huth#!/usr/bin/env python3
2a7a9f513SThomas Huth#
3a7a9f513SThomas Huth# Functional test that boots known good tuxboot images the same way
4a7a9f513SThomas Huth# that tuxrun (www.tuxrun.org) does. This tool is used by things like
5a7a9f513SThomas Huth# the LKFT project to run regression tests on kernels.
6a7a9f513SThomas Huth#
7a7a9f513SThomas Huth# Copyright (c) 2023 Linaro Ltd.
8a7a9f513SThomas Huth#
9a7a9f513SThomas Huth# Author:
10a7a9f513SThomas Huth#  Alex Bennée <alex.bennee@linaro.org>
11a7a9f513SThomas Huth#
12a7a9f513SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
13a7a9f513SThomas Huth
14a7a9f513SThomas Huthfrom qemu_test import Asset
15a7a9f513SThomas Huthfrom qemu_test.tuxruntest import TuxRunBaselineTest
16a7a9f513SThomas Huth
17a7a9f513SThomas Huthclass TuxRunS390xTest(TuxRunBaselineTest):
18a7a9f513SThomas Huth
19a7a9f513SThomas Huth    ASSET_S390X_KERNEL = Asset(
209507445bSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/s390/bzImage',
219507445bSAlex Bennée        'ee67e91db52a2aed104a7c72b2a08987c678f8179c029626789c35d6dd0fedf1')
22a7a9f513SThomas Huth    ASSET_S390X_ROOTFS = Asset(
239507445bSAlex Bennée        'https://storage.tuxboot.com/buildroot/20241119/s390/rootfs.ext4.zst',
249507445bSAlex Bennée        'bff7971fc2fef56372d98afe4557b82fd0a785a241e44c29b058e577ad1bbb44')
25a7a9f513SThomas Huth
26a7a9f513SThomas Huth    def test_s390(self):
27*7c312d85SThomas Huth        self.set_machine('s390-ccw-virtio')
28a7a9f513SThomas Huth        self.wait_for_shutdown=False
29a7a9f513SThomas Huth        self.common_tuxrun(kernel_asset=self.ASSET_S390X_KERNEL,
30a7a9f513SThomas Huth                           rootfs_asset=self.ASSET_S390X_ROOTFS,
31a7a9f513SThomas Huth                           drive="virtio-blk-ccw",
32a7a9f513SThomas Huth                           haltmsg="Requesting system halt")
33a7a9f513SThomas Huth
34a7a9f513SThomas Huthif __name__ == '__main__':
35a7a9f513SThomas Huth    TuxRunBaselineTest.main()
36