From nobody Mon Feb 9 11:07:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631177389; cv=none; d=zohomail.com; s=zohoarc; b=J6tPoU2GttK152YGctMyblFFvl16N3xj10b1H/gVcBgtnspGstrlF1G5rYv+QhMkxztKZfAlygCGXxG0SbssFJosZR4RGmrxePB9XqpcmWHLVlQ7mDYxvQzpqK7nP/QJwhrYVTDUhw+U9ZCRWEI+28MoISHQVvhoGyTRJYljABg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177389; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8VllSgsJDXaS5wkNvUzuhXWzVO9K7AT5stFDKkI9lPs=; b=A9q6T84xHATlK6iPdy4i7STVbAGlLS2Iknz7qvdeyKVIEDWjNeXnBpMkVpLY8eKjK9iJVaB9TmfFtg8tLmM9Ebx36DnHIHrhmiA5nw53gvhl2YhukP9glB3Bk/Y9rMcfxa16B4fZYcwpsDrHakypsfhzFmgQ/kS/lsTCQmZnWPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631177389482572.0835869544795; Thu, 9 Sep 2021 01:49:49 -0700 (PDT) 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-556-wb6AxUx_NjCaPu9es5czuA-1; Thu, 09 Sep 2021 04:49:47 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CD11802B9E; Thu, 9 Sep 2021 08:49:42 +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 3DFE25DA61; Thu, 9 Sep 2021 08:49:42 +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 10518181A1D0; Thu, 9 Sep 2021 08:49:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1898nbUw030108 for ; Thu, 9 Sep 2021 04:49:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 97F4026DEC; Thu, 9 Sep 2021 08:49:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0731619D9B for ; Thu, 9 Sep 2021 08:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177388; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: 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=8VllSgsJDXaS5wkNvUzuhXWzVO9K7AT5stFDKkI9lPs=; b=UrLaR5bHa7aUT85arkB9hoMMhg82Pwyp2Ss+pOR6/bhvbcRKEtnx+EMSX7+tcqI27gjRgo IDeMgtN+4UDigx1b/WMVuCWb/iV0ipLyM22zWt33MRL/YQuZcbWLP+3YmydoGYD5hXWA7m AqB+gusI7zG/Dfjkb4IL7sglmqZEILQ= X-MC-Unique: wb6AxUx_NjCaPu9es5czuA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/24] virstoragetest: Test backing chain loops with hardcoded images Date: Thu, 9 Sep 2021 10:49:07 +0200 Message-Id: <454a2da83ab1358165c39a5305df4000313c18f6.1631177237.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631177391136100006 Content-Type: text/plain; charset="utf-8" Provide the images for the self and mutual backing image loop cases in the repository rather than formatting them with qemu-img. This makes the code more readable and also decouples the backing chain tests from each other. Signed-off-by: Peter Krempa --- build-aux/syntax-check.mk | 2 +- tests/virstoragetest.c | 30 ++++-------------- tests/virstoragetestdata/images/loop-1.qcow2 | Bin 0 -> 196616 bytes tests/virstoragetestdata/images/loop-2.qcow2 | Bin 0 -> 196616 bytes .../virstoragetestdata/images/loop-self.qcow2 | Bin 0 -> 196616 bytes 5 files changed, 7 insertions(+), 25 deletions(-) create mode 100644 tests/virstoragetestdata/images/loop-1.qcow2 create mode 100644 tests/virstoragetestdata/images/loop-2.qcow2 create mode 100644 tests/virstoragetestdata/images/loop-self.qcow2 diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 2058af0b77..cb54c8ba36 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1563,7 +1563,7 @@ exclude_file_name_regexp--sc_prohibit_close =3D \ (\.p[yl]$$|\.spec\.in$$|^docs/|^(src/util/vir(file|event)\.c|src/libvirt= -stream\.c|tests/(vir.+mock\.c|commandhelper\.c|qemusecuritymock\.c)|tools/= nss/libvirt_nss_(leases|macs)\.c)$$) exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF =3D \ - (^tests/(nodedevmdevctl|virhostcpu|virpcitest)data/|docs/js/.*\.js|docs/= fonts/.*\.woff|\.diff|tests/virconfdata/no-newline\.conf$$) + (^tests/(nodedevmdevctl|virhostcpu|virpcitest|virstoragetest)data/|docs/= js/.*\.js|docs/fonts/.*\.woff|\.diff|tests/virconfdata/no-newline\.conf$$) exclude_file_name_regexp--sc_prohibit_fork_wrappers =3D \ (^(src/(util/(vircommand|virdaemon)|lxc/lxc_controller)|tests/testutils)= \.c$$) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 299b16e119..785699d4e8 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -597,31 +597,13 @@ mymain(void) TEST_CHAIN("qcow2-symlinks", abslink2, VIR_STORAGE_FILE_QCOW2, EXP_PAS= S); #endif - /* Rewrite qcow2 to be a self-referential loop */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", "qcow2", "qcow2", NULL= ); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - - /* Behavior of an infinite loop chain */ - TEST_CHAIN("qcow2-qcow2_infinite-self", absqcow2, VIR_STORAGE_FILE_QCO= W2, EXP_FAIL); - - /* Rewrite wrap and qcow2 to be mutually-referential loop */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", "wrap", "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", absqcow2, "wrap", NULL= ); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - /* Behavior of an infinite loop chain */ - TEST_CHAIN("qcow2-qcow2_infinite-mutual", abswrap, VIR_STORAGE_FILE_QC= OW2, EXP_FAIL); + TEST_CHAIN("qcow2-qcow2_infinite-self", + abs_srcdir "/virstoragetestdata/images/loop-self.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_FAIL); + TEST_CHAIN("qcow2-qcow2_infinite-mutual", + abs_srcdir "/virstoragetestdata/images/loop-2.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_FAIL); /* setup data for backing chain lookup testing */ if (chdir(abs_srcdir "/virstoragetestdata/lookup") < 0) { diff --git a/tests/virstoragetestdata/images/loop-1.qcow2 b/tests/virstorag= etestdata/images/loop-1.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..21b0bb8d8749647b3de277175de= 0611d070b9ee8 GIT binary patch literal 196616 zcmeIvF;2rU6aY{sEgJ(z$czL-4}pZl!o(cfAR?6{q^U}nI11^Oe5dAh-JDELcgORc5D_3ifB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FoH0 z0_lEi(=3DG`RAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyKwv;137_{si4*|>1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF Q5FkK+009C72<(r*2VfXEjsO4v literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/loop-2.qcow2 b/tests/virstorag= etestdata/images/loop-2.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..3e2e020b5a3ac98516e4a5fc557= fbe5aa7e89d39 GIT binary patch literal 196616 zcmeIvF;2rU6aY{sg^htDWJU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pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ R009C72oNAZfWYnud;($kIgJ1S literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/loop-self.qcow2 b/tests/virsto= ragetestdata/images/loop-self.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..c8f5927bed91990513b7d2acacb= da043602e375a GIT binary patch literal 196616 zcmeIvJx=3D5>6aZi+!`5(w)GI;3A&`)0sHn3u9uX-dA(Igd6-U|g>@oHfE79QjW3&Z< ze!fJuU-Dk;`19@6^;-yGl3Kd*v(%lYwjM+Hz3JCowuyFCyQl5DkCIP=3Dla%T9*}tow ze^UJ8aoRpzrr>_^?=3DDUM8p5pVhgI>b8uq2*V>WI3e%TG*{UVRgL+qQfE@tIW7W1l( zqYF%??L*hc#iDAPVpw(K)ghd$=3DWk|lR@__`u^IX*E=3DCr}LS4SBiayS#?XnrhN;k9Q zA;~) literal 0 HcmV?d00001 --=20 2.31.1