* [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI
2025-10-13 13:32 Shalini Chellathurai Saroja
@ 2025-10-13 13:32 ` Shalini Chellathurai Saroja
0 siblings, 0 replies; 7+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-13 13:32 UTC (permalink / raw)
To: qemu-s390x mailing list, Thomas Huth
Cc: Sebastian Mitterle, qemu-devel mailing list,
Nina Schoetterl-Glausch, Hendrik Brueckner,
Shalini Chellathurai Saroja, Michael Mueller
Add tests for SCLP event type Control-Program Identification.
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/s390x/test_ccw_virtio.py | 25 +++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tests/functional/s390x/test_ccw_virtio.py b/tests/functional/s390x/test_ccw_virtio.py
index 453711aa0f..82e73ecf5e 100755
--- a/tests/functional/s390x/test_ccw_virtio.py
+++ b/tests/functional/s390x/test_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,29 @@ 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 0x001a000000060b00 > ' + cpi + 'system_level')
+ exec_command(self, 'echo 1 > ' + cpi + 'set')
+ try:
+ event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE')
+ except TimeoutError:
+ self.skipTest('SCLP Event type CPI is not supported')
+ ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp')
+ self.assertNotEqual(ts, 0)
+ name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
+ self.assertEqual(name.strip(), 'TESTVM')
+ typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type')
+ self.assertEqual(typ.strip(), 'LINUX')
+ sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name')
+ self.assertEqual(sysplex.strip(), 'TESTPLEX')
+ level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level')
+ self.assertEqual(level, 0x001a000000060b00)
+
if __name__ == '__main__':
QemuSystemTest.main()
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE
@ 2025-10-13 13:39 Shalini Chellathurai Saroja
2025-10-13 13:39 ` [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
2025-10-13 16:50 ` [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Nina Schoetterl-Glausch
0 siblings, 2 replies; 7+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-13 13:39 UTC (permalink / raw)
To: qemu-s390x mailing list, Thomas Huth
Cc: Sebastian Mitterle, qemu-devel mailing list,
Nina Schoetterl-Glausch, Hendrik Brueckner,
Shalini Chellathurai Saroja, Michael Mueller
Add QAPI event SCLP_CPI_INFO_AVAILABLE to notify the availability
of Control-Program Identification data in QOM.
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/sclpcpi.c | 4 ++++
qapi/machine-s390x.json | 25 +++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c
index 7aa039d510..90da61b1c8 100644
--- a/hw/s390x/sclpcpi.c
+++ b/hw/s390x/sclpcpi.c
@@ -54,6 +54,7 @@
#include "hw/s390x/event-facility.h"
#include "hw/s390x/ebcdic.h"
#include "qapi/qapi-visit-machine.h"
+#include "qapi/qapi-events-machine-s390x.h"
#include "migration/vmstate.h"
typedef struct Data {
@@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr)
e->timestamp = qemu_clock_get_ns(QEMU_CLOCK_HOST);
cpim->ebh.flags = SCLP_EVENT_BUFFER_ACCEPTED;
+
+ qapi_event_send_sclp_cpi_info_available(true);
+
return SCLP_RC_NORMAL_COMPLETION;
}
diff --git a/qapi/machine-s390x.json b/qapi/machine-s390x.json
index 966dbd61d2..338653e0b8 100644
--- a/qapi/machine-s390x.json
+++ b/qapi/machine-s390x.json
@@ -119,3 +119,28 @@
{ 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo',
'features': [ 'unstable' ]
}
+
+##
+# @SCLP_CPI_INFO_AVAILABLE:
+#
+# Emitted when the Control-Program Identification data is available
+# in the QOM tree.
+#
+# @iscpiavailable: is CPI data available in QOM
+#
+# Features:
+#
+# @unstable: This event is experimental.
+#
+# Since: 10.2
+#
+# .. qmp-example::
+#
+# <- { "event": "SCLP_CPI_INFO_AVAILABLE",
+# "data": { "iscpiavailable": true },
+# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
+##
+{ 'event': 'SCLP_CPI_INFO_AVAILABLE',
+ 'data': { 'iscpiavailable': 'bool' },
+ 'features': [ 'unstable' ]
+}
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI
2025-10-13 13:39 [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Shalini Chellathurai Saroja
@ 2025-10-13 13:39 ` Shalini Chellathurai Saroja
2025-10-16 7:17 ` Thomas Huth
2025-10-13 16:50 ` [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Nina Schoetterl-Glausch
1 sibling, 1 reply; 7+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-13 13:39 UTC (permalink / raw)
To: qemu-s390x mailing list, Thomas Huth
Cc: Sebastian Mitterle, qemu-devel mailing list,
Nina Schoetterl-Glausch, Hendrik Brueckner,
Shalini Chellathurai Saroja, Michael Mueller
Add tests for SCLP event type Control-Program Identification.
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/s390x/test_ccw_virtio.py | 25 +++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tests/functional/s390x/test_ccw_virtio.py b/tests/functional/s390x/test_ccw_virtio.py
index 453711aa0f..82e73ecf5e 100755
--- a/tests/functional/s390x/test_ccw_virtio.py
+++ b/tests/functional/s390x/test_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,29 @@ 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 0x001a000000060b00 > ' + cpi + 'system_level')
+ exec_command(self, 'echo 1 > ' + cpi + 'set')
+ try:
+ event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE')
+ except TimeoutError:
+ self.skipTest('SCLP Event type CPI is not supported')
+ ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp')
+ self.assertNotEqual(ts, 0)
+ name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
+ self.assertEqual(name.strip(), 'TESTVM')
+ typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type')
+ self.assertEqual(typ.strip(), 'LINUX')
+ sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name')
+ self.assertEqual(sysplex.strip(), 'TESTPLEX')
+ level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level')
+ self.assertEqual(level, 0x001a000000060b00)
+
if __name__ == '__main__':
QemuSystemTest.main()
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE
2025-10-13 13:39 [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Shalini Chellathurai Saroja
2025-10-13 13:39 ` [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
@ 2025-10-13 16:50 ` Nina Schoetterl-Glausch
2025-10-14 8:45 ` Shalini Chellathurai Saroja
1 sibling, 1 reply; 7+ messages in thread
From: Nina Schoetterl-Glausch @ 2025-10-13 16:50 UTC (permalink / raw)
To: Shalini Chellathurai Saroja, qemu-s390x mailing list, Thomas Huth
Cc: Sebastian Mitterle, qemu-devel mailing list, Hendrik Brueckner,
Michael Mueller
On Mon, 2025-10-13 at 15:39 +0200, Shalini Chellathurai Saroja wrote:
> Add QAPI event SCLP_CPI_INFO_AVAILABLE to notify the availability
> of Control-Program Identification data in QOM.
>
> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/sclpcpi.c | 4 ++++
> qapi/machine-s390x.json | 25 +++++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
> diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c
> index 7aa039d510..90da61b1c8 100644
> --- a/hw/s390x/sclpcpi.c
> +++ b/hw/s390x/sclpcpi.c
> @@ -54,6 +54,7 @@
> #include "hw/s390x/event-facility.h"
> #include "hw/s390x/ebcdic.h"
> #include "qapi/qapi-visit-machine.h"
> +#include "qapi/qapi-events-machine-s390x.h"
> #include "migration/vmstate.h"
>
> typedef struct Data {
> @@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr)
> e->timestamp = qemu_clock_get_ns(QEMU_CLOCK_HOST);
>
> cpim->ebh.flags = SCLP_EVENT_BUFFER_ACCEPTED;
> +
> + qapi_event_send_sclp_cpi_info_available(true);
> +
> return SCLP_RC_NORMAL_COMPLETION;
> }
>
> diff --git a/qapi/machine-s390x.json b/qapi/machine-s390x.json
> index 966dbd61d2..338653e0b8 100644
> --- a/qapi/machine-s390x.json
> +++ b/qapi/machine-s390x.json
> @@ -119,3 +119,28 @@
> { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo',
> 'features': [ 'unstable' ]
> }
> +
> +##
> +# @SCLP_CPI_INFO_AVAILABLE:
> +#
> +# Emitted when the Control-Program Identification data is available
> +# in the QOM tree.
> +#
> +# @iscpiavailable: is CPI data available in QOM
> +#
> +# Features:
> +#
> +# @unstable: This event is experimental.
> +#
> +# Since: 10.2
> +#
> +# .. qmp-example::
> +#
> +# <- { "event": "SCLP_CPI_INFO_AVAILABLE",
> +# "data": { "iscpiavailable": true },
> +# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
> +##
> +{ 'event': 'SCLP_CPI_INFO_AVAILABLE',
> + 'data': { 'iscpiavailable': 'bool' },
What is the point of this payload?
> + 'features': [ 'unstable' ]
> +}
--
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] 7+ messages in thread
* Re: [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE
2025-10-13 16:50 ` [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Nina Schoetterl-Glausch
@ 2025-10-14 8:45 ` Shalini Chellathurai Saroja
0 siblings, 0 replies; 7+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-14 8:45 UTC (permalink / raw)
To: Nina Schoetterl-Glausch
Cc: qemu-s390x mailing list, Thomas Huth, Sebastian Mitterle,
qemu-devel mailing list, Hendrik Brueckner, Michael Mueller
On 2025-10-13 18:50, Nina Schoetterl-Glausch wrote:
> On Mon, 2025-10-13 at 15:39 +0200, Shalini Chellathurai Saroja wrote:
>> Add QAPI event SCLP_CPI_INFO_AVAILABLE to notify the availability
>> of Control-Program Identification data in QOM.
>>
>> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
>> Suggested-by: Thomas Huth <thuth@redhat.com>
>> ---
>> hw/s390x/sclpcpi.c | 4 ++++
>> qapi/machine-s390x.json | 25 +++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+)
>>
>> diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c
>> index 7aa039d510..90da61b1c8 100644
>> --- a/hw/s390x/sclpcpi.c
>> +++ b/hw/s390x/sclpcpi.c
>> @@ -54,6 +54,7 @@
>> #include "hw/s390x/event-facility.h"
>> #include "hw/s390x/ebcdic.h"
>> #include "qapi/qapi-visit-machine.h"
>> +#include "qapi/qapi-events-machine-s390x.h"
>> #include "migration/vmstate.h"
>>
>> typedef struct Data {
>> @@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event,
>> EventBufferHeader *evt_buf_hdr)
>> e->timestamp = qemu_clock_get_ns(QEMU_CLOCK_HOST);
>>
>> cpim->ebh.flags = SCLP_EVENT_BUFFER_ACCEPTED;
>> +
>> + qapi_event_send_sclp_cpi_info_available(true);
>> +
>> return SCLP_RC_NORMAL_COMPLETION;
>> }
>>
>> diff --git a/qapi/machine-s390x.json b/qapi/machine-s390x.json
>> index 966dbd61d2..338653e0b8 100644
>> --- a/qapi/machine-s390x.json
>> +++ b/qapi/machine-s390x.json
>> @@ -119,3 +119,28 @@
>> { 'command': 'query-s390x-cpu-polarization', 'returns':
>> 'CpuPolarizationInfo',
>> 'features': [ 'unstable' ]
>> }
>> +
>> +##
>> +# @SCLP_CPI_INFO_AVAILABLE:
>> +#
>> +# Emitted when the Control-Program Identification data is available
>> +# in the QOM tree.
>> +#
>> +# @iscpiavailable: is CPI data available in QOM
>> +#
>> +# Features:
>> +#
>> +# @unstable: This event is experimental.
>> +#
>> +# Since: 10.2
>> +#
>> +# .. qmp-example::
>> +#
>> +# <- { "event": "SCLP_CPI_INFO_AVAILABLE",
>> +# "data": { "iscpiavailable": true },
>> +# "timestamp": { "seconds": 1401385907, "microseconds":
>> 422329 } }
>> +##
>> +{ 'event': 'SCLP_CPI_INFO_AVAILABLE',
>> + 'data': { 'iscpiavailable': 'bool' },
>
>
> What is the point of this payload?
The data 'iscpiavailable' is not necessary. I will remove this
and send v3. Thank you Nina for the quick feedback.
>
>> + 'features': [ 'unstable' ]
>> +}
--
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] 7+ messages in thread
* Re: [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI
2025-10-13 13:39 ` [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
@ 2025-10-16 7:17 ` Thomas Huth
2025-10-16 11:50 ` Shalini Chellathurai Saroja
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Huth @ 2025-10-16 7:17 UTC (permalink / raw)
To: Shalini Chellathurai Saroja, qemu-s390x mailing list
Cc: Sebastian Mitterle, qemu-devel mailing list,
Nina Schoetterl-Glausch, Hendrik Brueckner, Michael Mueller
On 13/10/2025 15.39, Shalini Chellathurai Saroja wrote:
> Add tests for SCLP event type Control-Program Identification.
>
> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/functional/s390x/test_ccw_virtio.py | 25 +++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/tests/functional/s390x/test_ccw_virtio.py b/tests/functional/s390x/test_ccw_virtio.py
> index 453711aa0f..82e73ecf5e 100755
> --- a/tests/functional/s390x/test_ccw_virtio.py
> +++ b/tests/functional/s390x/test_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,29 @@ 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 0x001a000000060b00 > ' + cpi + 'system_level')
> + exec_command(self, 'echo 1 > ' + cpi + 'set')
I think at least the last statement should be replaced by
exec_command_and_wait_for_pattern, waiting for the shell prompt. Otherwise
there is a small race condition here that the exec_command() has been sent,
but not executed yet. Ok, the event_wait() will wait for a while, so it's
very unlikely, but let's better play save and wait for the shell prompt
first, before waiting for the event.
> + try:
> + event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE')
> + except TimeoutError:
> + self.skipTest('SCLP Event type CPI is not supported')
Should we rather fail the test in case we don't receive the event?
> + ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp')
> + self.assertNotEqual(ts, 0)
> + name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
> + self.assertEqual(name.strip(), 'TESTVM')
> + typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type')
> + self.assertEqual(typ.strip(), 'LINUX')
> + sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name')
> + self.assertEqual(sysplex.strip(), 'TESTPLEX')
> + level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level')
> + self.assertEqual(level, 0x001a000000060b00)
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI
2025-10-16 7:17 ` Thomas Huth
@ 2025-10-16 11:50 ` Shalini Chellathurai Saroja
0 siblings, 0 replies; 7+ messages in thread
From: Shalini Chellathurai Saroja @ 2025-10-16 11:50 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-s390x mailing list, Sebastian Mitterle,
qemu-devel mailing list, Nina Schoetterl-Glausch,
Hendrik Brueckner, Michael Mueller
On 2025-10-16 09:17, Thomas Huth wrote:
> On 13/10/2025 15.39, Shalini Chellathurai Saroja wrote:
>> Add tests for SCLP event type Control-Program Identification.
>>
>> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
>> Suggested-by: Thomas Huth <thuth@redhat.com>
>> ---
>> tests/functional/s390x/test_ccw_virtio.py | 25
>> +++++++++++++++++++++++
>> 1 file changed, 25 insertions(+)
>>
>> diff --git a/tests/functional/s390x/test_ccw_virtio.py
>> b/tests/functional/s390x/test_ccw_virtio.py
>> index 453711aa0f..82e73ecf5e 100755
>> --- a/tests/functional/s390x/test_ccw_virtio.py
>> +++ b/tests/functional/s390x/test_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,29 @@ 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 0x001a000000060b00 > ' + cpi +
>> 'system_level')
>> + exec_command(self, 'echo 1 > ' + cpi + 'set')
>
> I think at least the last statement should be replaced by
> exec_command_and_wait_for_pattern, waiting for the shell prompt.
> Otherwise there is a small race condition here that the exec_command()
> has been sent, but not executed yet. Ok, the event_wait() will wait
> for a while, so it's very unlikely, but let's better play save and
> wait for the shell prompt first, before waiting for the event.
>
ok.
>> + try:
>> + event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE')
>> + except TimeoutError:
>> + self.skipTest('SCLP Event type CPI is not supported')
>
> Should we rather fail the test in case we don't receive the event?
ok.
Hello Thomas,
I will incorporate the changes and will send the v3. Thank you for
the review.
>
>> + ts = self.vm.cmd('qom-get', path=sclpcpi,
>> property='timestamp')
>> + self.assertNotEqual(ts, 0)
>> + name = self.vm.cmd('qom-get', path=sclpcpi,
>> property='system_name')
>> + self.assertEqual(name.strip(), 'TESTVM')
>> + typ = self.vm.cmd('qom-get', path=sclpcpi,
>> property='system_type')
>> + self.assertEqual(typ.strip(), 'LINUX')
>> + sysplex = self.vm.cmd('qom-get', path=sclpcpi,
>> property='sysplex_name')
>> + self.assertEqual(sysplex.strip(), 'TESTPLEX')
>> + level = self.vm.cmd('qom-get', path=sclpcpi,
>> property='system_level')
>> + self.assertEqual(level, 0x001a000000060b00)
>
> 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] 7+ messages in thread
end of thread, other threads:[~2025-10-16 11:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 13:39 [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Shalini Chellathurai Saroja
2025-10-13 13:39 ` [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
2025-10-16 7:17 ` Thomas Huth
2025-10-16 11:50 ` Shalini Chellathurai Saroja
2025-10-13 16:50 ` [PATCH v2 1/2] qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE Nina Schoetterl-Glausch
2025-10-14 8:45 ` Shalini Chellathurai Saroja
-- strict thread matches above, loose matches on Subject: below --
2025-10-13 13:32 Shalini Chellathurai Saroja
2025-10-13 13:32 ` [PATCH v2 2/2] tests/functional: add tests for SCLP event CPI Shalini Chellathurai Saroja
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.