From nobody Wed May 14 02:47:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528102788553113.22157362959763; Mon, 4 Jun 2018 01:59:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4D2FC9DC3; Mon, 4 Jun 2018 08:59:46 +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 7E752600C8; Mon, 4 Jun 2018 08:59:46 +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 2B1424CA8A; Mon, 4 Jun 2018 08:59:46 +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 w548xCAZ018694 for ; Mon, 4 Jun 2018 04:59:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B05D2026E0E; Mon, 4 Jun 2018 08:59:12 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FAF32026DEF for ; Mon, 4 Jun 2018 08:59:11 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 10:58:51 +0200 Message-Id: <7df48cbb4db2679f1fc578d4af53105a44a10b58.1528102541.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/10] tests: storage: Drop duplicate tests with TEST_CHAIN 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 04 Jun 2018 08:59:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that all test cases with TEST_CHAIN were testing the same thing twice drop one of them. Note that some of the cases were duplicate even before dropping the image format probing tests. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- tests/virstoragetest.c | 93 +++++++++++++---------------------------------= ---- 1 file changed, 23 insertions(+), 70 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 4d98310ee1..2236351309 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -752,11 +752,8 @@ mymain(void) #define VIR_FLATTEN_2(...) __VA_ARGS__ #define VIR_FLATTEN_1(_1) VIR_FLATTEN_2 _1 -#define TEST_CHAIN(path, format, chain1, flags1, chain2, flags2) \ - do { \ - TEST_ONE_CHAIN(path, format, flags1, VIR_FLATTEN_1(chain1)); \ - TEST_ONE_CHAIN(path, format, flags2, VIR_FLATTEN_1(chain2)); \ - } while (0) +#define TEST_CHAIN(path, format, chain, flags) \ + TEST_ONE_CHAIN(path, format, flags, VIR_FLATTEN_1(chain)); /* The actual tests, in several groups. */ virTestCounterReset("Storage backing chain "); @@ -770,12 +767,8 @@ mymain(void) .type =3D VIR_STORAGE_TYPE_FILE, .format =3D VIR_STORAGE_FILE_RAW, }; - TEST_CHAIN(absraw, VIR_STORAGE_FILE_RAW, - (&raw), EXP_PASS, - (&raw), EXP_PASS); - TEST_CHAIN(absraw, VIR_STORAGE_FILE_AUTO, - (&raw), EXP_PASS, - (&raw), EXP_PASS); + TEST_CHAIN(absraw, VIR_STORAGE_FILE_RAW, (&raw), EXP_PASS); + TEST_CHAIN(absraw, VIR_STORAGE_FILE_AUTO, (&raw), EXP_PASS); /* Qcow2 file with relative raw backing, format provided */ raw.pathRel =3D "raw"; @@ -791,12 +784,8 @@ mymain(void) .type =3D VIR_STORAGE_TYPE_FILE, .format =3D VIR_STORAGE_FILE_RAW, }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &raw), EXP_PASS, - (&qcow2, &raw), EXP_PASS); - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, - (&qcow2_as_raw), EXP_PASS, - (&qcow2_as_raw), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &raw), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, (&qcow2_as_raw), EXP_PASS); /* Rewrite qcow2 file to use absolute backing name */ virCommandFree(cmd); @@ -808,12 +797,8 @@ mymain(void) raw.pathRel =3D NULL; /* Qcow2 file with raw as absolute backing, backing format provided */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &raw), EXP_PASS, - (&qcow2, &raw), EXP_PASS); - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, - (&qcow2_as_raw), EXP_PASS, - (&qcow2_as_raw), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &raw), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, (&qcow2_as_raw), EXP_PASS); /* Wrapped file access */ testFileData wrap =3D { @@ -823,9 +808,7 @@ mymain(void) .type =3D VIR_STORAGE_TYPE_FILE, .format =3D VIR_STORAGE_FILE_QCOW2, }; - TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, - (&wrap, &qcow2, &raw), EXP_PASS, - (&wrap, &qcow2, &raw), EXP_PASS); + TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2, &raw), EXP= _PASS); /* Rewrite qcow2 and wrap file to omit backing file type */ virCommandFree(cmd); @@ -849,7 +832,6 @@ mymain(void) .format =3D VIR_STORAGE_FILE_QCOW2, }; TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, - (&wrap_as_raw, &qcow2_as_raw), EXP_PASS, (&wrap_as_raw, &qcow2_as_raw), EXP_PASS); /* Rewrite qcow2 to a missing backing file, with backing type */ @@ -862,9 +844,7 @@ mymain(void) qcow2.expBackingStoreRaw =3D datadir "/bogus"; /* Qcow2 file with missing backing file but specified type */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2), EXP_WARN, - (&qcow2), EXP_WARN); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_WARN); /* Rewrite qcow2 to a missing backing file, without backing type */ virCommandFree(cmd); @@ -874,9 +854,7 @@ mymain(void) ret =3D -1; /* Qcow2 file with missing backing file and no specified type */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2), EXP_WARN, - (&qcow2), EXP_WARN); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_WARN); /* Rewrite qcow2 to use an nbd: protocol as backend */ virCommandFree(cmd); @@ -895,9 +873,7 @@ mymain(void) .protocol =3D VIR_STORAGE_NET_PROTOCOL_NBD, .hostname =3D "example.org", }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &nbd), EXP_PASS, - (&qcow2, &nbd), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd), EXP_PASS); /* Rewrite qcow2 to use an nbd: protocol as backend */ virCommandFree(cmd); @@ -916,9 +892,7 @@ mymain(void) .protocol =3D VIR_STORAGE_NET_PROTOCOL_NBD, .hostname =3D "example.org", }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &nbd2), EXP_PASS, - (&qcow2, &nbd2), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd2), EXP_PASS= ); /* Rewrite qcow2 to use an nbd: protocol without path as backend */ virCommandFree(cmd); @@ -930,9 +904,7 @@ mymain(void) qcow2.expBackingStoreRaw =3D "nbd://example.org"; nbd2.path =3D NULL; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &nbd2), EXP_PASS, - (&qcow2, &nbd2), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd2), EXP_PASS= ); /* qed file */ testFileData qed =3D { @@ -947,12 +919,8 @@ mymain(void) .type =3D VIR_STORAGE_TYPE_FILE, .format =3D VIR_STORAGE_FILE_RAW, }; - TEST_CHAIN(absqed, VIR_STORAGE_FILE_QED, - (&qed, &raw), EXP_PASS, - (&qed, &raw), EXP_PASS); - TEST_CHAIN(absqed, VIR_STORAGE_FILE_AUTO, - (&qed_as_raw), EXP_PASS, - (&qed_as_raw), EXP_PASS); + TEST_CHAIN(absqed, VIR_STORAGE_FILE_QED, (&qed, &raw), EXP_PASS); + TEST_CHAIN(absqed, VIR_STORAGE_FILE_AUTO, (&qed_as_raw), EXP_PASS); /* directory */ testFileData dir =3D { @@ -965,15 +933,9 @@ mymain(void) .type =3D VIR_STORAGE_TYPE_DIR, .format =3D VIR_STORAGE_FILE_RAW, }; - TEST_CHAIN(absdir, VIR_STORAGE_FILE_RAW, - (&dir_as_raw), EXP_PASS, - (&dir_as_raw), EXP_PASS); - TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE, - (&dir), EXP_PASS, - (&dir), EXP_PASS); - TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR, - (&dir), EXP_PASS, - (&dir), EXP_PASS); + TEST_CHAIN(absdir, VIR_STORAGE_FILE_RAW, (&dir_as_raw), EXP_PASS); + TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE, (&dir), EXP_PASS); + TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR, (&dir), EXP_PASS); #ifdef HAVE_SYMLINK /* Rewrite qcow2 and wrap file to use backing names relative to a @@ -1011,7 +973,6 @@ mymain(void) raw.path =3D datadir "/sub/../sub/../raw"; raw.pathRel =3D "../raw"; TEST_CHAIN(abslink2, VIR_STORAGE_FILE_QCOW2, - (&link2, &link1, &raw), EXP_PASS, (&link2, &link1, &raw), EXP_PASS); #endif @@ -1024,9 +985,7 @@ mymain(void) qcow2.expBackingStoreRaw =3D "qcow2"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2), EXP_WARN, - (&qcow2), EXP_WARN); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_WARN); /* Rewrite wrap and qcow2 to be mutually-referential loop */ virCommandFree(cmd); @@ -1043,9 +1002,7 @@ mymain(void) qcow2.expBackingStoreRaw =3D "wrap"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, - (&wrap, &qcow2), EXP_WARN, - (&wrap, &qcow2), EXP_WARN); + TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2), EXP_WARN); /* Rewrite qcow2 to use an rbd: protocol as backend */ virCommandFree(cmd); @@ -1063,9 +1020,7 @@ mymain(void) .format =3D VIR_STORAGE_FILE_RAW, .protocol =3D VIR_STORAGE_NET_PROTOCOL_RBD, }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &rbd1), EXP_PASS, - (&qcow2, &rbd1), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &rbd1), EXP_PASS= ); /* Rewrite qcow2 to use an rbd: protocol as backend */ virCommandFree(cmd); @@ -1085,9 +1040,7 @@ mymain(void) .secret =3D "asdf", .hostname =3D "example.com", }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, - (&qcow2, &rbd2), EXP_PASS, - (&qcow2, &rbd2), EXP_PASS); + TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &rbd2), EXP_PASS= ); /* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list