tests/functional: Convert ARM Raspi2 avocado tests

Straight forward conversion. Update the SHA1 hashes to SHA256
hashes since SHA1 should not be used anymore nowadays.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240826221058.75126-3-philmd@linaro.org>
[thuth: Use LinuxKernelTest class]
Message-ID: <20240906180549.792832-10-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2024-09-06 20:05:44 +02:00 committed by Thomas Huth
parent 79cb4a14cb
commit 165ab27447
4 changed files with 97 additions and 85 deletions

View file

@ -203,91 +203,6 @@ class BootLinuxConsole(LinuxKernelTest):
exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2',
'3 packets transmitted, 3 packets received, 0% packet loss')
def do_test_arm_raspi2(self, uart_id):
"""
:avocado: tags=accel:tcg
The kernel can be rebuilt using the kernel source referenced
and following the instructions on the on:
https://www.raspberrypi.org/documentation/linux/kernel/building.md
"""
serial_kernel_cmdline = {
0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
}
deb_url = ('http://archive.raspberrypi.org/debian/'
'pool/main/r/raspberrypi-firmware/'
'raspberrypi-kernel_1.20190215-1_armhf.deb')
deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
self.vm.set_console()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
serial_kernel_cmdline[uart_id] +
' root=/dev/mmcblk0p2 rootwait ' +
'dwc_otg.fiq_fsm_enable=0')
self.vm.add_args('-kernel', kernel_path,
'-dtb', dtb_path,
'-append', kernel_command_line,
'-device', 'usb-kbd')
self.vm.launch()
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)
console_pattern = 'Product: QEMU USB Keyboard'
self.wait_for_console_pattern(console_pattern)
def test_arm_raspi2_uart0(self):
"""
:avocado: tags=arch:arm
:avocado: tags=machine:raspi2b
:avocado: tags=device:pl011
:avocado: tags=accel:tcg
"""
self.do_test_arm_raspi2(0)
def test_arm_raspi2_initrd(self):
"""
:avocado: tags=arch:arm
:avocado: tags=machine:raspi2b
"""
deb_url = ('http://archive.raspberrypi.org/debian/'
'pool/main/r/raspberrypi-firmware/'
'raspberrypi-kernel_1.20190215-1_armhf.deb')
deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
'2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
'arm/rootfs-armv7a.cpio.gz')
initrd_hash = '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
archive.gzip_uncompress(initrd_path_gz, initrd_path)
self.vm.set_console()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
'earlycon=pl011,0x3f201000 console=ttyAMA0 '
'panic=-1 noreboot ' +
'dwc_otg.fiq_fsm_enable=0')
self.vm.add_args('-kernel', kernel_path,
'-dtb', dtb_path,
'-initrd', initrd_path,
'-append', kernel_command_line,
'-no-reboot')
self.vm.launch()
self.wait_for_console_pattern('Boot successful.')
exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
'BCM2835')
exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
'/soc/cprman@7e101000')
exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted')
# Wait for VM to shut down gracefully
self.vm.wait()
def test_arm_raspi4(self):
"""
:avocado: tags=arch:aarch64