tests/functional: Adapt arches to reverse_debugging w/o Avocado

reverse_debugging no longer depends on Avocado, so remove the import
checks for Avocado, the per-arch endianness tweaks, and the per-arch
register settings. All of these are now handled in the ReverseDebugging
class, automatically.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-ID: <20251003141820.85278-10-gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Gustavo Romero 2025-10-03 14:18:20 +00:00 committed by Alex Bennée
parent bddce21619
commit 4d3eb329cc
3 changed files with 16 additions and 25 deletions

View file

@ -2,25 +2,24 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Reverse debugging test
# Reverse debugging test for aarch64
#
# Copyright (c) 2020 ISP RAS
# Copyright (c) 2025 Linaro Limited
#
# Author:
# Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
# Gustavo Romero <gustavo.romero@linaro.org> (Run without Avocado)
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
from qemu_test import Asset, skipIfMissingImports, skipFlakyTest
from qemu_test import Asset, skipFlakyTest
from reverse_debugging import ReverseDebugging
@skipIfMissingImports('avocado.utils')
class ReverseDebugging_AArch64(ReverseDebugging):
REG_PC = 32
ASSET_KERNEL = Asset(
('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'),
@ -31,7 +30,7 @@ class ReverseDebugging_AArch64(ReverseDebugging):
self.set_machine('virt')
self.cpu = 'cortex-a53'
kernel_path = self.ASSET_KERNEL.fetch()
self.reverse_debugging(args=('-kernel', kernel_path))
self.reverse_debugging(gdb_arch='aarch64', args=('-kernel', kernel_path))
if __name__ == '__main__':

View file

@ -2,39 +2,36 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Reverse debugging test
# Reverse debugging test for ppc64
#
# Copyright (c) 2020 ISP RAS
# Copyright (c) 2025 Linaro Limited
#
# Author:
# Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
# Gustavo Romero <gustavo.romero@linaro.org> (Run without Avocado)
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
from qemu_test import skipIfMissingImports, skipFlakyTest
from qemu_test import skipFlakyTest
from reverse_debugging import ReverseDebugging
@skipIfMissingImports('avocado.utils')
class ReverseDebugging_ppc64(ReverseDebugging):
REG_PC = 0x40
@skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/1992")
def test_ppc64_pseries(self):
self.set_machine('pseries')
# SLOF branches back to its entry point, which causes this test
# to take the 'hit a breakpoint again' path. That's not a problem,
# just slightly different than the other machines.
self.endian_is_le = False
self.reverse_debugging()
self.reverse_debugging(gdb_arch='powerpc:common64')
@skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/1992")
def test_ppc64_powernv(self):
self.set_machine('powernv')
self.endian_is_le = False
self.reverse_debugging()
self.reverse_debugging(gdb_arch='powerpc:common64')
if __name__ == '__main__':

View file

@ -2,34 +2,29 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Reverse debugging test
# Reverse debugging test for x86_64
#
# Copyright (c) 2020 ISP RAS
# Copyright (c) 2025 Linaro Limited
#
# Author:
# Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
# Gustavo Romero <gustavo.romero@linaro.org> (Run without Avocado)
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
from qemu_test import skipIfMissingImports, skipFlakyTest
from qemu_test import skipFlakyTest
from reverse_debugging import ReverseDebugging
@skipIfMissingImports('avocado.utils')
class ReverseDebugging_X86_64(ReverseDebugging):
REG_PC = 0x10
REG_CS = 0x12
def get_pc(self, g):
return self.get_reg_le(g, self.REG_PC) \
+ self.get_reg_le(g, self.REG_CS) * 0x10
@skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2922")
def test_x86_64_pc(self):
self.set_machine('pc')
# start with BIOS only
self.reverse_debugging()
self.reverse_debugging(gdb_arch='x86-64')
if __name__ == '__main__':