From nobody Tue Feb 10 23:01:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524249137239773.667352964429; Fri, 20 Apr 2018 11:32:17 -0700 (PDT) Received: from localhost ([::1]:50365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9apU-0005ug-BG for importer@patchew.org; Fri, 20 Apr 2018 14:32:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9agI-0006b7-G5 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9agD-0003k7-Ho for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:22:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9agD-0003i4-9P for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:22:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FF8328207; Fri, 20 Apr 2018 18:22:40 +0000 (UTC) Received: from localhost (ovpn-116-52.gru2.redhat.com [10.97.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 783C35EDE0; Fri, 20 Apr 2018 18:22:28 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 20 Apr 2018 15:19:41 -0300 Message-Id: <20180420181951.7252-15-ehabkost@redhat.com> In-Reply-To: <20180420181951.7252-1-ehabkost@redhat.com> References: <20180420181951.7252-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 20 Apr 2018 18:22:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC 14/24] avocado_qemu: Functional test for RHBZ#1447027 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Fam Zheng , Stefan Hajnoczi , Amador Pahim , Cleber Rosa , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Amador Pahim Fixed in commit e85c0d1. According to the RHBZ1447027, the issue is: guest cannot boot with 240 or above vcpus when using ovmf. Test consists in set the VM with 240 vcpus and the OVMF device to then check whether the VM can be started. A parameters.yaml file is provided in order to customize the OVMF files locations. Execute with: $ avocado run test_ovmf_with_240_vcpus.py -m \ test_ovmf_with_240_vcpus.py.data/parameters.yaml Signed-off-by: Amador Pahim Signed-off-by: Eduardo Habkost --- tests/avocado/test_ovmf_with_240_vcpus.py | 70 ++++++++++++++++++= ++++ .../parameters.yaml | 2 + 2 files changed, 72 insertions(+) create mode 100644 tests/avocado/test_ovmf_with_240_vcpus.py create mode 100644 tests/avocado/test_ovmf_with_240_vcpus.py.data/paramete= rs.yaml diff --git a/tests/avocado/test_ovmf_with_240_vcpus.py b/tests/avocado/test= _ovmf_with_240_vcpus.py new file mode 100644 index 0000000000..da688dbc76 --- /dev/null +++ b/tests/avocado/test_ovmf_with_240_vcpus.py @@ -0,0 +1,70 @@ +import os +import shutil +import sys + +from avocado import main +from avocado_qemu import test + + +class TestOvmfVcpus(test.QemuTest): + """ + Run with: + + avocado run test_ovmf_with_240_vcpus.py \ + -m test_ovmf_with_240_vcpus.py.data/parameters.yaml + + :avocado: enable + :avocado: tags=3Dovmf + """ + + def setUp(self): + ovmf_code_path =3D self.params.get('OVMF_CODE', + default=3D'/usr/share/edk2/ovmf/O= VMF_CODE.secboot.fd') + ovmf_vars_path =3D self.params.get('OVMF_VARS', + default=3D'/usr/share/edk2/ovmf/O= VMF_VARS.fd') + if not ovmf_code_path or not os.path.exists(ovmf_code_path): + basename =3D os.path.basename(__file__) + self.cancel('OVMF_CODE file not found. Set the correct ' + 'path on "%s.data/parameters.yaml" and run this te= st ' + 'with: "avocado run %s -m %s.data/parameters.yaml"= ' % + (basename, basename, basename)) + if not ovmf_vars_path or not os.path.exists(ovmf_vars_path): + basename =3D os.path.basename(__file__) + self.cancel('OVMF_VARS file not found. Set the correct ' + 'path on "%s.data/parameters.yaml" and run this te= st ' + 'with: "avocado run %s -m %s.data/parameters.yaml"= ' % + (basename, basename, basename)) + + ovmf_vars_tmp =3D os.path.join(self.workdir, + os.path.basename(ovmf_vars_path)) + if not os.path.exists(ovmf_vars_tmp): + shutil.copy(ovmf_vars_path, self.workdir) + + self.vm.args.extend(['-drive', + 'file=3D%s,if=3Dpflash,format=3Draw,readonly= =3Don,unit=3D0' % + ovmf_code_path]) + self.vm.args.extend(['-drive', + 'file=3D%s,if=3Dpflash,format=3Draw,unit=3D1'= % + ovmf_vars_tmp]) + + self.vm.args.extend(['-smp', '240']) + + def test_run_vm(self): + """ + According to the RHBZ1447027, the issue is: Guest cannot boot + with 240 or above vcpus when using ovmf. + Fixed in commit e85c0d14014514a2f0faeae5b4c23fab5b234de4. + + :avocado: tags=3DRHBZ1447027 + """ + + try: + self.vm.launch() + except Exception as details: + self.fail(details) + + def tearDown(self): + self.vm.shutdown() + +if __name__ =3D=3D "__main__": + avocado.main() diff --git a/tests/avocado/test_ovmf_with_240_vcpus.py.data/parameters.yaml= b/tests/avocado/test_ovmf_with_240_vcpus.py.data/parameters.yaml new file mode 100644 index 0000000000..79f6da1d29 --- /dev/null +++ b/tests/avocado/test_ovmf_with_240_vcpus.py.data/parameters.yaml @@ -0,0 +1,2 @@ +OVMF_CODE: /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd +OVMF_VARS: /usr/share/edk2/ovmf/OVMF_VARS.fd --=20 2.14.3