qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
	Eduardo Habkost <eduardo@habkost.net>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Michael Roth <michael.roth@amd.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Pierre Morel" <pmorel@linux.ibm.com>
Subject: Re: [PATCH v22 14/20] tests/avocado: s390x cpu topology core
Date: Fri, 08 Sep 2023 16:27:35 +0200	[thread overview]
Message-ID: <8e23251e23d5800d5b2c243e56c2d6942f162052.camel@linux.ibm.com> (raw)
In-Reply-To: <3a2b6b7c-82d1-8500-8f82-cc87b36f2152@redhat.com>

On Thu, 2023-09-07 at 10:27 +0200, Thomas Huth wrote:
> On 01/09/2023 17.58, Nina Schoetterl-Glausch wrote:
> > From: Pierre Morel <pmorel@linux.ibm.com>
> > 
> > Introduction of the s390x cpu topology core functions and
> > basic tests.
> > 
> > We test the correlation between the command line and
> > the QMP results in query-cpus-fast for various CPU topology.
> > 
> > Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> > ---
> >   MAINTAINERS                    |   1 +
> >   tests/avocado/s390_topology.py | 200 +++++++++++++++++++++++++++++++++
> >   2 files changed, 201 insertions(+)
> >   create mode 100644 tests/avocado/s390_topology.py
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 7f2937b0f2..d1b8676666 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -1703,6 +1703,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..3a54fe2e00
> > --- /dev/null
> > +++ b/tests/avocado/s390_topology.py
> > @@ -0,0 +1,200 @@

[...]

> > +    def test_default(self):
> > +        """
> > +        This test checks the implicit topology.
> > +
> > +        :avocado: tags=arch:s390x
> > +        :avocado: tags=machine:s390-ccw-virtio
> > +        """
> > +        self.kernel_init()
> > +        self.vm.add_args('-smp',
> > +                         '13,drawers=2,books=2,sockets=3,cores=2,maxcpus=24')
> > +        self.vm.launch()
> > +        self.wait_until_booted()
> > +        self.check_topology(0, 0, 0, 0, 'medium', False)
> > +        self.check_topology(1, 0, 0, 0, 'medium', False)
> > +        self.check_topology(2, 1, 0, 0, 'medium', False)
> > +        self.check_topology(3, 1, 0, 0, 'medium', False)
> > +        self.check_topology(4, 2, 0, 0, 'medium', False)
> > +        self.check_topology(5, 2, 0, 0, 'medium', False)
> > +        self.check_topology(6, 0, 1, 0, 'medium', False)
> > +        self.check_topology(7, 0, 1, 0, 'medium', False)
> > +        self.check_topology(8, 1, 1, 0, 'medium', False)
> > +        self.check_topology(9, 1, 1, 0, 'medium', False)
> > +        self.check_topology(10, 2, 1, 0, 'medium', False)
> > +        self.check_topology(11, 2, 1, 0, 'medium', False)
> > +        self.check_topology(12, 0, 0, 1, 'medium', False)
> > +
> > +    def test_move(self):
> > +        """
> > +        This test checks the topology modification by moving a CPU
> > +        to another socket: CPU 0 is moved from socket 0 to socket 2.
> > +
> > +        :avocado: tags=arch:s390x
> > +        :avocado: tags=machine:s390-ccw-virtio
> > +        """
> > +        self.kernel_init()
> > +        self.vm.add_args('-smp',
> > +                         '1,drawers=2,books=2,sockets=3,cores=2,maxcpus=24')
> > +        self.vm.launch()
> > +        self.wait_until_booted()
> > +
> > +        self.check_topology(0, 0, 0, 0, 'medium', False)
> > +        res = self.vm.qmp('set-cpu-topology',
> > +                          {'core-id': 0, 'socket-id': 2, 'entitlement': 'low'})
> > +        self.assertEqual(res['return'], {})
> > +        self.check_topology(0, 2, 0, 0, 'low', False)
> 
> Booting a Linux kernel in the guest always takes some precious seconds of 
> testing time ... I wonder whether it maybe makes sense to merge the above 
> two tests into one?

IMO it's cleaner to keep them separated.

> > +    def test_hotplug_full(self):
> > +        """
> > +        This test verifies that a hotplugged defined with '-device'
> > +        command line argument finds its right place inside the topology.
> 
> "hotplug" is normally rather a "device_add" via HMP/QMP during run-time, so 
> I'd rather avoid this term here. Maybe call it "test_device_option" or so?

I'll go with test_dash_device.

> 
> > +        :avocado: tags=arch:s390x
> > +        :avocado: tags=machine:s390-ccw-virtio
> > +        """
> > +        self.kernel_init()
> > +        self.vm.add_args('-smp',
> > +                         '1,drawers=2,books=2,sockets=3,cores=2,maxcpus=24')
> > +        self.vm.add_args('-device', 'max-s390x-cpu,core-id=10')
> > +        self.vm.add_args('-device',
> > +                         'max-s390x-cpu,'
> > +                         'core-id=1,socket-id=0,book-id=1,drawer-id=1,entitlement=low')
> > +        self.vm.add_args('-device',
> > +                         'max-s390x-cpu,'
> > +                         'core-id=2,socket-id=0,book-id=1,drawer-id=1,entitlement=medium')
> > +        self.vm.add_args('-device',
> > +                         'max-s390x-cpu,'
> > +                         'core-id=3,socket-id=1,book-id=1,drawer-id=1,entitlement=high')
> > +        self.vm.add_args('-device',
> > +                         'max-s390x-cpu,'
> > +                         'core-id=4,socket-id=1,book-id=1,drawer-id=1')
> > +        self.vm.add_args('-device',
> > +                         'max-s390x-cpu,'
> > +                         'core-id=5,socket-id=2,book-id=1,drawer-id=1,dedicated=true')
> > +
> > +        self.vm.launch()
> > +        self.wait_until_booted()
> > +
> > +        self.check_topology(10, 2, 1, 0, 'medium', False)
> > +        self.check_topology(1, 0, 1, 1, 'low', False)
> > +        self.check_topology(2, 0, 1, 1, 'medium', False)
> > +        self.check_topology(3, 1, 1, 1, 'high', False)
> > +        self.check_topology(4, 1, 1, 1, 'medium', False)
> > +        self.check_topology(5, 2, 1, 1, 'high', True)
> 
>   Thomas
> 



  reply	other threads:[~2023-09-08 14:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 15:57 [PATCH v22 00/20] s390x: CPU Topology Nina Schoetterl-Glausch
2023-09-01 15:57 ` [PATCH v22 01/20] CPU topology: extend with s390 specifics Nina Schoetterl-Glausch
2023-09-05  9:01   ` Thomas Huth
2023-09-01 15:57 ` [PATCH v22 02/20] s390x/cpu topology: add topology entries on CPU hotplug Nina Schoetterl-Glausch
2023-09-05 12:28   ` Thomas Huth
2023-09-01 15:57 ` [PATCH v22 03/20] target/s390x/cpu topology: handle STSI(15) and build the SYSIB Nina Schoetterl-Glausch
2023-09-04 18:23   ` Nina Schoetterl-Glausch
2023-09-05 13:26   ` Thomas Huth
2023-09-05 15:25     ` Nina Schoetterl-Glausch
2023-09-06  8:21       ` Thomas Huth
2023-09-06 12:12         ` Nina Schoetterl-Glausch
2023-09-06 14:53   ` Cédric Le Goater
2023-09-01 15:57 ` [PATCH v22 04/20] s390x/sclp: reporting the maximum nested topology entries Nina Schoetterl-Glausch
2023-09-01 15:57 ` [PATCH v22 05/20] s390x/cpu topology: resetting the Topology-Change-Report Nina Schoetterl-Glausch
2023-09-01 15:57 ` [PATCH v22 06/20] s390x/cpu topology: interception of PTF instruction Nina Schoetterl-Glausch
2023-09-01 15:57 ` [PATCH v22 07/20] target/s390x/cpu topology: activate CPU topology Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 08/20] qapi/s390x/cpu topology: set-cpu-topology qmp command Nina Schoetterl-Glausch
2023-09-06  8:56   ` Thomas Huth
2023-09-01 15:58 ` [PATCH v22 09/20] machine: adding s390 topology to query-cpu-fast Nina Schoetterl-Glausch
2023-09-06  9:10   ` Thomas Huth
2023-09-01 15:58 ` [PATCH v22 10/20] machine: adding s390 topology to info hotpluggable-cpus Nina Schoetterl-Glausch
2023-09-06  9:14   ` Thomas Huth
2023-09-01 15:58 ` [PATCH v22 11/20] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 12/20] qapi/s390x/cpu topology: query-cpu-polarization qmp command Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 13/20] docs/s390x/cpu topology: document s390x cpu topology Nina Schoetterl-Glausch
2023-09-07  8:15   ` Thomas Huth
2023-09-01 15:58 ` [PATCH v22 14/20] tests/avocado: s390x cpu topology core Nina Schoetterl-Glausch
2023-09-04 18:44   ` Nina Schoetterl-Glausch
2023-09-07  8:27   ` Thomas Huth
2023-09-08 14:27     ` Nina Schoetterl-Glausch [this message]
2023-09-01 15:58 ` [PATCH v22 15/20] tests/avocado: s390x cpu topology polarization Nina Schoetterl-Glausch
2023-09-04 19:43   ` Nina Schoetterl-Glausch
2023-09-07  9:02   ` Thomas Huth
2023-09-08 14:47     ` Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 16/20] tests/avocado: s390x cpu topology entitlement tests Nina Schoetterl-Glausch
2023-09-04 19:51   ` Nina Schoetterl-Glausch
2023-09-07  9:05   ` Thomas Huth
2023-09-08 18:30     ` Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 17/20] tests/avocado: s390x cpu topology test dedicated CPU Nina Schoetterl-Glausch
2023-09-04 19:54   ` Nina Schoetterl-Glausch
2023-09-07 10:08   ` Thomas Huth
2023-09-01 15:58 ` [PATCH v22 18/20] tests/avocado: s390x cpu topology test socket full Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 19/20] tests/avocado: s390x cpu topology dedicated errors Nina Schoetterl-Glausch
2023-09-01 15:58 ` [PATCH v22 20/20] tests/avocado: s390x cpu topology bad move Nina Schoetterl-Glausch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e23251e23d5800d5b2c243e56c2d6942f162052.camel@linux.ibm.com \
    --to=nsg@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=crosa@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=wangyanan55@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).