qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] tests/functional: add tests for SCLP event CPI
@ 2025-08-12 12:31 Shalini Chellathurai Saroja
  2025-08-25 11:30 ` Thomas Huth
  2025-09-11  9:05 ` Nina Schoetterl-Glausch
  0 siblings, 2 replies; 5+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-08-12 12:31 UTC (permalink / raw)
  To: qemu-s390x mailing list, Thomas Huth
  Cc: Daniel Berrange, qemu-devel mailing list, Nina Schoetterl-Glausch,
	Hendrik Brueckner, Shalini Chellathurai Saroja

Add tests for SCLP event type Control-Program Identification
(CPI) to s390x CCW virtio tests.

Please note that these tests are skipped as the guest OS does not
trigger the SCLP event type CPI when the command
'echo 1 > /sys/firmware/cpi/set' is executed in the guest. I
believe that the guest OS must to be updated to support the SCLP
event type CPI.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/test_s390x_ccw_virtio.py | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/functional/test_s390x_ccw_virtio.py b/tests/functional/test_s390x_ccw_virtio.py
index 453711aa0f..c14379cbaa 100755
--- a/tests/functional/test_s390x_ccw_virtio.py
+++ b/tests/functional/test_s390x_ccw_virtio.py
@@ -15,6 +15,7 @@
 import tempfile
 
 from qemu_test import QemuSystemTest, Asset
+from qemu_test import exec_command
 from qemu_test import exec_command_and_wait_for_pattern
 from qemu_test import wait_for_console_pattern
 
@@ -270,5 +271,28 @@ def test_s390x_fedora(self):
                         'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do'
                         ' sleep 1 ; done', 'Start virtcrypto_remove.')
 
+        # Test SCLP event Control-Program Identification (CPI)
+        cpi = '/sys/firmware/cpi/'
+        sclpcpi = '/machine/sclp/s390-sclp-event-facility/sclpcpi'
+        self.log.info("Test SCLP event CPI")
+        exec_command(self, 'echo TESTVM > ' + cpi + 'system_name')
+        exec_command(self, 'echo LINUX > ' + cpi + 'system_type')
+        exec_command(self, 'echo TESTPLEX > ' + cpi + 'sysplex_name')
+        exec_command(self, 'echo 1 > ' + cpi + 'set')
+        try:
+            event = self.vm.event_wait('SCLP_EVENT_CTRL_PGM_ID')
+        except TimeoutError:
+            self.skipTest('SCLP Event type CPI is not supported by guest OS')
+        ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp')
+        self.assertNotEqual(int(ts), 0)
+        name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
+        self.assertEqual(name, 'TESTVM')
+        typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type')
+        self.assertEqual(typ, 'LINUX')
+        sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name')
+        self.assertEqual(sysplex, 'TESTPLEX')
+        level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level')
+        self.assertNotEqual(int(level), 0)
+
 if __name__ == '__main__':
     QemuSystemTest.main()
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] tests/functional: add tests for SCLP event CPI
  2025-08-12 12:31 [PATCH RFC] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
@ 2025-08-25 11:30 ` Thomas Huth
  2025-10-13 13:37   ` Shalini Chellathurai Saroja
  2025-09-11  9:05 ` Nina Schoetterl-Glausch
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2025-08-25 11:30 UTC (permalink / raw)
  To: Shalini Chellathurai Saroja, qemu-s390x mailing list
  Cc: Daniel Berrange, qemu-devel mailing list, Nina Schoetterl-Glausch,
	Hendrik Brueckner

On 12/08/2025 14.31, Shalini Chellathurai Saroja wrote:
> Add tests for SCLP event type Control-Program Identification
> (CPI) to s390x CCW virtio tests.
> 
> Please note that these tests are skipped as the guest OS does not
> trigger the SCLP event type CPI when the command
> 'echo 1 > /sys/firmware/cpi/set' is executed in the guest. I
> believe that the guest OS must to be updated to support the SCLP
> event type CPI.
> 
> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> ---
...
> +        try:
> +            event = self.vm.event_wait('SCLP_EVENT_CTRL_PGM_ID')

As far as I can tell, SCLP_EVENT_CTRL_PGM_ID is an *SCLP* event only, but 
you're trying to wait for a *QAPI* event here instead. That's two completely 
different things, SCLP events are something between the guest and QEMU, 
while QAPI events are between QEMU and the monitoring program (i.e. in this 
case the test).

If you want that QEMU generates such QAPI events for the monitoring program, 
you have to do something similar to commit 1cfe52b78240679 and add the 
qapi_event_send_... function to the right spot in your code.

  HTH,
   Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] tests/functional: add tests for SCLP event CPI
  2025-08-12 12:31 [PATCH RFC] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
  2025-08-25 11:30 ` Thomas Huth
@ 2025-09-11  9:05 ` Nina Schoetterl-Glausch
  2025-09-11  9:21   ` Thomas Huth
  1 sibling, 1 reply; 5+ messages in thread
From: Nina Schoetterl-Glausch @ 2025-09-11  9:05 UTC (permalink / raw)
  To: Shalini Chellathurai Saroja, qemu-s390x mailing list, Thomas Huth
  Cc: Daniel Berrange, qemu-devel mailing list, Hendrik Brueckner

On Tue, 2025-08-12 at 14:31 +0200, Shalini Chellathurai Saroja wrote:
> Add tests for SCLP event type Control-Program Identification
> (CPI) to s390x CCW virtio tests.
> 
> Please note that these tests are skipped as the guest OS does not
> trigger the SCLP event type CPI when the command
> 'echo 1 > /sys/firmware/cpi/set' is executed in the guest. I
> believe that the guest OS must to be updated to support the SCLP
> event type CPI.
> 
> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/functional/test_s390x_ccw_virtio.py | 24 +++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/tests/functional/test_s390x_ccw_virtio.py b/tests/functional/test_s390x_ccw_virtio.py
> index 453711aa0f..c14379cbaa 100755
> --- a/tests/functional/test_s390x_ccw_virtio.py
> +++ b/tests/functional/test_s390x_ccw_virtio.py

Is this the best file to put it?
It seems mostly to be about device testing.

> @@ -15,6 +15,7 @@
>  import tempfile
>  
>  from qemu_test import QemuSystemTest, Asset
> +from qemu_test import exec_command
>  from qemu_test import exec_command_and_wait_for_pattern
>  from qemu_test import wait_for_console_pattern
>  
> @@ -270,5 +271,28 @@ def test_s390x_fedora(self):
>                          'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do'
>                          ' sleep 1 ; done', 'Start virtcrypto_remove.')
>  
> +        # Test SCLP event Control-Program Identification (CPI)
> +        cpi = '/sys/firmware/cpi/'
> +        sclpcpi = '/machine/sclp/s390-sclp-event-facility/sclpcpi'
> +        self.log.info("Test SCLP event CPI")
> +        exec_command(self, 'echo TESTVM > ' + cpi + 'system_name')
> +        exec_command(self, 'echo LINUX > ' + cpi + 'system_type')
> +        exec_command(self, 'echo TESTPLEX > ' + cpi + 'sysplex_name')
> +        exec_command(self, 'echo 1 > ' + cpi + 'set')
> +        try:
> +            event = self.vm.event_wait('SCLP_EVENT_CTRL_PGM_ID')
> +        except TimeoutError:
> +            self.skipTest('SCLP Event type CPI is not supported by guest OS')
> +        ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp')
> +        self.assertNotEqual(int(ts), 0)
> +        name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
> +        self.assertEqual(name, 'TESTVM')
> +        typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type')
> +        self.assertEqual(typ, 'LINUX')
> +        sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name')
> +        self.assertEqual(sysplex, 'TESTPLEX')
> +        level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level')
> +        self.assertNotEqual(int(level), 0)
> +
>  if __name__ == '__main__':
>      QemuSystemTest.main()

-- 
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] tests/functional: add tests for SCLP event CPI
  2025-09-11  9:05 ` Nina Schoetterl-Glausch
@ 2025-09-11  9:21   ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2025-09-11  9:21 UTC (permalink / raw)
  To: Nina Schoetterl-Glausch, Shalini Chellathurai Saroja,
	qemu-s390x mailing list
  Cc: Daniel Berrange, qemu-devel mailing list, Hendrik Brueckner

On 11/09/2025 11.05, Nina Schoetterl-Glausch wrote:
> On Tue, 2025-08-12 at 14:31 +0200, Shalini Chellathurai Saroja wrote:
>> Add tests for SCLP event type Control-Program Identification
>> (CPI) to s390x CCW virtio tests.
>>
>> Please note that these tests are skipped as the guest OS does not
>> trigger the SCLP event type CPI when the command
>> 'echo 1 > /sys/firmware/cpi/set' is executed in the guest. I
>> believe that the guest OS must to be updated to support the SCLP
>> event type CPI.
>>
>> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
>> Suggested-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   tests/functional/test_s390x_ccw_virtio.py | 24 +++++++++++++++++++++++
>>   1 file changed, 24 insertions(+)
>>
>> diff --git a/tests/functional/test_s390x_ccw_virtio.py b/tests/functional/test_s390x_ccw_virtio.py
>> index 453711aa0f..c14379cbaa 100755
>> --- a/tests/functional/test_s390x_ccw_virtio.py
>> +++ b/tests/functional/test_s390x_ccw_virtio.py
> 
> Is this the best file to put it?
> It seems mostly to be about device testing.

It's meant as generic testing of the s390-virtio-ccw machine. Of course, the 
CPI testing could also be done in a separate file, but that means that you 
have to go through booting of the guest there again ... so I'd rather prefer 
to keep it here, so we only have to boot the guest once.

  Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] tests/functional: add tests for SCLP event CPI
  2025-08-25 11:30 ` Thomas Huth
@ 2025-10-13 13:37   ` Shalini Chellathurai Saroja
  0 siblings, 0 replies; 5+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-13 13:37 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-s390x mailing list, Daniel Berrange, qemu-devel mailing list,
	Nina Schoetterl-Glausch, Hendrik Brueckner

On 2025-08-25 13:30, Thomas Huth wrote:
> On 12/08/2025 14.31, Shalini Chellathurai Saroja wrote:
>> Add tests for SCLP event type Control-Program Identification
>> (CPI) to s390x CCW virtio tests.
>> 
>> Please note that these tests are skipped as the guest OS does not
>> trigger the SCLP event type CPI when the command
>> 'echo 1 > /sys/firmware/cpi/set' is executed in the guest. I
>> believe that the guest OS must to be updated to support the SCLP
>> event type CPI.
>> 
>> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
>> Suggested-by: Thomas Huth <thuth@redhat.com>
>> ---
> ...
>> +        try:
>> +            event = self.vm.event_wait('SCLP_EVENT_CTRL_PGM_ID')
> 
> As far as I can tell, SCLP_EVENT_CTRL_PGM_ID is an *SCLP* event only,
> but you're trying to wait for a *QAPI* event here instead. That's two
> completely different things, SCLP events are something between the
> guest and QEMU, while QAPI events are between QEMU and the monitoring
> program (i.e. in this case the test).
> 
> If you want that QEMU generates such QAPI events for the monitoring
> program, you have to do something similar to commit 1cfe52b78240679
> and add the qapi_event_send_... function to the right spot in your
> code.
> 

Hello Thomas,

I have added the QAPI event and have sent the v2 of this patch.
Thank you very much.


>  HTH,
>   Thomas

-- 
Mit freundlichen Grüßen / Kind regards
Shalini Chellathurai Saroja
Software Developer
Linux on IBM Z & KVM Development
IBM Deutschland Research & Development GmbH
Dept 1419, Schoenaicher Str. 220, 71032 Boeblingen
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht 
Stuttgart, HRB 243294


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-13 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 12:31 [PATCH RFC] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
2025-08-25 11:30 ` Thomas Huth
2025-10-13 13:37   ` Shalini Chellathurai Saroja
2025-09-11  9:05 ` Nina Schoetterl-Glausch
2025-09-11  9:21   ` Thomas Huth

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).