From patchwork Tue Apr 25 16:14:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Morel X-Patchwork-Id: 13223484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6C76C77B61 for ; Tue, 25 Apr 2023 16:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234671AbjDYQPv (ORCPT ); Tue, 25 Apr 2023 12:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234719AbjDYQPn (ORCPT ); Tue, 25 Apr 2023 12:15:43 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 305E5161B3 for ; Tue, 25 Apr 2023 09:15:35 -0700 (PDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PGFBWE013702; Tue, 25 Apr 2023 16:15:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ZryOUdFKNYUpr6nMucL5XkzEdCGebR91Z4cEkIjiKEU=; b=SzKg/3l3RaZLbjdVQ0IX99NMur3AthVasXwe0KAhq7oBZMN0G5GVd5QhVutkKeJQeBry t9ejg46M+Xr6c5hnskaYE9nOZJFF02gTdm8WfcaTkh4fPHAgRBDO2ttNsP0LHZy//0t1 SDw0H9ka0B5uhdSyAwpDKj3bj4qd1CxZTw1InH7c5z67ZfxqkRwIRF6qJCYNAWMRNJEm oxaVeCv8ou0xaIcsnQ3ZBgpnBVqvKTVMvgju7z+xgOK7ynys/RIpbjqUtOzNSxtlB8ey rKa8nUDNmr7ZysYhxzVQYF0rK9BPzZdv2pQiuQlee8S/fLG5zCVmItQfIt3nBMB+UDre HA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q6j78r0au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:15:21 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33PGFLGt014328; Tue, 25 Apr 2023 16:15:21 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q6j78r08y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:15:21 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33P4bdEP020390; Tue, 25 Apr 2023 16:15:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3q47771um2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:15:18 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33PGFDx934537998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 16:15:13 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A5BE20079; Tue, 25 Apr 2023 16:15:13 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 849142007D; Tue, 25 Apr 2023 16:15:12 +0000 (GMT) Received: from li-c6ac47cc-293c-11b2-a85c-d421c8e4747b.ibm.com (unknown [9.152.222.242]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 25 Apr 2023 16:15:12 +0000 (GMT) From: Pierre Morel To: qemu-s390x@nongnu.org Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com, pasic@linux.ibm.com, richard.henderson@linaro.org, david@redhat.com, thuth@redhat.com, cohuck@redhat.com, mst@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org, ehabkost@redhat.com, marcel.apfelbaum@gmail.com, eblake@redhat.com, armbru@redhat.com, seiden@linux.ibm.com, nrb@linux.ibm.com, nsg@linux.ibm.com, frankja@linux.ibm.com, berrange@redhat.com, clg@kaod.org Subject: [PATCH v20 21/21] tests/avocado: s390x cpu topology query-cpu-polarization Date: Tue, 25 Apr 2023 18:14:56 +0200 Message-Id: <20230425161456.21031-22-pmorel@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230425161456.21031-1-pmorel@linux.ibm.com> References: <20230425161456.21031-1-pmorel@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: d1ubE5ekgajwDxHCwctMZtpT6g9a4NPq X-Proofpoint-ORIG-GUID: ZvBVAuSCty3yAC9CBku9dNJTmgpe2qvQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_07,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250144 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This test verifies that the qmp query query-cpu-polarization reports correctly the polarization when the guest requests a polarization change. Signed-off-by: Pierre Morel --- tests/avocado/s390_topology.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/avocado/s390_topology.py b/tests/avocado/s390_topology.py index 4516e5e46f..43e0ebc160 100644 --- a/tests/avocado/s390_topology.py +++ b/tests/avocado/s390_topology.py @@ -437,3 +437,36 @@ def test_move_error(self): self.assertEqual(res['error']['class'], 'GenericError') self.check_topology(0, 0, 0, 0, 'medium', False) + + def test_query_polarization(self): + """ + This test verifies that query-cpu-polarization gives the right + answer + + :avocado: tags=arch:s390x + :avocado: tags=machine:s390-ccw-virtio + """ + self.kernel_init() + self.vm.launch() + self.wait_for_console_pattern('no job control') + + self.system_init() + + res = self.vm.qmp('query-cpu-polarization') + self.assertEqual(res['return']['polarization'], 'horizontal') + + exec_command(self, 'echo 1 > /sys/devices/system/cpu/dispatching') + time.sleep(0.2) + exec_command_and_wait_for_pattern(self, + '/bin/cat /sys/devices/system/cpu/dispatching', '1') + + res = self.vm.qmp('query-cpu-polarization') + self.assertEqual(res['return']['polarization'], 'vertical') + + exec_command(self, 'echo 0 > /sys/devices/system/cpu/dispatching') + time.sleep(0.2) + exec_command_and_wait_for_pattern(self, + '/bin/cat /sys/devices/system/cpu/dispatching', '0') + + res = self.vm.qmp('query-cpu-polarization') + self.assertEqual(res['return']['polarization'], 'horizontal')