On 26/03/2025 10.30, Daniel P. Berrangé wrote:
On Tue, Mar 25, 2025 at 09:00:11PM +0100, Thomas Huth wrote:
From: Thomas Huth <th...@redhat.com>
These tests are using the gdb-related library functions from the
Avocado framework which we don't have in the functional framework
yet. So for the time being, keep those imports and skip the test
if the Avocado framework is not installed on the host.
Signed-off-by: Thomas Huth <th...@redhat.com>
---
MAINTAINERS | 2 +-
tests/functional/meson.build | 4 +
.../reverse_debugging.py | 114 +++---------------
.../functional/test_aarch64_reverse_debug.py | 37 ++++++
tests/functional/test_ppc64_reverse_debug.py | 41 +++++++
tests/functional/test_x86_64_reverse_debug.py | 36 ++++++
6 files changed, 138 insertions(+), 96 deletions(-)
rename tests/{avocado => functional}/reverse_debugging.py (66%)
create mode 100755 tests/functional/test_aarch64_reverse_debug.py
create mode 100755 tests/functional/test_ppc64_reverse_debug.py
create mode 100755 tests/functional/test_x86_64_reverse_debug.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 8f470a1c9b7..73ccf5e5176 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3670,7 +3670,7 @@ F: docs/system/replay.rst
F: stubs/replay.c
F: tests/avocado/replay_kernel.py
F: tests/avocado/replay_linux.py
-F: tests/avocado/reverse_debugging.py
+F: tests/functional/*reverse_debug*.py
F: tests/functional/*replay*.py
F: qapi/replay.json
diff --git a/tests/functional/test_aarch64_reverse_debug.py
b/tests/functional/test_aarch64_reverse_debug.py
new file mode 100755
index 00000000000..82925bf5908
--- /dev/null
+++ b/tests/functional/test_aarch64_reverse_debug.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Reverse debugging test
+#
+# Copyright (c) 2020 ISP RAS
+#
+# Author:
+# Pavel Dovgalyuk <pavel.dovgal...@ispras.ru>
+#
+# 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
+from reverse_debugging import ReverseDebugging
+
+
+@skipIfMissingImports('avocado')
Would it make sense to specialize this to 'avocado.utils' ?
Sure, can do!
+class ReverseDebugging_AArch64(ReverseDebugging):
+
+ REG_PC = 32
+
+ KERNEL_ASSET = Asset(
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
+ 'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'),
+ '7e1430b81c26bdd0da025eeb8fbd77b5dc961da4364af26e771bd39f379cbbf7')
+
+ def test_aarch64_virt(self):
+ self.set_machine('virt')
+ self.cpu = 'cortex-a53'
+ kernel_path = self.KERNEL_ASSET.fetch()
+ self.reverse_debugging(args=('-kernel', kernel_path))
+
+
+if __name__ == '__main__':
+ ReverseDebugging.main()
diff --git a/tests/functional/test_x86_64_reverse_debug.py
b/tests/functional/test_x86_64_reverse_debug.py
new file mode 100755
index 00000000000..aba31f68748
--- /dev/null
+++ b/tests/functional/test_x86_64_reverse_debug.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Reverse debugging test
+#
+# Copyright (c) 2020 ISP RAS
+#
+# Author:
+# Pavel Dovgalyuk <pavel.dovgal...@ispras.ru>
+#
+# 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 reverse_debugging import ReverseDebugging
+
+
+@skipIfMissingImports('avocado')
+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/1992")
This bug refers to ppc64. Was this a copy and paste mistake, does
that bug need updating to also mention x86_64 ?
I'm not sure whether it's the same bug, so I opened another one for x86 here:
https://gitlab.com/qemu-project/qemu/-/issues/2922
I also noticed that it fails on aarch64 in some rare cases, and in a
different way. So here's another bug for aarch64:
https://gitlab.com/qemu-project/qemu/-/issues/2921
I'll use those in the decorators in the next version of the patch.
Thomas