Skip to content

Commit

Permalink
tests/avocado: s390x cpu topology test dedicated CPU
Browse files Browse the repository at this point in the history
A dedicated CPU in vertical polarization can only have
a high entitlement.
Let's check this from both host and guest point of view.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Message-ID: <20231016183925.2384704-19-nsg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
Pierre Morel authored and huth committed Oct 20, 2023
1 parent 16ab722 commit 471676b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/avocado/s390_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,36 @@ def test_entitlement(self):
self.guest_set_dispatching('0');
self.check_polarization("horizontal")
self.check_topology(0, 0, 0, 0, 'high', False)


def test_dedicated(self):
"""
This test verifies that QEMU adjusts the entitlement correctly when a
CPU is made dedicated.
QEMU retains the entitlement value when horizontal polarization is in effect.
For the guest, the field shows the effective value of the entitlement.
:avocado: tags=arch:s390x
:avocado: tags=machine:s390-ccw-virtio
"""
self.kernel_init()
self.vm.launch()
self.wait_until_booted()

self.system_init()

self.check_polarization("horizontal")

res = self.vm.qmp('set-cpu-topology',
{'core-id': 0, 'dedicated': True})
self.assertEqual(res['return'], {})
self.check_topology(0, 0, 0, 0, 'high', True)
self.check_polarization("horizontal")

self.guest_set_dispatching('1');
self.check_topology(0, 0, 0, 0, 'high', True)
self.check_polarization("vertical:high")

self.guest_set_dispatching('0');
self.check_topology(0, 0, 0, 0, 'high', True)
self.check_polarization("horizontal")

0 comments on commit 471676b

Please sign in to comment.