1#!/usr/bin/env python3
2#
3# Functional test that boots a Linux kernel on a collie machine
4# and checks the console
5#
6# SPDX-License-Identifier: GPL-2.0-or-later
7
8from qemu_test import LinuxKernelTest, Asset
9from qemu_test.utils import archive_extract
10
11class CollieTest(LinuxKernelTest):
12
13    ASSET_ZIMAGE = Asset(
14        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/collie/zImage',
15        '10ace8abf9e0875ef8a83b8829cc3b5b50bc6d7bc3ca29f19f49f5673a43c13b')
16
17    ASSET_ROOTFS = Asset(
18        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/collie/rootfs-sa110.cpio',
19        '89ccaaa5c6b33331887047e1618ffe81b0f55909173944347d5d2426f3bcc1f2')
20
21    def test_arm_collie(self):
22        self.set_machine('collie')
23        zimage_path = self.ASSET_ZIMAGE.fetch()
24        rootfs_path = self.ASSET_ROOTFS.fetch()
25        self.vm.add_args('-append', 'rdinit=/sbin/init console=ttySA1')
26        self.launch_kernel(zimage_path,
27                           initrd=rootfs_path,
28                           wait_for='reboot: Restarting system')
29
30if __name__ == '__main__':
31    LinuxKernelTest.main()
32