On 7/4/23 15:14, Thomas Huth wrote:
On 30/06/2023 11.17, Pierre Morel wrote:
Introduction of the s390x cpu topology core functions and
basic tests.
We test the corelation between the command line and
the QMP results in query-cpus-fast for various CPU topology.
Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
MAINTAINERS | 1 +
tests/avocado/s390_topology.py | 196 +++++++++++++++++++++++++++++++++
2 files changed, 197 insertions(+)
create mode 100644 tests/avocado/s390_topology.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 76f236564c..12d0d7bd91 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1705,6 +1705,7 @@ F: hw/s390x/cpu-topology.c
F: target/s390x/kvm/stsi-topology.c
F: docs/devel/s390-cpu-topology.rst
F: docs/system/s390x/cpu-topology.rst
+F: tests/avocado/s390_topology.py
X86 Machines
------------
diff --git a/tests/avocado/s390_topology.py
b/tests/avocado/s390_topology.py
new file mode 100644
index 0000000000..1758ec1f13
--- /dev/null
+++ b/tests/avocado/s390_topology.py
@@ -0,0 +1,196 @@
+# Functional test that boots a Linux kernel and checks the console
+#
+# Copyright IBM Corp. 2023
+#
+# Author:
+# Pierre Morel <pmorel@xxxxxxxxxxxxx>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+import os
+import shutil
+import time
+
+from avocado_qemu import QemuSystemTest
+from avocado_qemu import exec_command
+from avocado_qemu import exec_command_and_wait_for_pattern
+from avocado_qemu import interrupt_interactive_console_until_pattern
+from avocado_qemu import wait_for_console_pattern
+from avocado.utils import process
+from avocado.utils import archive
+
+
+class S390CPUTopology(QemuSystemTest):
+ """
+ S390x CPU topology consist of 4 topology layers, from bottom to
top,
+ the cores, sockets, books and drawers and 2 modifiers attributes,
+ the entitlement and the dedication.
+ See: docs/system/s390x/cpu-topology.rst.
+
+ S390x CPU topology is setup in different ways:
+ - implicitely from the '-smp' argument by completing each topology
implicitly
+ level one after the other begining with drawer 0, book 0 and
socket 0.
beginning
+ - explicitely from the '-device' argument on the QEMU command line
explicitly
+ - explicitely by hotplug of a new CPU using QMP or HMP
explicitly
Thomas
Thanks, I make the corrections.
Pierre