From nobody Wed Jan 15 13:58:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) client-ip=66.187.230.42; envelope-from=kimchi-devel-bounces@ovirt.org; helo=lists.ovirt.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) smtp.mailfrom=kimchi-devel-bounces@ovirt.org; Return-Path: Received: from lists.ovirt.org (lists.phx.ovirt.org [66.187.230.42]) by mx.zohomail.com with SMTPS id 1486605823358679.8855095930425; Wed, 8 Feb 2017 18:03:43 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id 70FA48205DC; Thu, 9 Feb 2017 02:03:42 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lists.ovirt.org (Postfix) with ESMTPS id 3B7828205B7 for ; Thu, 9 Feb 2017 02:02:28 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v191wUON108722 for ; Wed, 8 Feb 2017 21:02:27 -0500 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 28gcrj4tu9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 08 Feb 2017 21:02:27 -0500 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Feb 2017 00:02:24 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Feb 2017 00:02:23 -0200 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.18.232.42]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id DA977352005F for ; Wed, 8 Feb 2017 21:01:49 -0500 (EST) Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay02.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1922MWJ28049466 for ; Thu, 9 Feb 2017 00:02:22 -0200 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1922NVw015823 for ; Thu, 9 Feb 2017 00:02:23 -0200 Received: from alinefm-TP440.ibmmodules.com ([9.80.222.200]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1922D8J015772 for ; Thu, 9 Feb 2017 00:02:22 -0200 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Thu, 9 Feb 2017 00:02:01 -0200 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170209020202.17425-1-alinefm@linux.vnet.ibm.com> References: <20170209020202.17425-1-alinefm@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17020902-0032-0000-0000-0000053C84B7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17020902-0033-0000-0000-000011BEAF85 Message-Id: <20170209020202.17425-6-alinefm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-09_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702090015 Subject: [Kimchi-devel] [PATCH] [Kimchi 5/6] Fix memory hotplug test case X-BeenThere: kimchi-devel@ovirt.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: kimchi-devel-bounces@ovirt.org Errors-To: kimchi-devel-bounces@ovirt.org X-ZohoMail: RSF_0 Z_629925259 SPT_0 The memory hotplug support depends on libvirt and qemu support. The libvirt test driver does not support this type of configuration so update the test case to verify the system has its support or not. Signed-off-by: Aline Manera --- tests/test_rest.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/test_rest.py b/tests/test_rest.py index 09fd8a5..4c7ab5b 100644 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -179,7 +179,10 @@ class RestTests(unittest.TestCase): resp =3D self.request('/plugins/kimchi/vms/vm-1', req, 'PUT') self.assertEquals(400, resp.status) =20 - if not os.uname()[4] =3D=3D "s390x": + # Check if there is support to memory hotplug + resp =3D self.request('/plugins/kimchi/config/capabilities').read() + conf =3D json.loads(resp) + if os.uname()[4] !=3D "s390x" and conf['mem_hotplug_support']: req =3D json.dumps({'memory': {'maxmemory': 3072}}) resp =3D self.request('/plugins/kimchi/vms/vm-1', req, 'PUT') self.assertEquals(200, resp.status) @@ -195,9 +198,7 @@ class RestTests(unittest.TestCase): resp =3D self.request('/plugins/kimchi/vms/vm-1', req, 'PUT') self.assertEquals(400, resp.status) =20 - # Check if there is support to memory hotplug, once vm is running - resp =3D self.request('/plugins/kimchi/config/capabilities').read() - conf =3D json.loads(resp) + # Test memory hotplug req =3D json.dumps({'memory': {'current': 2048}}) resp =3D self.request('/plugins/kimchi/vms/vm-1', req, 'PUT') if conf['mem_hotplug_support']: @@ -254,6 +255,9 @@ class RestTests(unittest.TestCase): vm =3D json.loads( self.request('/plugins/kimchi/vms/vm-1', req).read() ) + + # The maxmemory will be automatically increased when the amount of + # memory value is greater than the current maxmemory value params =3D {'name': u'=E2=88=A8=D0=BC-=D1=86=D1=80d=CE=B1t=D0=B5d'= , 'cpu_info': {'vcpus': 5}, 'memory': {'current': 3072}} req =3D json.dumps(params) @@ -265,11 +269,9 @@ class RestTests(unittest.TestCase): # Memory was hot plugged vm['name'] =3D u'=E2=88=A8=D0=BC-=D1=86=D1=80d=CE=B1t=D0=B5d' vm['cpu_info'].update(params['cpu_info']) - if not os.uname()[4] =3D=3D "s390x": - vm['memory'].update(params['memory']) - else: - vm['memory']['current'] =3D 3072 - vm['memory']['maxmemory'] =3D 3072 + vm['memory']['current'] =3D 3072 + vm['memory']['maxmemory'] =3D 3072 + for key in params.keys(): self.assertEquals(vm[key], vm_updated[key]) =20 --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel