From patchwork Mon Apr 1 16:47:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161543 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp687594jan; Mon, 1 Apr 2019 09:47:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5PFSAQL4RuKyCt9xP3RzdXo+xLlwF4KRPfYDQMpK6dpoqrtr+WeoxUrTVNmLiw/4Va1Ra X-Received: by 2002:a05:620a:11b5:: with SMTP id c21mr41365846qkk.222.1554137261486; Mon, 01 Apr 2019 09:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554137261; cv=none; d=google.com; s=arc-20160816; b=b7lrMr4D2FKWVG6bZ3qDXbUOrXtCaN1M9shjeOQyks0EE1+RN6XSpxbSSz0wEfQHe5 9RJ6vINZpERFvUyrmXBQf7jBCW1XQPVgZgRxnUnHCjTPwkDdOHfdE7+7f0xUO9BG4+QR IX6Wu8pKrqL+2owQSAGAltS9MoUYbjXCBOpqs4Vhm1R/ibVz92W0QoeRJBwLsNavZKPW z4pObO4eYjaVFid40Ad4Fx64IiB8BYlhElplJ1eALHdX6HZ13TOykZiyOegJaYndn4Am NLuZckwlKYn6uCNqz3LaOKDf7d3EAE+2sc7xJ1ToUUGupUq2ttWCfoS2n0mn6GkVcKRQ 9dlg== 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 :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=8uAT8Yd9tHzw9eeFoBonT07UnjKVfb+B7BuGw/DxYIU=; b=XsJN0xlZkUB1gggi94wI46lF7GiznQRrG0a864yqUIckXyikWTtfhENi0btsod5x8N xJljSMJ4a9Epgl1tWAaq+bMqCD+u/pjxTtJlLIBs07FFF0yWu6Ak39RUWMG3PaAEyUWI +DsjKdXE32X8Qb6ZoLZGikHVHRB0lzG0zSPg7m04vnwo02cJsrVLxJuOjIRYIbSmhn/y mSYXEv1EBaVynaNGOSKKQ5HKj9AO1g/OB44LBTxk8/vZAsmeyljk9SL9yYorc5ng24S8 BiqBCOe2aYQQXYYJs5qfJX54MCj8hwaFRVWNL43bzxyvFIohd5TVct5t483tH7L2ZhfX ADrw== 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 k20si2966914qkg.102.2019.04.01.09.47.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 09:47:41 -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-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D85488311; Mon, 1 Apr 2019 16:47:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4176F28543; Mon, 1 Apr 2019 16:47:39 +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 E166841F3E; Mon, 1 Apr 2019 16:47:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x31GlYNA026652 for ; Mon, 1 Apr 2019 12:47:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7ADFD5C27C; Mon, 1 Apr 2019 16:47:34 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-128.rdu2.redhat.com [10.10.124.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 167985C28C; Mon, 1 Apr 2019 16:47:33 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 1 Apr 2019 12:47:17 -0400 Message-Id: <8cc14a94c53a1cf2a82231817680bb47f57cbc26.1554137098.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/12] tests: qemuxml2xml: Break out testInfoSet*Paths 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 01 Apr 2019 16:47:40 +0000 (UTC) These will need to be separate to share testInfo with qemuxml2argv Signed-off-by: Cole Robinson --- tests/qemuxml2xmltest.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 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 83a0d1cf7b..2dfa9e628b 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -129,16 +129,11 @@ testInfoSetCommon(struct testInfo *info, return -1; } - static int -testInfoSet(struct testInfo *info, - const char *name, - int when, - int gic) +testInfoSetPaths(struct testInfo *info, + const char *name, + int when) { - if (testInfoSetCommon(info, gic) < 0) - return -1; - if (virAsprintf(&info->inName, "%s/qemuxml2argvdata/%s.xml", abs_srcdir, name) < 0) goto error; @@ -186,13 +181,9 @@ testInfoSet(struct testInfo *info, static const char *statusPath = abs_srcdir "/qemustatusxml2xmldata/"; static int -testInfoSetStatus(struct testInfo *info, - const char *name, - int gic) +testInfoSetStatusPaths(struct testInfo *info, + const char *name) { - if (testInfoSetCommon(info, gic) < 0) - return -1; - if (virAsprintf(&info->inName, "%s%s-in.xml", statusPath, name) < 0 || virAsprintf(&info->outActiveName, "%s%s-out.xml", statusPath, name) < 0) goto error; @@ -236,7 +227,8 @@ mymain(void) # define DO_TEST_FULL(name, when, gic, ...) \ do { \ - if (testInfoSet(&info, name, when, gic) < 0) { \ + if (testInfoSetCommon(&info, gic) < 0 || \ + testInfoSetPaths(&info, name, when) < 0) { \ VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \ return -1; \ } \ @@ -1241,7 +1233,8 @@ mymain(void) # define DO_TEST_STATUS(name) \ do { \ - if (testInfoSetStatus(&info, name, GIC_NONE) < 0) { \ + if (testInfoSetCommon(&info, GIC_NONE) < 0 || \ + testInfoSetStatusPaths(&info, name) < 0) { \ VIR_TEST_DEBUG("Failed to generate status test data for '%s'", name); \ return -1; \ } \