From nobody Sat Apr 27 22:16:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1582236155; cv=none; d=zohomail.com; s=zohoarc; b=nEX6UXmSYXJhgPkFXxe8BLlSCsbRv1Kmxw194GRWJuL14Fw6H4qCTT5OQqzF6qNujEF863unJkgnzhijF4IBI+teJN76EwH8DurNGRCVyoISNMY6ZhIfYEdsQb+bKbox2NKa8zUzQgciEzfNwuUAN0C6DP/Fa7W97MzDYB1FwzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582236155; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=QiXkG14rH+xCSEp0g9l0+7UxEhGwlSKKwcdkl3Ik0lU=; b=nnIbmSiEoEbvgpuN4CyRlGqa8LG1SUqiJvUTmBpUG7qOpKrwHpZda0EYMDZDrONFLOpUMTrQHGRE8mvygrfhf/f8lqUdA7lZwc7Bsme/iqdNN1+xrtM/UE+gwRowqzOxHBWIsNOv0PMJNthtOroBZbmmktPCrNK9ereqHjHaxek= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582236155683270.7494023635911; Thu, 20 Feb 2020 14:02:35 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-31--btBY-VPNVm-69qWoL2JkQ-1; Thu, 20 Feb 2020 17:02:31 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B79A800D55; Thu, 20 Feb 2020 22:02:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C884A5C13C; Thu, 20 Feb 2020 22:02:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 43EF718033AC; Thu, 20 Feb 2020 22:02:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KM2GDm016275 for ; Thu, 20 Feb 2020 17:02:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9E9BB2166B2F; Thu, 20 Feb 2020 22:02:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99ED62166B2C for ; Thu, 20 Feb 2020 22:02:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 600918007AC for ; Thu, 20 Feb 2020 22:02:15 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-3nCVuFwRN5q7ahuuI_rV7w-1; Thu, 20 Feb 2020 17:02:12 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01KLxGBm011783 for ; Thu, 20 Feb 2020 17:02:11 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2y8uc02q27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 17:02:11 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01KLsil3028754 for ; Thu, 20 Feb 2020 22:02:10 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02dal.us.ibm.com with ESMTP id 2y6897c1v1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 22:02:10 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01KM29sg57344342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Feb 2020 22:02:09 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D8C56A195 for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B4326A198 for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from collin-ThinkPad-W541.pok.ibm.com (unknown [9.56.58.27]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 22:02:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582236154; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QiXkG14rH+xCSEp0g9l0+7UxEhGwlSKKwcdkl3Ik0lU=; b=CQqkJWl+Cr2ujDzURxMvFAWir1SaqEvS/nvo1flS0FuXUR0xaPnMVCkRM5TPz3SJPinqKa SuTcAqj3H2P5q7B8Raum6VzTc+PBZA8zGXjY4YXlj7JGgJu7cqHcYHc6+xFFIN6A1SD2u3 7/RLaO1l+SxwG1Re8IAN1T3N47MSfGQ= X-MC-Unique: -btBY-VPNVm-69qWoL2JkQ-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v1 1/3] qemumonitorjsontest: load schema based on specified arch Date: Thu, 20 Feb 2020 17:01:46 -0500 Message-Id: <1582236108-28967-2-git-send-email-walling@linux.ibm.com> In-Reply-To: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> References: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-20_17:2020-02-19, 2020-02-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=800 spamscore=0 suspectscore=1 mlxscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002200161 X-MC-Unique: 3nCVuFwRN5q7ahuuI_rV7w-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01KM2GDm016275 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There are some architectures that support capabilities that others do not (e.g. s390x supports cpu comparison and baseline via QEMU). Let's make testQEMUSchemaLoad accept a string to specify the schema to load based on the specified arch. Signed-off-by: Collin Walling Reviewed-by: Michal Privoznik --- tests/qemublocktest.c | 2 +- tests/qemuhotplugtest.c | 2 +- tests/qemumonitorjsontest.c | 4 ++-- tests/testutilsqemuschema.c | 8 ++++---- tests/testutilsqemuschema.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 5a564b7..7b7948d 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -981,7 +981,7 @@ mymain(void) =20 #define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false) =20 - if (!(diskxmljsondata.schema =3D testQEMUSchemaLoad())) { + if (!(diskxmljsondata.schema =3D testQEMUSchemaLoad("x86_64"))) { ret =3D -1; goto cleanup; } diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 6a3e61c..9dd4266 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -620,7 +620,7 @@ mymain(void) if (!(driver.domainEventState =3D virObjectEventStateNew())) return EXIT_FAILURE; =20 - if (!(qmpschema =3D testQEMUSchemaLoad())) { + if (!(qmpschema =3D testQEMUSchemaLoad("x86_64"))) { VIR_TEST_VERBOSE("failed to load qapi schema\n"); return EXIT_FAILURE; } diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 24e0ce1..cd7fa1f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2995,7 +2995,7 @@ mymain(void) =20 virEventRegisterDefaultImpl(); =20 - if (!(qapiData.schema =3D testQEMUSchemaLoad())) { + if (!(qapiData.schema =3D testQEMUSchemaLoad("x86_64"))) { VIR_TEST_VERBOSE("failed to load qapi schema"); ret =3D -1; goto cleanup; @@ -3232,7 +3232,7 @@ mymain(void) DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", false, "{\"driver\":\"qcow2\",\"file\": 1234}"); =20 - if (!(metaschema =3D testQEMUSchemaGetLatest()) || + if (!(metaschema =3D testQEMUSchemaGetLatest("x86_64")) || !(metaschemastr =3D virJSONValueToString(metaschema, false))) { VIR_TEST_VERBOSE("failed to load latest qapi schema"); ret =3D -1; diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c index 9a1b1fe..7b82ff2 100644 --- a/tests/testutilsqemuschema.c +++ b/tests/testutilsqemuschema.c @@ -524,7 +524,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj, * replies file used for qemucapabilitiestest for the x86_64 architecture. */ virJSONValuePtr -testQEMUSchemaGetLatest(void) +testQEMUSchemaGetLatest(const char* arch) { char *capsLatestFile =3D NULL; char *capsLatest =3D NULL; @@ -533,7 +533,7 @@ testQEMUSchemaGetLatest(void) virJSONValuePtr reply =3D NULL; virJSONValuePtr schema =3D NULL; =20 - if (!(capsLatestFile =3D testQemuGetLatestCapsForArch("x86_64", "repli= es"))) { + if (!(capsLatestFile =3D testQemuGetLatestCapsForArch(arch, "replies")= )) { VIR_TEST_VERBOSE("failed to find latest caps replies"); return NULL; } @@ -575,11 +575,11 @@ testQEMUSchemaGetLatest(void) =20 =20 virHashTablePtr -testQEMUSchemaLoad(void) +testQEMUSchemaLoad(const char* arch) { virJSONValuePtr schema; =20 - if (!(schema =3D testQEMUSchemaGetLatest())) + if (!(schema =3D testQEMUSchemaGetLatest(arch))) return NULL; =20 return virQEMUQAPISchemaConvert(schema); diff --git a/tests/testutilsqemuschema.h b/tests/testutilsqemuschema.h index de9da7c..84ee9a9 100644 --- a/tests/testutilsqemuschema.h +++ b/tests/testutilsqemuschema.h @@ -29,7 +29,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj, virBufferPtr debug); =20 virJSONValuePtr -testQEMUSchemaGetLatest(void); +testQEMUSchemaGetLatest(const char* arch); =20 virHashTablePtr -testQEMUSchemaLoad(void); +testQEMUSchemaLoad(const char* arch); --=20 2.7.4 From nobody Sat Apr 27 22:16:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1582236154; cv=none; d=zohomail.com; s=zohoarc; b=gewn8yXpdqG5JghYFW0NMU+o4O4FCVUuN1Ku4hRT/26x2rSJoFr/1lk5u3AjTdDkICEr8935Iy74HKqLqLXPW8Ehn2jUr42kD8tiBJobQe9Q4sPiD2A5hLENg8krTxHnjINkar4p9fTh94PX/c2D6Xt5ztw9NU4HppgOlXQHYDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582236154; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=9Z69VliPPyJ/sJjtpx8J1zFvRzBxuZj8VLQTpGIq5f0=; b=VMIOmN0TyLPSRCa/CFNSKxGy0EUYekwDmdU3p4up2ov3ftEgRrD9z7ZuaMSJJN3hX3VKHymAtxz+j3jkFuPBSFF7rZ9LfRC6nx5CQ+jgNxi8et9fPUJYemTZmRPEUfB0uE2QCOjCyd6NvYcptQO/JI0+MzUKGb02YB8aaTS6Knc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1582236154945712.8212583002767; Thu, 20 Feb 2020 14:02:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-narIm12cOgOFRQyAHMSjyw-1; Thu, 20 Feb 2020 17:02:31 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3673107ACC5; Thu, 20 Feb 2020 22:02:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 932EB90F65; Thu, 20 Feb 2020 22:02:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 46F4F18033AD; Thu, 20 Feb 2020 22:02:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KM2Gm4016274 for ; Thu, 20 Feb 2020 17:02:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7AF9E13BBAC; Thu, 20 Feb 2020 22:02:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 76A5213BF52 for ; Thu, 20 Feb 2020 22:02:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E06E800298 for ; Thu, 20 Feb 2020 22:02:14 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-rmn8V5mKOl6FCn47FIGV9w-1; Thu, 20 Feb 2020 17:02:12 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01KLwt8e096090 for ; Thu, 20 Feb 2020 17:02:11 -0500 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y8ubqa274-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 17:02:11 -0500 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01KM0JQX016019 for ; Thu, 20 Feb 2020 22:02:10 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma05wdc.us.ibm.com with ESMTP id 2y689782wm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 22:02:10 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01KM29wW57344346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Feb 2020 22:02:09 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9BF2C6A197 for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67D036A195 for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from collin-ThinkPad-W541.pok.ibm.com (unknown [9.56.58.27]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582236153; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9Z69VliPPyJ/sJjtpx8J1zFvRzBxuZj8VLQTpGIq5f0=; b=ATN0cr7k6q43gOG0U8rKlBnX3viTRUfvucHto14R3LXKzhsz4Z+0gN8exP7R52ZZSVJtf0 3x7Ie+A09PZvH6GJinB2884kbeRFTU9iZW5nI60t9HUxbd17hjUApf3s3mtosGzVyUEBCz aH1JE2/e/gwgwO/RaBfzLP7LaRSrU0E= From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v1 2/3] qemumonitorjsontest: add tests for cpu comparison Date: Thu, 20 Feb 2020 17:01:47 -0500 Message-Id: <1582236108-28967-3-git-send-email-walling@linux.ibm.com> In-Reply-To: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> References: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-20_17:2020-02-19, 2020-02-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 priorityscore=1501 suspectscore=3 spamscore=0 bulkscore=0 impostorscore=0 mlxlogscore=732 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002200161 X-MC-Unique: rmn8V5mKOl6FCn47FIGV9w-1 X-MC-Unique: narIm12cOgOFRQyAHMSjyw-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01KM2Gm4016274 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Collin Walling Reviewed-by: Michal Privoznik --- tests/qemumonitorjsontest.c | 50 +++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 50 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index cd7fa1f..5568af5 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2981,6 +2981,48 @@ testQemuMonitorJSONTransaction(const void *opaque) =20 =20 static int +testQemuMonitorJSONqemuMonitorJSONGetCPUModelComparison(const void *opaque) +{ + const testGenericData *data =3D opaque; + g_autoptr(qemuMonitorTest) test =3D NULL; + virCPUDefPtr cpu_a; + virCPUDefPtr cpu_b =3D NULL; + g_autofree char *result =3D NULL; + int ret =3D -1; + + if (!(test =3D qemuMonitorTestNewSchema(data->xmlopt, data->schema))) + return -1; + + if (qemuMonitorTestAddItem(test, "query-cpu-model-comparison", + "{\"return\":{\"result\":\"test\"}}") < 0) + return -1; + + if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0) + goto cleanup; + + cpu_a->model =3D g_strdup("cpu_a"); + cpu_b->model =3D g_strdup("cpu_b"); + + if (qemuMonitorJSONGetCPUModelComparison(qemuMonitorTestGetMonitor(tes= t), + cpu_a, cpu_b, &result) < 0) + goto cleanup; + + if (!result || STRNEQ(result, "test")) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "Compare result not set"); + goto cleanup; + } + + ret =3D 0; + + cleanup: + virCPUDefFree(cpu_a); + virCPUDefFree(cpu_b); + return ret; +} + + +static int mymain(void) { int ret =3D 0; @@ -3257,6 +3299,14 @@ mymain(void) =20 #undef DO_TEST_QUERY_JOBS =20 + if (!(qapiData.schema =3D testQEMUSchemaLoad("s390x"))) { + VIR_TEST_VERBOSE("failed to load qapi schema for s390x"); + ret =3D -1; + goto cleanup; + } + + DO_TEST(qemuMonitorJSONGetCPUModelComparison); + cleanup: VIR_FREE(metaschemastr); virJSONValueFree(metaschema); --=20 2.7.4 From nobody Sat Apr 27 22:16:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1582236178; cv=none; d=zohomail.com; s=zohoarc; b=MR1Rg/aXE2S6RNU41rFqHSdBJ3QmAjZwK784P3WKnD6hZqWAPzP5HC30cajjVf1ik/pbSBGY0kplqR0GwiTas7a3ZEn8E244lcpxPR3zqhY3tCWn/2atQf36de1E9gBwVKYYJPQII1K4XghwC0y/kpK3fuWCN9AnL7pqp2WHD4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582236178; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=hi0fj57LIutwyu6I6yGUJC66vvFvpt1zj2eyzFMs8QE=; b=DbuSGmTtNndwKOUcz/DChLYSQf8rcBIfTDYI3xf7jh8YZAl2i0CkBmgiAlOdsFePzc6XMJc+ck6BuqRFuVYoo6UuRKoStmcs7Ve/pFCnZMIRxGxZumRGDah8lWOtVYXJDUq6dAAOPbsEeNhLprQhLQvI0DSaWwfYqkPxOiqbM6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582236178970403.143518021919; Thu, 20 Feb 2020 14:02:58 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-FmAok_fqMnCRYFfKracFMg-1; Thu, 20 Feb 2020 17:02:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2FD6DB61; Thu, 20 Feb 2020 22:02:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80EF560CCC; Thu, 20 Feb 2020 22:02:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2FCA018033AE; Thu, 20 Feb 2020 22:02:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KM2Ice016291 for ; Thu, 20 Feb 2020 17:02:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1EABF2028CD4; Thu, 20 Feb 2020 22:02:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 188E82026E1C for ; Thu, 20 Feb 2020 22:02:16 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3244385A30E for ; Thu, 20 Feb 2020 22:02:16 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-OW6MRhyMNo-F8HlR-Rowfg-1; Thu, 20 Feb 2020 17:02:13 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01KLqWYM036720 for ; Thu, 20 Feb 2020 17:02:12 -0500 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y9ytqw16a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 17:02:12 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01KLvOL5001692 for ; Thu, 20 Feb 2020 22:02:11 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03dal.us.ibm.com with ESMTP id 2y6897m5j1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 22:02:11 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01KM2A2558523980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Feb 2020 22:02:10 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7C406A19A for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5F206A198 for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) Received: from collin-ThinkPad-W541.pok.ibm.com (unknown [9.56.58.27]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 22:02:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582236178; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hi0fj57LIutwyu6I6yGUJC66vvFvpt1zj2eyzFMs8QE=; b=YHu+m1Lp8oK3j42QQeSW/Ct2PoMoew7/SC7OxF4hiHNgZcBzBSItJX/d0ECciKGYUz+lLT jV/meqtGsmYQnvwvtx8kPClDYPq25j7lPh8TGWMoSCWn2l9bjBsY7G28NcCpoCq6F/3Qln wekIXDMEr5KJE3Z2b+ugkgGagYOyyxQ= From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v1 3/3] qemumonitorjsontest: add test for cpu baseline Date: Thu, 20 Feb 2020 17:01:48 -0500 Message-Id: <1582236108-28967-4-git-send-email-walling@linux.ibm.com> In-Reply-To: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> References: <1582236108-28967-1-git-send-email-walling@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-20_17:2020-02-19, 2020-02-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=3 clxscore=1015 mlxlogscore=751 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002200160 X-MC-Unique: OW6MRhyMNo-F8HlR-Rowfg-1 X-MC-Unique: FmAok_fqMnCRYFfKracFMg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01KM2Ice016291 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Collin Walling Reviewed-by: Michal Privoznik --- tests/qemumonitorjsontest.c | 77 +++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 77 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 5568af5..e9f95e3 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -3023,6 +3023,82 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelCompari= son(const void *opaque) =20 =20 static int +testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque) +{ + const testGenericData *data =3D opaque; + g_autoptr(qemuMonitorTest) test =3D NULL; + virCPUDefPtr cpu_a; + virCPUDefPtr cpu_b =3D NULL; + qemuMonitorCPUModelInfoPtr baseline =3D NULL; + int ret =3D -1; + + if (!(test =3D qemuMonitorTestNewSchema(data->xmlopt, data->schema))) + return -1; + + if (qemuMonitorTestAddItem(test, "query-cpu-model-baseline", + "{ " + " \"return\": { " + " \"model\": { " + " \"name\": \"cpu_c\", " + " \"props\": { " + " \"feat_a\": true, " + " \"feat_b\": false " + " } " + " } " + " } " + "}") < 0) + return -1; + + if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0) + goto cleanup; + + cpu_a->model =3D g_strdup("cpu_a"); + cpu_b->model =3D g_strdup("cpu_b"); + + if (virCPUDefAddFeature(cpu_a, "feat_a", VIR_CPU_FEATURE_REQUIRE) < 0 = || + virCPUDefAddFeature(cpu_a, "feat_b", VIR_CPU_FEATURE_REQUIRE) < 0 = || + virCPUDefAddFeature(cpu_a, "feat_c", VIR_CPU_FEATURE_REQUIRE) < 0) + goto cleanup; + + if (qemuMonitorJSONGetCPUModelBaseline(qemuMonitorTestGetMonitor(test), + cpu_a, cpu_b, &baseline) < 0) + goto cleanup; + + if (!baseline) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "Baseline missing result"); + goto cleanup; + } + if (!baseline->name) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "Baseline missing model name"); + goto cleanup; + } + if (baseline->nprops !=3D 2) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "Baseline missing properties"); + goto cleanup; + } + if (STRNEQ(baseline->props[0].name, "feat_a") || + !baseline->props[0].value.boolean || + STRNEQ(baseline->props[1].name, "feat_b") || + baseline->props[1].value.boolean) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "Baseline property error"); + goto cleanup; + } + + ret =3D 0; + + cleanup: + virCPUDefFree(cpu_a); + virCPUDefFree(cpu_b); + qemuMonitorCPUModelInfoFree(baseline); + return ret; +} + + +static int mymain(void) { int ret =3D 0; @@ -3306,6 +3382,7 @@ mymain(void) } =20 DO_TEST(qemuMonitorJSONGetCPUModelComparison); + DO_TEST(qemuMonitorJSONGetCPUModelBaseline); =20 cleanup: VIR_FREE(metaschemastr); --=20 2.7.4