| 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 | |
| 14 | from qemu_test import Asset |
| 15 | from qemu_test.tuxruntest import TuxRunBaselineTest |
| 16 | |
| 17 | class TuxRunArmTest(TuxRunBaselineTest): |
| 18 | |
| 19 | ASSET_ARMV5_KERNEL = Asset( |
| 20 | 'https://storage.tuxboot.com/buildroot/20241119/armv5/zImage', |
| 21 | '3931a3908dbcf0ec0fe292d035ffc4dfed95f797dedd4a59ccfcf7a46e6f92d4') |
| 22 | ASSET_ARMV5_ROOTFS = Asset( |
| 23 | 'https://storage.tuxboot.com/buildroot/20241119/armv5/rootfs.ext4.zst', |
| 24 | '60ff78b68c7021df378e4fc2d66d3b016484d1acc7e07fb8920c1d8e30f4571f') |
| 25 | ASSET_ARMV5_DTB = Asset( |
| 26 | 'https://storage.tuxboot.com/buildroot/20241119/armv5/versatile-pb.dtb', |
| 27 | '50988e69ef3f3b08bfb9146e8fe414129990029e8dfbed444953b7e14809530a') |
| 28 | |
| 29 | def test_armv5(self): |
| 30 | self.set_machine('versatilepb') |
| 31 | self.cpu='arm926' |
| 32 | self.console='ttyAMA0' |
| 33 | self.wait_for_shutdown=False |
| 34 | self.common_tuxrun(kernel_asset=self.ASSET_ARMV5_KERNEL, |
| 35 | rootfs_asset=self.ASSET_ARMV5_ROOTFS, |
| 36 | dtb_asset=self.ASSET_ARMV5_DTB, |
| 37 | drive="virtio-blk-pci") |
| 38 | |
| 39 | ASSET_ARMV7_KERNEL = Asset( |
| 40 | 'https://storage.tuxboot.com/buildroot/20241119/armv7/zImage', |
| 41 | '1377bc3d90de5ce57ab17cd67429fe8b15c2e9964248c775c682b67e6299b991') |
| 42 | ASSET_ARMV7_ROOTFS = Asset( |
| 43 | 'https://storage.tuxboot.com/buildroot/20241119/armv7/rootfs.ext4.zst', |
| 44 | 'ed2cbc69bd6b3fbd5cafb5ee961393c7cfbe726446f14301c67d6b1f28bfdb51') |
| 45 | |
| 46 | def test_armv7(self): |
| 47 | self.set_machine('virt') |
| 48 | self.cpu='cortex-a15' |
| 49 | self.console='ttyAMA0' |
| 50 | self.wait_for_shutdown=False |
| 51 | self.common_tuxrun(kernel_asset=self.ASSET_ARMV7_KERNEL, |
| 52 | rootfs_asset=self.ASSET_ARMV7_ROOTFS) |
| 53 | |
| 54 | ASSET_ARMV7BE_KERNEL = Asset( |
| 55 | 'https://storage.tuxboot.com/buildroot/20241119/armv7be/zImage', |
| 56 | 'a244e6da99f1bbd254827ec7681bd4aac9eb1aa05aaebc6b15e5d289ebb683f3') |
| 57 | ASSET_ARMV7BE_ROOTFS = Asset( |
| 58 | 'https://storage.tuxboot.com/buildroot/20241119/armv7be/rootfs.ext4.zst', |
| 59 | 'd4f9c57860a512163f30ecc69b2174d1a1bdeb853a43dc49a09cfcfe84e428ea') |
| 60 | |
| 61 | def test_armv7be(self): |
| 62 | self.set_machine('virt') |
| 63 | self.cpu='cortex-a15' |
| 64 | self.console='ttyAMA0' |
| 65 | self.wait_for_shutdown=False |
| 66 | self.common_tuxrun(kernel_asset=self.ASSET_ARMV7BE_KERNEL, |
| 67 | rootfs_asset=self.ASSET_ARMV7BE_ROOTFS) |
| 68 | |
| 69 | if __name__ == '__main__': |
| 70 | TuxRunBaselineTest.main() |