summary refs log tree commit diff stats
path: root/tests/functional/aarch64/test_replay.py
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2025-08-19 13:23:42 +0200
committerThomas Huth <thuth@redhat.com>2025-08-27 09:46:55 +0200
commit96ced85b0c5664426518ad43f0e423092fbee933 (patch)
treef4d97948d5beef295c6e354da96a62e0d05d4226 /tests/functional/aarch64/test_replay.py
parent9c9efb1e36ddb2e636c7f6aafda49cddaee88a0c (diff)
downloadfocaccia-qemu-96ced85b0c5664426518ad43f0e423092fbee933.tar.gz
focaccia-qemu-96ced85b0c5664426518ad43f0e423092fbee933.zip
tests/functional: Move aarch64 tests into architecture specific folder
The tests/functional folder has become quite crowded already, some
restructuring would be helpful here. Thus move the aarch64 tests into
a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-6-thuth@redhat.com>
Diffstat (limited to 'tests/functional/aarch64/test_replay.py')
-rwxr-xr-xtests/functional/aarch64/test_replay.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/functional/aarch64/test_replay.py b/tests/functional/aarch64/test_replay.py
new file mode 100755
index 0000000000..db12e76603
--- /dev/null
+++ b/tests/functional/aarch64/test_replay.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+#
+# Replay test that boots a Linux kernel on an aarch64 machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from subprocess import check_call, DEVNULL
+
+from qemu_test import Asset, skipIfOperatingSystem, get_qemu_img
+from replay_kernel import ReplayKernelBase
+
+
+class Aarch64Replay(ReplayKernelBase):
+
+    ASSET_KERNEL = Asset(
+        'https://storage.tuxboot.com/buildroot/20241119/arm64/Image',
+        'b74743c5e89e1cea0f73368d24ae0ae85c5204ff84be3b5e9610417417d2f235')
+
+    ASSET_ROOTFS = Asset(
+        'https://storage.tuxboot.com/buildroot/20241119/arm64/rootfs.ext4.zst',
+        'a1acaaae2068df4648d04ff75f532aaa8c5edcd6b936122b6f0db4848a07b465')
+
+    def test_aarch64_virt(self):
+        self.require_netdev('user')
+        self.set_machine('virt')
+        self.cpu = 'cortex-a57'
+        kernel_path = self.ASSET_KERNEL.fetch()
+
+        raw_disk = self.uncompress(self.ASSET_ROOTFS)
+        disk = self.scratch_file('scratch.qcow2')
+        qemu_img = get_qemu_img(self)
+        check_call([qemu_img, 'create', '-f', 'qcow2', '-b', raw_disk,
+                    '-F', 'raw', disk], stdout=DEVNULL, stderr=DEVNULL)
+
+        args = ('-drive', 'file=%s,snapshot=on,id=hd0,if=none' % disk,
+                '-drive', 'driver=blkreplay,id=hd0-rr,if=none,image=hd0',
+                '-device', 'virtio-blk-device,drive=hd0-rr',
+                '-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
+                '-device', 'virtio-net,netdev=vnet',
+                '-object', 'filter-replay,id=replay,netdev=vnet')
+
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'console=ttyAMA0 root=/dev/vda')
+        console_pattern = 'Welcome to TuxTest'
+        self.run_rr(kernel_path, kernel_command_line, console_pattern,
+                    args=args)
+
+
+if __name__ == '__main__':
+    ReplayKernelBase.main()