From nobody Fri Oct 25 15:40:45 2024 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 1486492616381292.9805369261469; Tue, 7 Feb 2017 10:36:56 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id A05CB8205C4; Tue, 7 Feb 2017 18:36:55 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lists.ovirt.org (Postfix) with ESMTPS id 991BF82054C for ; Tue, 7 Feb 2017 18:35:43 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v17ISUSA119151 for ; Tue, 7 Feb 2017 13:35:42 -0500 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 28feynf7fr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 07 Feb 2017 13:35:42 -0500 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Feb 2017 16:35:40 -0200 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 Feb 2017 16:35:39 -0200 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.18.232.225]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id B839C1DC0054 for ; Tue, 7 Feb 2017 13:35:39 -0500 (EST) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v17IZcwq41025728 for ; Tue, 7 Feb 2017 16:35:38 -0200 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v17IZcrW003417 for ; Tue, 7 Feb 2017 16:35:38 -0200 Received: from alinefm-TP440.ibmmodules.com ([9.85.187.18]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v17IZRN3003298 for ; Tue, 7 Feb 2017 16:35:37 -0200 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Tue, 7 Feb 2017 16:35:15 -0200 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170207183516.5661-1-alinefm@linux.vnet.ibm.com> References: <20170207183516.5661-1-alinefm@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17020718-0032-0000-0000-0000053BF64A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17020718-0033-0000-0000-000011BE205A Message-Id: <20170207183516.5661-6-alinefm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-07_10:, , 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-1702070175 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