1 # Functional test that boots a microblaze Linux kernel and checks the console
3 # Copyright (c) 2018, 2021 Red Hat, Inc.
5 # This work is licensed under the terms of the GNU GPL, version 2 or
6 # later. See the COPYING file in the top-level directory.
9 from avocado_qemu
import exec_command
, exec_command_and_wait_for_pattern
10 from avocado_qemu
import QemuSystemTest
11 from avocado_qemu
import wait_for_console_pattern
12 from avocado
.utils
import archive
14 class MicroblazeMachine(QemuSystemTest
):
18 def test_microblaze_s3adsp1800(self
):
20 :avocado: tags=arch:microblaze
21 :avocado: tags=machine:petalogix-s3adsp1800
24 tar_url
= ('https://qemu-advcal.gitlab.io'
25 '/qac-best-of-multiarch/download/day17.tar.xz')
26 tar_hash
= '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f'
27 file_path
= self
.fetch_asset(tar_url
, asset_hash
=tar_hash
)
28 archive
.extract(file_path
, self
.workdir
)
30 self
.vm
.add_args('-kernel', self
.workdir
+ '/day17/ballerina.bin')
32 wait_for_console_pattern(self
, 'This architecture does not have '
33 'kernel memory protection')
35 # The kernel sometimes gets stuck after the "This architecture ..."
36 # message, that's why we don't test for a later string here. This
37 # needs some investigation by a microblaze wizard one day...
39 def test_microblazeel_s3adsp1800(self
):
41 :avocado: tags=arch:microblazeel
42 :avocado: tags=machine:petalogix-s3adsp1800
45 self
.require_netdev('user')
46 tar_url
= ('http://www.qemu-advent-calendar.org/2023/download/'
48 tar_hash
= '6623d5fff5f84cfa8f34e286f32eff6a26546f44'
49 file_path
= self
.fetch_asset(tar_url
, asset_hash
=tar_hash
)
50 archive
.extract(file_path
, self
.workdir
)
52 self
.vm
.add_args('-kernel', self
.workdir
+ '/day13/xmaton.bin')
53 self
.vm
.add_args('-nic', 'user,tftp=' + self
.workdir
+ '/day13/')
55 wait_for_console_pattern(self
, 'QEMU Advent Calendar 2023')
57 exec_command(self
, 'root')
59 exec_command_and_wait_for_pattern(self
,
60 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
61 '821cd3cab8efd16ad6ee5acc3642a8ea')