From patchwork Mon Apr 15 23:09:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162288 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3508355jan; Mon, 15 Apr 2019 16:09:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqymzA4gW+jkic7lRs79eyrBGy2DshrNG/31MQVz5ybNqi/PVynySm1KQfTan6W4fEbnUvWG X-Received: by 2002:ac8:2949:: with SMTP id z9mr66070336qtz.302.1555369789362; Mon, 15 Apr 2019 16:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555369789; cv=none; d=google.com; s=arc-20160816; b=SiwuGSTtUJfCpznyP00oUGKb3VZt9JJcUPdIr1ZK2nLYrBuUzImXmxldsBTi+o7sTu Km0ETL8LOIK8Q+r1AF1IxJ3XwgJNMk+GZY95+ITWxhFOMDE2HPtfdbC3pbRpo08PmJ/T YM9pkPCfd/Ko1FrfIU6ywDG5UB2h1R/BkbFLbr23OoCFlFDU7jx6gjPLNAZvyg5LsBD/ J76V/K8K3rPpBRuR0Bw1lAHDEaPYivwqGhnnUgxu08ggTc7J4tjtnCmVg4RMfsO83GdI qi547e8hlS4urFCAx/Wuc8aPA3y1FxAzHVS9CKu6EKAracZwSgkStdNJvEHHI+8B6mMZ Fxaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=2+QBLx1a3cFqHlj4iybyVwn4jB8Mb+T3c26931zw5mk=; b=A/aCHEKo1ImLrOJcGpxv/IlBYolti78qaZLW1cjnpLLASKrc19BhZmKM/3hNTX4Dc5 mUCvpZ0RZA4kNf8j2DiRMxvldf7CsdkaNkBK1FZd9yAwqY3AC2E/DNaZfpC8u8d1rsVR gyWU05Tzqu/Z/MIP24qI+GzdrsQIzkPic8zSVTP8Qmvb87foXHyo7KdhiSJKil77Gf1G BGrDVM7Msk9+drwHKmdw2wwmo4/ut6GZBCA37m8l75V+lkLcAUwsCOmuVsKZ5oZRpYAo oqIfcQuDwTXDSCh2ao1al3F9QTdjxGFZ5ePcGJbJfscNUyZS80gpsZ66qbn9J7/gpuW7 w4GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id m32si2618473qvg.172.2019.04.15.16.09.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 16:09:49 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D201030944B6; Mon, 15 Apr 2019 23:09:47 +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 ABD26608C2; Mon, 15 Apr 2019 23:09:47 +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 E9DFF181AC47; Mon, 15 Apr 2019 23:09:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FN9SX4019612 for ; Mon, 15 Apr 2019 19:09:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2255E60C5F; Mon, 15 Apr 2019 23:09:28 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-108.rdu2.redhat.com [10.10.124.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9032560C05; Mon, 15 Apr 2019 23:09:27 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 15 Apr 2019 19:09:16 -0400 Message-Id: <3b518b72b71f0ff0151b39391d88baf176ac3e21.1555369583.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?utf-8?q?J=C3=A1n_Tomko?= , Andrea Bolognani Subject: [libvirt] [PATCH v2 2/6] tests: qemuxml2xml: Add DO_TEST_CAPS* 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 15 Apr 2019 23:09:48 +0000 (UTC) Add DO_TEST_CAPS* macros, lifted from qemuxml2argvtest. Signed-off-by: Cole Robinson --- tests/qemuxml2xmltest.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 59c0c2c483..aac050f559 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -90,6 +90,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque) static int testInfoSetPaths(struct testQemuInfo *info, + const char *suffix, int when) { VIR_FREE(info->infile); @@ -100,17 +101,18 @@ testInfoSetPaths(struct testQemuInfo *info, goto error; if (virAsprintf(&info->outfile, - "%s/qemuxml2xmloutdata/%s-%s.xml", + "%s/qemuxml2xmloutdata/%s-%s%s.xml", abs_srcdir, info->name, - when == WHEN_ACTIVE ? "active" : "inactive") < 0) + when == WHEN_ACTIVE ? "active" : "inactive", + suffix) < 0) goto error; if (!virFileExists(info->outfile)) { VIR_FREE(info->outfile); if (virAsprintf(&info->outfile, - "%s/qemuxml2xmloutdata/%s.xml", - abs_srcdir, info->name) < 0) + "%s/qemuxml2xmloutdata/%s%s.xml", + abs_srcdir, info->name, suffix) < 0) goto error; } @@ -170,7 +172,7 @@ mymain(void) cfg = virQEMUDriverGetConfig(&driver); -# define DO_TEST_FULL(_name, when, ...) \ +# define DO_TEST_INTERNAL(_name, suffix, when, ...) \ do { \ static struct testQemuInfo info = { \ .name = _name, \ @@ -184,7 +186,7 @@ mymain(void) } \ \ if (when & WHEN_INACTIVE) { \ - if (testInfoSetPaths(&info, WHEN_INACTIVE) < 0) { \ + if (testInfoSetPaths(&info, suffix, WHEN_INACTIVE) < 0) { \ VIR_TEST_DEBUG("Failed to generate inactive paths for '%s'", _name); \ return -1; \ } \ @@ -194,7 +196,7 @@ mymain(void) } \ \ if (when & WHEN_ACTIVE) { \ - if (testInfoSetPaths(&info, WHEN_ACTIVE) < 0) { \ + if (testInfoSetPaths(&info, suffix, WHEN_ACTIVE) < 0) { \ VIR_TEST_DEBUG("Failed to generate active paths for '%s'", _name); \ return -1; \ } \ @@ -207,10 +209,33 @@ mymain(void) # define NONE QEMU_CAPS_LAST +# define DO_TEST_FULL(name, when, ...) \ + DO_TEST_INTERNAL(name, "", when, __VA_ARGS__) + # define DO_TEST(name, ...) \ DO_TEST_FULL(name, WHEN_BOTH, \ ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST) +# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ + DO_TEST_INTERNAL(name, "." arch "-" ver, WHEN_BOTH, \ + ARG_CAPS_ARCH, arch, \ + ARG_CAPS_VER, ver, \ + __VA_ARGS__) + +# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ + DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) + +# define DO_TEST_CAPS_VER(name, ver) \ + DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) + +# define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \ + DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__) + +# define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ + DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END) + +# define DO_TEST_CAPS_LATEST(name) \ + DO_TEST_CAPS_ARCH_LATEST(name, "x86_64") /* Unset or set all envvars here that are copied in qemudBuildCommandLine