From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177383; cv=none; d=zohomail.com; s=zohoarc; b=n4NfIupIQX5xTmD8x1C6V4Pz9qMFlMAdckumEw/XXwPZ9HgxOTh/UOcFTY63raZtiPIbrv//tcrOu4s+GZ8zk8aTNPQVY/UaRUYpDqYc7t4kjZSeHu90+q5q9yrWaTyd6CqxHp3gU7jk4/lhvzxHAipBU4Uv+oOSRIV+6lPVFtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177383; 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=Oq7JFaOUCpxeacRSHHsAknGbDk8Pozys65RYEw27op0=; b=m+4n1rSodvV5mFiUX8EKpMOswCuVH7rhKepZ7hCPaYVM8SZjGh2VlnghzNNFi1ocNil9BVhNpUMZSpdFXzvzXr02ao5/N9eWeZ+e0Kq2+hfhsheQCHuxgywh/nvISx9NkCB3BZWec/tr04ifnpQwL+9DbG1LWblrVRKV5e3+gZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177383405968.3545161413142; Thu, 9 Sep 2021 01:49:43 -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-375-GiYOzts8OOGHwIV8BYns9g-1; Thu, 09 Sep 2021 04:49:40 -0400 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 C4AB91835AC8; Thu, 9 Sep 2021 08:49:35 +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 A6CE05453A; Thu, 9 Sep 2021 08:49:35 +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 74A954EA30; Thu, 9 Sep 2021 08:49:35 +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 1898nVrR030049 for ; Thu, 9 Sep 2021 04:49:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 080CB19D9B; Thu, 9 Sep 2021 08:49:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A58619736 for ; Thu, 9 Sep 2021 08:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177382; 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=Oq7JFaOUCpxeacRSHHsAknGbDk8Pozys65RYEw27op0=; b=OlqrBh5Mi5urkZyRkXzfrh4leLXWAIsMX5P23+rI8T9pJ5jeJkQcAEfekSGI6r7230ugE9 +c+6+76432XQGP1iJCZugQEVw6g/L64N9RD3HzAlu1Gt7U/BMKgp02wb3stskjkp77NELa YkXQMoocfKboeRwq7F9sXedoBlTX4mc= X-MC-Unique: GiYOzts8OOGHwIV8BYns9g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/24] virstoragetest: Drop testing of RBD backends via parsing real images Date: Thu, 9 Sep 2021 10:49:01 +0200 Message-Id: <10d19c2e2f2bad899bd788aecb969232c60f9c51.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.15 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: 1631177384733100006 Content-Type: text/plain; charset="utf-8" We now have specific tests for the backing store parser and previous tests cover the extraction of the backing store string so there's no need for these particular tests. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index b80818bc7b..ab34f2f3be 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -799,44 +799,6 @@ mymain(void) /* Behavior of an infinite loop chain */ TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2), EXP_FAIL); - /* Rewrite qcow2 to use an rbd: protocol as backend */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "rbd:testshare", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - qcow2.expBackingStoreRaw =3D "rbd:testshare"; - - /* Qcow2 file with backing protocol instead of file */ - testFileData rbd1 =3D { - .path =3D "testshare", - .type =3D VIR_STORAGE_TYPE_NETWORK, - .format =3D VIR_STORAGE_FILE_RAW, - .protocol =3D VIR_STORAGE_NET_PROTOCOL_RBD, - }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &rbd1), EXP_PASS= ); - - /* Rewrite qcow2 to use an rbd: protocol as backend */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "rbd:testshare:id=3Dasdf= :mon_host=3Dexample.com", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - qcow2.expBackingStoreRaw =3D "rbd:testshare:id=3Dasdf:mon_host=3Dexamp= le.com"; - - /* Qcow2 file with backing protocol instead of file */ - testFileData rbd2 =3D { - .path =3D "testshare", - .type =3D VIR_STORAGE_TYPE_NETWORK, - .format =3D VIR_STORAGE_FILE_RAW, - .protocol =3D VIR_STORAGE_NET_PROTOCOL_RBD, - .secret =3D "asdf", - .hostname =3D "example.com", - }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &rbd2), EXP_PASS= ); - VIR_WARNINGS_RESET /* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */ --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177381; cv=none; d=zohomail.com; s=zohoarc; b=KV6Ga2+pZswVcv8TUcL7TszhYB9jyyRM+v9JKWUpWpaoP/yBmB1zmjQtDOKVJLHcsWgb1CjF1kogI6iu/AtjU4K47BUPSVK0d8+/Qq6aIGmjQYtVNNVEV5gTANjf5PAB2j5IPQEALb1MYNqGm57kNc/UB6E/iJXGIqiz4PpSZTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177381; 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=MDa51DXmD0+Ym/ZtR/aeQLdTuzgp8+ojhN/WN8fkBTU=; b=P4P8B85UWSSZN5BB4H11feh01pRRCJdS38CWn/V3IDfztObcneWTItymC++p7bSOEergl+P1inLI5LAQ2oqUTYlwwhedJ4iafUSSThgipHqHkhqOKgU2MnDI1gJlh4c8K09duFyew/81co36ro+olOEHpMW9egpSIL2m6PLbTts= 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 1631177381131821.3996443542903; Thu, 9 Sep 2021 01:49:41 -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-8-zARgRZDMOhmF8gPyksVV1Q-1; Thu, 09 Sep 2021 04:49:38 -0400 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 DD58618358EF; Thu, 9 Sep 2021 08:49:33 +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 BEE1060C04; Thu, 9 Sep 2021 08:49:33 +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 8F9824EA29; Thu, 9 Sep 2021 08:49:33 +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 1898nWGr030056 for ; Thu, 9 Sep 2021 04:49:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1082E19D9B; Thu, 9 Sep 2021 08:49:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7304B19736 for ; Thu, 9 Sep 2021 08:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177380; 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=MDa51DXmD0+Ym/ZtR/aeQLdTuzgp8+ojhN/WN8fkBTU=; b=L53S561me5ojgaN1kq0nbPOWCal6PfM1ULzXHTb+C4OLodW4AvFZz41islH+L1IQDFj1HC 0+FH4VrHdnLkHphE/7aJ/aG9xrJvFfBEpidIA15YJT0IOQdlfolSvhf7yoH/1Xc9hoSQ1t CM+367uVP+iAh5z1pCGhhkRK5crZpb0= X-MC-Unique: zARgRZDMOhmF8gPyksVV1Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/24] virstoragetest: Drop testing of NBD backends via parsing real images Date: Thu, 9 Sep 2021 10:49:02 +0200 Message-Id: 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.12 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: 1631177382595100003 Content-Type: text/plain; charset="utf-8" We now have specific tests for the backing store parser and previous tests cover the extraction of the backing store string so there's no need for these particular tests. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index ab34f2f3be..f6af1a17ac 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -651,25 +651,6 @@ mymain(void) TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_FAIL); - /* Rewrite qcow2 to use an nbd: protocol as backend */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "nbd:example.org:6000:ex= portname=3Dblah", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - qcow2.expBackingStoreRaw =3D "nbd:example.org:6000:exportname=3Dblah"; - - /* Qcow2 file with backing protocol instead of file */ - testFileData nbd =3D { - .path =3D "blah", - .type =3D VIR_STORAGE_TYPE_NETWORK, - .format =3D VIR_STORAGE_FILE_RAW, - .protocol =3D VIR_STORAGE_NET_PROTOCOL_NBD, - .hostname =3D "example.org", - }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd), EXP_PASS); - /* Rewrite qcow2 to use an nbd: protocol as backend */ virCommandFree(cmd); cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", @@ -689,18 +670,6 @@ mymain(void) }; TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd2), EXP_PASS= ); - /* Rewrite qcow2 to use an nbd: protocol without path as backend */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "nbd://example.org", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - qcow2.expBackingStoreRaw =3D "nbd://example.org"; - - nbd2.path =3D NULL; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd2), EXP_PASS= ); - /* qed file */ testFileData qed =3D { .expBackingStoreRaw =3D absraw, --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177382; cv=none; d=zohomail.com; s=zohoarc; b=kzABHeEmQmKFNMzKkMjJuE0KEKVT3Hk8ujUv6zVOZIjjO5gMBB7yKt/O5htJ2L91VpWzpSnxHQZKwcuetfGZauprujErwM6LR8PYjkjVW8ZPYwxuqKf0VinwnW2Eu3EFFxujHHlAdj3mLJor/rh+06Hm+z1gZraxhByXF4gjNd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177382; 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=oM8hep2RUoBlIFz1voj6YBPHm16lZsQ9G+J0vx3nh/U=; b=AdGe2qUd7z+58bIUHVuSwsdNX/ktUW3NfPJIvIhW1sH/MWax2TVw6/tmdzHImpLIX/fcPpuq43OVVtu/B+RlKICJ2TwEK78i90Eg6/Ew3rzFWbYWePjfQ2qgw1v4pA4m6I2IM41Z5ENawuxOOx6qjFBNC0+yGy3oXoX6Y9c14Zo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177382818735.833751982676; Thu, 9 Sep 2021 01:49:42 -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-433-QF3p3v90McCnMGZ_4CyJgQ-1; Thu, 09 Sep 2021 04:49:40 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B072B1006AA1; Thu, 9 Sep 2021 08:49:35 +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 935D677BE7; Thu, 9 Sep 2021 08:49:35 +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 63A36180598A; Thu, 9 Sep 2021 08:49:35 +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 1898nX3I030066 for ; Thu, 9 Sep 2021 04:49:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 237CC19736; Thu, 9 Sep 2021 08:49:33 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76DD819D9B for ; Thu, 9 Sep 2021 08:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177381; 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=oM8hep2RUoBlIFz1voj6YBPHm16lZsQ9G+J0vx3nh/U=; b=feSv0y4wBUO1kaK4/Kzkh/cSq5jaVsqxUQXWkTE0NpDDHlBJ3zq22XPWGY34JpqLtl1Ztr TtT1scIZT5tc4xVZfdXsGbEEANyW883BQRvqN1Dcjlwt23IhDS3+/8uBn95z0B1QpVur84 72q2gAy4J4grsSLi5zXc4y1LaIan2zY= X-MC-Unique: QF3p3v90McCnMGZ_4CyJgQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/24] testutils: Introduce helper for stripping bulilddir/srcdir from test outputs Date: Thu, 9 Sep 2021 10:49:03 +0200 Message-Id: <8b1825e2b316b6a892bb9e0c99a1009d3494875a.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.13 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: 1631177384715100005 Content-Type: text/plain; charset="utf-8" In certain cases we want to be able to compare test output containing real paths against a static output file and thus we need a helper which strips srcdir/builddir from given path. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/testutils.c | 30 ++++++++++++++++++++++++++++++ tests/testutils.h | 3 +++ 2 files changed, 33 insertions(+) diff --git a/tests/testutils.c b/tests/testutils.c index 5e9835ee89..185d281e96 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1117,3 +1117,33 @@ const char return virtTestCounterStr; } + + +/** + * virTestStablePath: + * @path: path to make stable + * + * If @path starts with the absolute source directory path, the prefix + * is replaced with the string "ABS_SRCDIR" and similarly the build direct= ory + * is replaced by "ABS_BUILDDIR". This is useful when paths e.g. in output + * test files need to be made stable. + * + * If @path is NULL the equivalent to NULLSTR(path) is returned. + * + * The caller is responsible for freeing the returned buffer. + */ +char * +virTestStablePath(const char *path) +{ + const char *tmp; + + path =3D NULLSTR(path); + + if ((tmp =3D STRSKIP(path, abs_srcdir))) + return g_strdup_printf("ABS_SRCDIR%s", tmp); + + if ((tmp =3D STRSKIP(path, abs_builddir))) + return g_strdup_printf("ABS_BUILDDIR%s", tmp); + + return g_strdup(path); +} diff --git a/tests/testutils.h b/tests/testutils.h index 48de864131..27d135fc02 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -170,3 +170,6 @@ int testCompareDomXML2XMLFiles(virCaps *caps, bool live, unsigned int parseFlags, testCompareDomXML2XMLResult expectResult); + +char * +virTestStablePath(const char *path); --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177387; cv=none; d=zohomail.com; s=zohoarc; b=OnOqXQkeK+yNCLQK81VlgWtJttsp3vreXYEBOg6+cWRAB/S/XPsDz5ifqAOjyHhqmWmF0PXg3Jm1tXPEcYUbueijoSqCh2m8K3BEQmIO48c/hgdbtXxvvgTR8mXNbjtYIHZlSdXwbkon0hKnuZ9NqDPphI7ObQy3FlsPIYOmnzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177387; 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=H4uVb6zEivz+AApl9Gpmwbm3NHcUtUu875g/q0UghD8=; b=bIMUIdAC1wioN+8Gx4rxDylK+IzrDpnr+KpMOPCGzPIZWqqFG+D3COsTgXkJvigFe94P//23JXa6Iwi0V0SaEVGG9lcPn/r5JKnwvu3dYsMR54EacShRbD38fYSceYdRT8qAIQV3ikJf59RLa/qQTqGEgXwIk9IZVHOpO4cAm0k= 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 1631177387023479.8743803923019; Thu, 9 Sep 2021 01:49:47 -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-314-kZ9yKMG6O0WxkBg9NBz3ng-1; Thu, 09 Sep 2021 04:49:44 -0400 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 66BDC1835ACF; Thu, 9 Sep 2021 08:49:38 +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 48B1B6A907; Thu, 9 Sep 2021 08:49:38 +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 192BC1800FE4; Thu, 9 Sep 2021 08:49:38 +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 1898nYSi030077 for ; Thu, 9 Sep 2021 04:49:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70E5026DF9; Thu, 9 Sep 2021 08:49:34 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EF6419736 for ; Thu, 9 Sep 2021 08:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177386; 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=H4uVb6zEivz+AApl9Gpmwbm3NHcUtUu875g/q0UghD8=; b=atnBggSLeVYisO6cy4/uzqRHvXpnMXZMx6tYvHu3h+6MtorYjH4ShBYrL0iprsN+6WSDl1 csW7YYTSoEppz1tKlK4dQFmoPITRuXh7E4bBw9wWMVgbBkJL8MLTTCSfVOjV9AzkShSTQw hStDacHiG0QYHk4dGwxLUxgQpsSUMOg= X-MC-Unique: kZ9yKMG6O0WxkBg9NBz3ng-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/24] virstoragetest: Store output of TEST_CHAIN in output files Date: Thu, 9 Sep 2021 10:49:04 +0200 Message-Id: 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.15 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: 1631177389218100002 Content-Type: text/plain; charset="utf-8" The TEST_CHAIN cases were storing the expected output (or rather data to generate the expected output) in code. This made the code really hard to follow and even harder to modify to add new cases. This patch modifies the code to store the expected output in text files (using the same generator as we've used to) and uses 'virTestCompareToFile' to check the outputs. The result is that the code is way simpler and doesn't require fiddling with 'testFileData' structs when adding new cases. Additionally this removes mixing of code and declaration so we can stop disabling the warning for this file. Another advantage is that the tests are now named so it's easier to figure out if one of them breaks. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 252 ++++-------------- tests/virstoragetestdata/out/directory-dir | 9 + tests/virstoragetestdata/out/directory-none | 9 + tests/virstoragetestdata/out/directory-raw | 9 + .../virstoragetestdata/out/qcow2-auto_raw-raw | 9 + .../out/qcow2-auto_raw-raw-relative | 9 + .../out/qcow2-qcow2_nbd-raw | 19 ++ .../out/qcow2-qcow2_qcow2-qcow2_raw-raw | 29 ++ .../out/qcow2-qcow2_raw-raw | 19 ++ .../out/qcow2-qcow2_raw-raw-relative | 19 ++ tests/virstoragetestdata/out/qcow2-symlinks | 29 ++ tests/virstoragetestdata/out/qed-auto_raw | 9 + tests/virstoragetestdata/out/qed-qed_raw | 19 ++ tests/virstoragetestdata/out/raw-auto | 9 + tests/virstoragetestdata/out/raw-raw | 9 + 15 files changed, 263 insertions(+), 195 deletions(-) create mode 100644 tests/virstoragetestdata/out/directory-dir create mode 100644 tests/virstoragetestdata/out/directory-none create mode 100644 tests/virstoragetestdata/out/directory-raw create mode 100644 tests/virstoragetestdata/out/qcow2-auto_raw-raw create mode 100644 tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_ra= w-raw create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_raw-raw create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relati= ve create mode 100644 tests/virstoragetestdata/out/qcow2-symlinks create mode 100644 tests/virstoragetestdata/out/qed-auto_raw create mode 100644 tests/virstoragetestdata/out/qed-qed_raw create mode 100644 tests/virstoragetestdata/out/raw-auto create mode 100644 tests/virstoragetestdata/out/raw-raw diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index f6af1a17ac..4f4fd4e824 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -218,26 +218,6 @@ testPrepImages(void) goto cleanup; } -/* Many fields of virStorageFileMetadata have the same content whether - * we access the file relatively or absolutely; but file names differ - * depending on how the chain was opened. For ease of testing, we - * test both relative and absolute starts, and use a flag to say which - * of the two variations to compare against. */ -typedef struct _testFileData testFileData; -struct _testFileData -{ - const char *expBackingStoreRaw; - unsigned long long expCapacity; - bool expEncrypted; - const char *pathRel; - const char *path; - int type; - int format; - const char *secret; - const char *hostname; - int protocol; -}; - enum { EXP_PASS =3D 0, EXP_FAIL =3D 1, @@ -245,33 +225,23 @@ enum { struct testChainData { + const char *testname; const char *start; virStorageFileFormat format; - const testFileData *files[4]; - int nfiles; unsigned int flags; }; -static const char testStorageChainFormat[] =3D - "chain member: %zu\n" - "path:%s\n" - "backingStoreRaw: %s\n" - "capacity: %lld\n" - "encryption: %d\n" - "relPath:%s\n" - "type:%d\n" - "format:%d\n" - "protocol:%s\n" - "hostname:%s\n"; - static int testStorageChain(const void *args) { const struct testChainData *data =3D args; virStorageSource *elt; - size_t i =3D 0; g_autoptr(virStorageSource) meta =3D NULL; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *actual =3D NULL; + g_autofree char *expectpath =3D g_strdup_printf("%s/virstoragetestdata= /out/%s", + abs_srcdir, data->testna= me); meta =3D testStorageFileGetMetadata(data->start, data->format, -1, -1); if (!meta) { @@ -290,47 +260,38 @@ testStorageChain(const void *args) return -1; } - elt =3D meta; - while (virStorageSourceIsBacking(elt)) { - g_autofree char *expect =3D NULL; - g_autofree char *actual =3D NULL; + for (elt =3D meta; virStorageSourceIsBacking(elt); elt =3D elt->backin= gStore) { + g_autofree char *strippedPath =3D virTestStablePath(elt->path); + g_autofree char *strippedBackingStoreRaw =3D virTestStablePath(elt= ->backingStoreRaw); + g_autofree char *strippedRelPath =3D virTestStablePath(elt->relPat= h); + + virBufferAsprintf(&buf, + "path:%s\n" + "backingStoreRaw: %s\n" + "capacity: %lld\n" + "encryption: %d\n" + "relPath:%s\n" + "type:%d\n" + "format:%d\n" + "protocol:%s\n" + "hostname:%s\n\n", + strippedPath, + strippedBackingStoreRaw, + elt->capacity, + !!elt->encryption, + strippedRelPath, + elt->type, + elt->format, + virStorageNetProtocolTypeToString(elt->protocol), + NULLSTR(elt->nhosts ? elt->hosts[0].name : NULL)= ); + } - if (i =3D=3D data->nfiles) { - fprintf(stderr, "probed chain was too long\n"); - return -1; - } + virBufferTrim(&buf, "\n"); - expect =3D g_strdup_printf(testStorageChainFormat, i, - NULLSTR(data->files[i]->path), - NULLSTR(data->files[i]->expBackingStoreRa= w), - data->files[i]->expCapacity, - data->files[i]->expEncrypted, - NULLSTR(data->files[i]->pathRel), - data->files[i]->type, - data->files[i]->format, - virStorageNetProtocolTypeToString(data->f= iles[i]->protocol), - NULLSTR(data->files[i]->hostname)); - actual =3D g_strdup_printf(testStorageChainFormat, i, - NULLSTR(elt->path), - NULLSTR(elt->backingStoreRaw), - elt->capacity, - !!elt->encryption, - NULLSTR(elt->relPath), - elt->type, - elt->format, - virStorageNetProtocolTypeToString(elt->pr= otocol), - NULLSTR(elt->nhosts ? elt->hosts[0].name = : NULL)); - if (STRNEQ(expect, actual)) { - virTestDifference(stderr, expect, actual); - return -1; - } - elt =3D elt->backingStore; - i++; - } - if (i !=3D data->nfiles) { - fprintf(stderr, "probed chain was too short\n"); + actual =3D virBufferContentAndReset(&buf); + + if (virTestCompareToFile(actual, expectpath) < 0) return -1; - } return 0; } @@ -561,59 +522,23 @@ mymain(void) if ((ret =3D testPrepImages()) !=3D 0) return ret; -#define TEST_ONE_CHAIN(start, format, flags, ...) \ +#define TEST_CHAIN(testname, start, format, flags) \ do { \ - size_t i; \ - memset(&data, 0, sizeof(data)); \ - data =3D (struct testChainData){ \ - start, format, { __VA_ARGS__ }, 0, flags, \ - }; \ - for (i =3D 0; i < G_N_ELEMENTS(data.files); i++) \ - if (data.files[i]) \ - data.nfiles++; \ - if (virTestRun(virTestCounterNext(), \ - testStorageChain, &data) < 0) \ + data =3D (struct testChainData){ testname, start, format, flags };= \ + if (virTestRun(testname, testStorageChain, &data) < 0) \ ret =3D -1; \ } while (0) -#define VIR_FLATTEN_2(...) __VA_ARGS__ -#define VIR_FLATTEN_1(_1) VIR_FLATTEN_2 _1 - -#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 "); - /* Missing file */ - TEST_ONE_CHAIN("bogus", VIR_STORAGE_FILE_RAW, EXP_FAIL); + TEST_CHAIN("missing", "bogus", VIR_STORAGE_FILE_RAW, EXP_FAIL); - VIR_WARNINGS_NO_DECLARATION_AFTER_STATEMENT /* Raw image, whether with right format or no specified format */ - testFileData raw =3D { - .path =3D absraw, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_RAW, - }; - TEST_CHAIN(absraw, VIR_STORAGE_FILE_RAW, (&raw), EXP_PASS); - TEST_CHAIN(absraw, VIR_STORAGE_FILE_AUTO, (&raw), EXP_PASS); + TEST_CHAIN("raw-raw", absraw, VIR_STORAGE_FILE_RAW, EXP_PASS); + TEST_CHAIN("raw-auto", absraw, VIR_STORAGE_FILE_AUTO, EXP_PASS); /* Qcow2 file with relative raw backing, format provided */ - raw.pathRel =3D "raw"; - testFileData qcow2 =3D { - .expBackingStoreRaw =3D "raw", - .expCapacity =3D 1024, - .path =3D absqcow2, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_QCOW2, - }; - testFileData qcow2_as_raw =3D { - .path =3D absqcow2, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_RAW, - }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &raw), EXP_PASS); - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, (&qcow2_as_raw), EXP_PASS); + TEST_CHAIN("qcow2-qcow2_raw-raw-relative", absqcow2, VIR_STORAGE_FILE_= QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-auto_raw-raw-relative", absqcow2, VIR_STORAGE_FILE_A= UTO, EXP_PASS); /* Rewrite qcow2 file to use absolute backing name */ virCommandFree(cmd); @@ -621,22 +546,13 @@ mymain(void) "-F", "raw", "-b", absraw, "qcow2", NULL); if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - qcow2.expBackingStoreRaw =3D absraw; - 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); - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO, (&qcow2_as_raw), EXP_PASS); - - /* Wrapped file access */ - testFileData wrap =3D { - .expBackingStoreRaw =3D absqcow2, - .expCapacity =3D 1024, - .path =3D abswrap, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_QCOW2, - }; - TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2, &raw), EXP= _PASS); + TEST_CHAIN("qcow2-qcow2_raw-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_PASS); + TEST_CHAIN("qcow2-auto_raw-raw", absqcow2, VIR_STORAGE_FILE_AUTO, EXP_= PASS); + + /* qcow2 with a longer backing chain */ + TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FIL= E_QCOW2, EXP_PASS); /* Rewrite qcow2 to a missing backing file, with backing type */ virCommandFree(cmd); @@ -645,10 +561,9 @@ mymain(void) "qcow2", NULL); if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - qcow2.expBackingStoreRaw =3D datadir "/bogus"; /* Qcow2 file with missing backing file but specified type */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_FAIL); + TEST_CHAIN("qcow2-qcow2_missing", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_FAIL); /* Rewrite qcow2 to use an nbd: protocol as backend */ @@ -658,48 +573,18 @@ mymain(void) "qcow2", NULL); if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - qcow2.expBackingStoreRaw =3D "nbd+tcp://example.org:6000/blah"; /* Qcow2 file with backing protocol instead of file */ - testFileData nbd2 =3D { - .path =3D "blah", - .type =3D VIR_STORAGE_TYPE_NETWORK, - .format =3D VIR_STORAGE_FILE_RAW, - .protocol =3D VIR_STORAGE_NET_PROTOCOL_NBD, - .hostname =3D "example.org", - }; - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2, &nbd2), EXP_PASS= ); + TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_PASS); /* qed file */ - testFileData qed =3D { - .expBackingStoreRaw =3D absraw, - .expCapacity =3D 1024, - .path =3D absqed, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_QED, - }; - testFileData qed_as_raw =3D { - .path =3D absqed, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_RAW, - }; - TEST_CHAIN(absqed, VIR_STORAGE_FILE_QED, (&qed, &raw), EXP_PASS); - TEST_CHAIN(absqed, VIR_STORAGE_FILE_AUTO, (&qed_as_raw), EXP_PASS); + TEST_CHAIN("qed-qed_raw", absqed, VIR_STORAGE_FILE_QED, EXP_PASS); + TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS); /* directory */ - testFileData dir =3D { - .path =3D absdir, - .type =3D VIR_STORAGE_TYPE_DIR, - .format =3D VIR_STORAGE_FILE_DIR, - }; - testFileData dir_as_raw =3D { - .path =3D absdir, - .type =3D VIR_STORAGE_TYPE_DIR, - .format =3D VIR_STORAGE_FILE_RAW, - }; - 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); + TEST_CHAIN("directory-raw", absdir, VIR_STORAGE_FILE_RAW, EXP_PASS); + TEST_CHAIN("directory-none", absdir, VIR_STORAGE_FILE_NONE, EXP_PASS); + TEST_CHAIN("directory-dir", absdir, VIR_STORAGE_FILE_DIR, EXP_PASS); #ifdef WITH_SYMLINK /* Rewrite qcow2 and wrap file to use backing names relative to a @@ -718,26 +603,7 @@ mymain(void) ret =3D -1; /* Behavior of symlinks to qcow2 with relative backing files */ - testFileData link1 =3D { - .expBackingStoreRaw =3D "../raw", - .expCapacity =3D 1024, - .pathRel =3D "../sub/link1", - .path =3D datadir "/sub/../sub/link1", - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_QCOW2, - }; - testFileData link2 =3D { - .expBackingStoreRaw =3D "../sub/link1", - .expCapacity =3D 1024, - .path =3D abslink2, - .type =3D VIR_STORAGE_TYPE_FILE, - .format =3D VIR_STORAGE_FILE_QCOW2, - }; - - raw.path =3D datadir "/sub/../sub/../raw"; - raw.pathRel =3D "../raw"; - TEST_CHAIN(abslink2, VIR_STORAGE_FILE_QCOW2, - (&link2, &link1, &raw), EXP_PASS); + TEST_CHAIN("qcow2-symlinks", abslink2, VIR_STORAGE_FILE_QCOW2, EXP_PAS= S); #endif /* Rewrite qcow2 to be a self-referential loop */ @@ -746,10 +612,9 @@ mymain(void) "-F", "qcow2", "-b", "qcow2", "qcow2", NULL= ); if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - qcow2.expBackingStoreRaw =3D "qcow2"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_FAIL); + 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); @@ -763,12 +628,9 @@ mymain(void) "-F", "qcow2", "-b", absqcow2, "wrap", NULL= ); if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - qcow2.expBackingStoreRaw =3D "wrap"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2), EXP_FAIL); - - VIR_WARNINGS_RESET + TEST_CHAIN("qcow2-qcow2_infinite-mutual", abswrap, VIR_STORAGE_FILE_QC= OW2, EXP_FAIL); /* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */ virCommandFree(cmd); diff --git a/tests/virstoragetestdata/out/directory-dir b/tests/virstoraget= estdata/out/directory-dir new file mode 100644 index 0000000000..cff67595b4 --- /dev/null +++ b/tests/virstoragetestdata/out/directory-dir @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/dir +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:3 +format:2 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/directory-none b/tests/virstorage= testdata/out/directory-none new file mode 100644 index 0000000000..cff67595b4 --- /dev/null +++ b/tests/virstoragetestdata/out/directory-none @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/dir +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:3 +format:2 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/directory-raw b/tests/virstoraget= estdata/out/directory-raw new file mode 100644 index 0000000000..ebe23cbbd6 --- /dev/null +++ b/tests/virstoragetestdata/out/directory-raw @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/dir +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:3 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-auto_raw-raw b/tests/virsto= ragetestdata/out/qcow2-auto_raw-raw new file mode 100644 index 0000000000..4a01b24589 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-auto_raw-raw @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative b/tes= ts/virstoragetestdata/out/qcow2-auto_raw-raw-relative new file mode 100644 index 0000000000..4a01b24589 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw b/tests/virst= oragetestdata/out/qcow2-qcow2_nbd-raw new file mode 100644 index 0000000000..64acdb880a --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw @@ -0,0 +1,19 @@ +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: nbd+tcp://example.org:6000/blah +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:blah +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:4 +format:1 +protocol:nbd +hostname:example.org diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw b= /tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw new file mode 100644 index 0000000000..5f93fe746b --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw @@ -0,0 +1,29 @@ +path:ABS_BUILDDIR/virstoragedata/wrap +backingStoreRaw: ABS_BUILDDIR/virstoragedata/qcow2 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw b/tests/virst= oragetestdata/out/qcow2-qcow2_raw-raw new file mode 100644 index 0000000000..57ce62a376 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw @@ -0,0 +1,19 @@ +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative b/te= sts/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative new file mode 100644 index 0000000000..a1fb142e98 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative @@ -0,0 +1,19 @@ +path:ABS_BUILDDIR/virstoragedata/qcow2 +backingStoreRaw: raw +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath:raw +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-symlinks b/tests/virstorage= testdata/out/qcow2-symlinks new file mode 100644 index 0000000000..ed37f61e9f --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-symlinks @@ -0,0 +1,29 @@ +path:ABS_BUILDDIR/virstoragedata/sub/link2 +backingStoreRaw: ../sub/link1 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/sub/../sub/link1 +backingStoreRaw: ../raw +capacity: 1024 +encryption: 0 +relPath:../sub/link1 +type:1 +format:14 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/sub/../sub/../raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath:../raw +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qed-auto_raw b/tests/virstoragete= stdata/out/qed-auto_raw new file mode 100644 index 0000000000..e8ab498038 --- /dev/null +++ b/tests/virstoragetestdata/out/qed-auto_raw @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/qed +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qed-qed_raw b/tests/virstoragetes= tdata/out/qed-qed_raw new file mode 100644 index 0000000000..70a75c4e37 --- /dev/null +++ b/tests/virstoragetestdata/out/qed-qed_raw @@ -0,0 +1,19 @@ +path:ABS_BUILDDIR/virstoragedata/qed +backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:15 +protocol:none +hostname: + +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/raw-auto b/tests/virstoragetestda= ta/out/raw-auto new file mode 100644 index 0000000000..8d6c525896 --- /dev/null +++ b/tests/virstoragetestdata/out/raw-auto @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/raw-raw b/tests/virstoragetestdat= a/out/raw-raw new file mode 100644 index 0000000000..8d6c525896 --- /dev/null +++ b/tests/virstoragetestdata/out/raw-raw @@ -0,0 +1,9 @@ +path:ABS_BUILDDIR/virstoragedata/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath: +type:1 +format:1 +protocol:none +hostname: --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177388; cv=none; d=zohomail.com; s=zohoarc; b=F7Dbpa2YzgcdGP1IPgBLXTIR3dSsffJjtyyxDnRlTBUgJ38UhP8gXP4XcZYx2ztmbP6RSjgdp6BfNEdIE+YcCbDCz6ovvCRZn+mf3PKSi7iyTCiNG8TmAiuZ88wOVA5+mpIl7CyWd3sD71CQRVFdOwi6nXBPNZ7LEoPjwGj2Gs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177388; 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=lWYTYgDQDBz5z7PfKJlOnImNpNxUPV76TEkRj8FrUmo=; b=g1qhnloyVVPSJj2yvgMTy2gOkei2lDoVvd9UipzngbiwXfFnGt3g835lGeLQYTlHuM5KMlS6NOmQs54sn/piOwvzRjonqw4+SJmiNXWn/v6ZusAxSZ3ugtHTONCEL8P9OAJRIg9C5kGIgdqyfGbVZHSWgNYRNKCXBUZ5D7aCv7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177388490581.4921974364511; Thu, 9 Sep 2021 01:49:48 -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-125-VlNn1LgwOFq6XD6Oy9RJzw-1; Thu, 09 Sep 2021 04:49:46 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC3E91006AB1; Thu, 9 Sep 2021 08:49:39 +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 A04546F7F0; Thu, 9 Sep 2021 08:49: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 43E391806D03; Thu, 9 Sep 2021 08:49:39 +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 1898nZMW030090 for ; Thu, 9 Sep 2021 04:49:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80DC619736; Thu, 9 Sep 2021 08:49:35 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id D469119D9B for ; Thu, 9 Sep 2021 08:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177387; 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=lWYTYgDQDBz5z7PfKJlOnImNpNxUPV76TEkRj8FrUmo=; b=BHUR/hU2E5+pvmc7UP7aUIe1hDY6O7LkLTKHlvDJDI8LBFBNIt/1BEtV+PSXmy8Edi62yq vFR2ySGUY2Ejy8BJyqVW3xFIQmK+Na8Wo+mrpUvYNg7dF0mR3JnUJz3k/WMLH24d/U4VpK QbTuDovQTTwCVGuGf2HBAXPI/rjMJIQ= X-MC-Unique: VlNn1LgwOFq6XD6Oy9RJzw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/24] virstoragetest: Remove redundant arguments for chain lookup tests Date: Thu, 9 Sep 2021 10:49:05 +0200 Message-Id: <7c996bf229db80089f5bcd31e70b198feabea59e.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.11 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: 1631177389209100001 Content-Type: text/plain; charset="utf-8" Passing in both "chain*" and "chain*->path" is pointless. Use only the full struct which we can use to infer the rest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 201 +++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 107 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 4f4fd4e824..a3f9c537e5 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -303,7 +303,6 @@ struct testLookupData virStorageSource *from; const char *name; unsigned int expIndex; - const char *expResult; virStorageSource *expMeta; virStorageSource *expParent; }; @@ -318,25 +317,16 @@ testStorageLookup(const void *args) result =3D virStorageSourceChainLookup(data->chain, data->from, data->name, data->target, &actual= Parent); - if (!data->expResult) + if (!data->expMeta) virResetLastError(); - if (!result) { - if (data->expResult) { - fprintf(stderr, "result: expected %s, got NULL\n", - data->expResult); - ret =3D -1; - } - } else if (STRNEQ_NULLABLE(data->expResult, result->path)) { - fprintf(stderr, "result: expected %s, got %s\n", - NULLSTR(data->expResult), NULLSTR(result->path)); - ret =3D -1; - } if (data->expMeta !=3D result) { - fprintf(stderr, "meta: expected %p, got %p\n", - data->expMeta, result); + fprintf(stderr, "meta: expected %s, got %s\n", + NULLSTR(data->expMeta ? data->expMeta->path : NULL), + NULLSTR(result ? result->path : NULL)); ret =3D -1; } + if (data->expIndex > 0) { if (!result) { fprintf(stderr, "index: resulting lookup is empty, can't match= index\n"); @@ -649,47 +639,44 @@ mymain(void) chain2 =3D chain->backingStore; chain3 =3D chain2->backingStore; -#define TEST_LOOKUP_TARGET(id, target, from, name, index, result, \ - meta, parent) \ +#define TEST_LOOKUP_TARGET(id, target, from, name, index, meta, parent) \ do { \ data2 =3D (struct testLookupData){ \ - chain, target, from, name, index, \ - result, meta, parent, }; \ - if (virTestRun("Chain lookup " #id, \ - testStorageLookup, &data2) < 0) \ + chain, target, from, name, index, meta, parent, }; \ + if (virTestRun("Chain lookup " #id, testStorageLookup, &data2) < 0= ) \ ret =3D -1; \ } while (0) -#define TEST_LOOKUP(id, from, name, result, meta, parent) \ - TEST_LOOKUP_TARGET(id, NULL, from, name, 0, result, meta, parent) - - TEST_LOOKUP(0, NULL, "bogus", NULL, NULL, NULL); - TEST_LOOKUP(1, chain, "bogus", NULL, NULL, NULL); - TEST_LOOKUP(2, NULL, "wrap", chain->path, chain, NULL); - TEST_LOOKUP(3, chain, "wrap", NULL, NULL, NULL); - TEST_LOOKUP(4, chain2, "wrap", NULL, NULL, NULL); - TEST_LOOKUP(5, NULL, abswrap, chain->path, chain, NULL); - TEST_LOOKUP(6, chain, abswrap, NULL, NULL, NULL); - TEST_LOOKUP(7, chain2, abswrap, NULL, NULL, NULL); - TEST_LOOKUP(8, NULL, "qcow2", chain2->path, chain2, chain); - TEST_LOOKUP(9, chain, "qcow2", chain2->path, chain2, chain); - TEST_LOOKUP(10, chain2, "qcow2", NULL, NULL, NULL); - TEST_LOOKUP(11, chain3, "qcow2", NULL, NULL, NULL); - TEST_LOOKUP(12, NULL, absqcow2, chain2->path, chain2, chain); - TEST_LOOKUP(13, chain, absqcow2, chain2->path, chain2, chain); - TEST_LOOKUP(14, chain2, absqcow2, NULL, NULL, NULL); - TEST_LOOKUP(15, chain3, absqcow2, NULL, NULL, NULL); - TEST_LOOKUP(16, NULL, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(17, chain, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(18, chain2, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(19, chain3, "raw", NULL, NULL, NULL); - TEST_LOOKUP(20, NULL, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(21, chain, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(22, chain2, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(23, chain3, absraw, NULL, NULL, NULL); - TEST_LOOKUP(24, NULL, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(25, chain, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(26, chain2, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(27, chain3, NULL, NULL, NULL, NULL); +#define TEST_LOOKUP(id, from, name, meta, parent) \ + TEST_LOOKUP_TARGET(id, NULL, from, name, 0, meta, parent) + + TEST_LOOKUP(0, NULL, "bogus", NULL, NULL); + TEST_LOOKUP(1, chain, "bogus", NULL, NULL); + TEST_LOOKUP(2, NULL, "wrap", chain, NULL); + TEST_LOOKUP(3, chain, "wrap", NULL, NULL); + TEST_LOOKUP(4, chain2, "wrap", NULL, NULL); + TEST_LOOKUP(5, NULL, abswrap, chain, NULL); + TEST_LOOKUP(6, chain, abswrap, NULL, NULL); + TEST_LOOKUP(7, chain2, abswrap, NULL, NULL); + TEST_LOOKUP(8, NULL, "qcow2", chain2, chain); + TEST_LOOKUP(9, chain, "qcow2", chain2, chain); + TEST_LOOKUP(10, chain2, "qcow2", NULL, NULL); + TEST_LOOKUP(11, chain3, "qcow2", NULL, NULL); + TEST_LOOKUP(12, NULL, absqcow2, chain2, chain); + TEST_LOOKUP(13, chain, absqcow2, chain2, chain); + TEST_LOOKUP(14, chain2, absqcow2, NULL, NULL); + TEST_LOOKUP(15, chain3, absqcow2, NULL, NULL); + TEST_LOOKUP(16, NULL, "raw", chain3, chain2); + TEST_LOOKUP(17, chain, "raw", chain3, chain2); + TEST_LOOKUP(18, chain2, "raw", chain3, chain2); + TEST_LOOKUP(19, chain3, "raw", NULL, NULL); + TEST_LOOKUP(20, NULL, absraw, chain3, chain2); + TEST_LOOKUP(21, chain, absraw, chain3, chain2); + TEST_LOOKUP(22, chain2, absraw, chain3, chain2); + TEST_LOOKUP(23, chain3, absraw, NULL, NULL); + TEST_LOOKUP(24, NULL, NULL, chain3, chain2); + TEST_LOOKUP(25, chain, NULL, chain3, chain2); + TEST_LOOKUP(26, chain2, NULL, chain3, chain2); + TEST_LOOKUP(27, chain3, NULL, NULL, NULL); /* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */ virCommandFree(cmd); @@ -714,34 +701,34 @@ mymain(void) chain2 =3D chain->backingStore; chain3 =3D chain2->backingStore; - TEST_LOOKUP(28, NULL, "bogus", NULL, NULL, NULL); - TEST_LOOKUP(29, chain, "bogus", NULL, NULL, NULL); - TEST_LOOKUP(30, NULL, "wrap", chain->path, chain, NULL); - TEST_LOOKUP(31, chain, "wrap", NULL, NULL, NULL); - TEST_LOOKUP(32, chain2, "wrap", NULL, NULL, NULL); - TEST_LOOKUP(33, NULL, abswrap, chain->path, chain, NULL); - TEST_LOOKUP(34, chain, abswrap, NULL, NULL, NULL); - TEST_LOOKUP(35, chain2, abswrap, NULL, NULL, NULL); - TEST_LOOKUP(36, NULL, "qcow2", chain2->path, chain2, chain); - TEST_LOOKUP(37, chain, "qcow2", chain2->path, chain2, chain); - TEST_LOOKUP(38, chain2, "qcow2", NULL, NULL, NULL); - TEST_LOOKUP(39, chain3, "qcow2", NULL, NULL, NULL); - TEST_LOOKUP(40, NULL, absqcow2, chain2->path, chain2, chain); - TEST_LOOKUP(41, chain, absqcow2, chain2->path, chain2, chain); - TEST_LOOKUP(42, chain2, absqcow2, NULL, NULL, NULL); - TEST_LOOKUP(43, chain3, absqcow2, NULL, NULL, NULL); - TEST_LOOKUP(44, NULL, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(45, chain, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(46, chain2, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(47, chain3, "raw", NULL, NULL, NULL); - TEST_LOOKUP(48, NULL, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(49, chain, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(50, chain2, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(51, chain3, absraw, NULL, NULL, NULL); - TEST_LOOKUP(52, NULL, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(53, chain, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(54, chain2, NULL, chain3->path, chain3, chain2); - TEST_LOOKUP(55, chain3, NULL, NULL, NULL, NULL); + TEST_LOOKUP(28, NULL, "bogus", NULL, NULL); + TEST_LOOKUP(29, chain, "bogus", NULL, NULL); + TEST_LOOKUP(30, NULL, "wrap", chain, NULL); + TEST_LOOKUP(31, chain, "wrap", NULL, NULL); + TEST_LOOKUP(32, chain2, "wrap", NULL, NULL); + TEST_LOOKUP(33, NULL, abswrap, chain, NULL); + TEST_LOOKUP(34, chain, abswrap, NULL, NULL); + TEST_LOOKUP(35, chain2, abswrap, NULL, NULL); + TEST_LOOKUP(36, NULL, "qcow2", chain2, chain); + TEST_LOOKUP(37, chain, "qcow2", chain2, chain); + TEST_LOOKUP(38, chain2, "qcow2", NULL, NULL); + TEST_LOOKUP(39, chain3, "qcow2", NULL, NULL); + TEST_LOOKUP(40, NULL, absqcow2, chain2, chain); + TEST_LOOKUP(41, chain, absqcow2, chain2, chain); + TEST_LOOKUP(42, chain2, absqcow2, NULL, NULL); + TEST_LOOKUP(43, chain3, absqcow2, NULL, NULL); + TEST_LOOKUP(44, NULL, "raw", chain3, chain2); + TEST_LOOKUP(45, chain, "raw", chain3, chain2); + TEST_LOOKUP(46, chain2, "raw", chain3, chain2); + TEST_LOOKUP(47, chain3, "raw", NULL, NULL); + TEST_LOOKUP(48, NULL, absraw, chain3, chain2); + TEST_LOOKUP(49, chain, absraw, chain3, chain2); + TEST_LOOKUP(50, chain2, absraw, chain3, chain2); + TEST_LOOKUP(51, chain3, absraw, NULL, NULL); + TEST_LOOKUP(52, NULL, NULL, chain3, chain2); + TEST_LOOKUP(53, chain, NULL, chain3, chain2); + TEST_LOOKUP(54, chain2, NULL, chain3, chain2); + TEST_LOOKUP(55, chain3, NULL, NULL, NULL); /* Use link to wrap with cross-directory relative backing */ virCommandFree(cmd); @@ -761,33 +748,33 @@ mymain(void) chain2 =3D chain->backingStore; chain3 =3D chain2->backingStore; - TEST_LOOKUP(56, NULL, "bogus", NULL, NULL, NULL); - TEST_LOOKUP(57, NULL, "sub/link2", chain->path, chain, NULL); - TEST_LOOKUP(58, NULL, "wrap", chain->path, chain, NULL); - TEST_LOOKUP(59, NULL, abswrap, chain->path, chain, NULL); - TEST_LOOKUP(60, NULL, "../qcow2", chain2->path, chain2, chain); - TEST_LOOKUP(61, NULL, "qcow2", NULL, NULL, NULL); - TEST_LOOKUP(62, NULL, absqcow2, chain2->path, chain2, chain); - TEST_LOOKUP(63, NULL, "raw", chain3->path, chain3, chain2); - TEST_LOOKUP(64, NULL, absraw, chain3->path, chain3, chain2); - TEST_LOOKUP(65, NULL, NULL, chain3->path, chain3, chain2); - - TEST_LOOKUP_TARGET(66, "vda", NULL, "bogus[1]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(67, "vda", NULL, "vda[-1]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(68, "vda", NULL, "vda[1][1]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(69, "vda", NULL, "wrap", 0, chain->path, chain, NUL= L); - TEST_LOOKUP_TARGET(70, "vda", chain, "wrap", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(71, "vda", chain2, "wrap", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(72, "vda", NULL, "vda[0]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(73, "vda", NULL, "vda[1]", 1, chain2->path, chain2,= chain); - TEST_LOOKUP_TARGET(74, "vda", chain, "vda[1]", 1, chain2->path, chain2= , chain); - TEST_LOOKUP_TARGET(75, "vda", chain2, "vda[1]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(76, "vda", chain3, "vda[1]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(77, "vda", NULL, "vda[2]", 2, chain3->path, chain3,= chain2); - TEST_LOOKUP_TARGET(78, "vda", chain, "vda[2]", 2, chain3->path, chain3= , chain2); - TEST_LOOKUP_TARGET(79, "vda", chain2, "vda[2]", 2, chain3->path, chain= 3, chain2); - TEST_LOOKUP_TARGET(80, "vda", chain3, "vda[2]", 0, NULL, NULL, NULL); - TEST_LOOKUP_TARGET(81, "vda", NULL, "vda[3]", 0, NULL, NULL, NULL); + TEST_LOOKUP(56, NULL, "bogus", NULL, NULL); + TEST_LOOKUP(57, NULL, "sub/link2", chain, NULL); + TEST_LOOKUP(58, NULL, "wrap", chain, NULL); + TEST_LOOKUP(59, NULL, abswrap, chain, NULL); + TEST_LOOKUP(60, NULL, "../qcow2", chain2, chain); + TEST_LOOKUP(61, NULL, "qcow2", NULL, NULL); + TEST_LOOKUP(62, NULL, absqcow2, chain2, chain); + TEST_LOOKUP(63, NULL, "raw", chain3, chain2); + TEST_LOOKUP(64, NULL, absraw, chain3, chain2); + TEST_LOOKUP(65, NULL, NULL, chain3, chain2); + + TEST_LOOKUP_TARGET(66, "vda", NULL, "bogus[1]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(67, "vda", NULL, "vda[-1]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(68, "vda", NULL, "vda[1][1]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(69, "vda", NULL, "wrap", 0, chain, NULL); + TEST_LOOKUP_TARGET(70, "vda", chain, "wrap", 0, NULL, NULL); + TEST_LOOKUP_TARGET(71, "vda", chain2, "wrap", 0, NULL, NULL); + TEST_LOOKUP_TARGET(72, "vda", NULL, "vda[0]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(73, "vda", NULL, "vda[1]", 1, chain2, chain); + TEST_LOOKUP_TARGET(74, "vda", chain, "vda[1]", 1, chain2, chain); + TEST_LOOKUP_TARGET(75, "vda", chain2, "vda[1]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(76, "vda", chain3, "vda[1]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(77, "vda", NULL, "vda[2]", 2, chain3, chain2); + TEST_LOOKUP_TARGET(78, "vda", chain, "vda[2]", 2, chain3, chain2); + TEST_LOOKUP_TARGET(79, "vda", chain2, "vda[2]", 2, chain3, chain2); + TEST_LOOKUP_TARGET(80, "vda", chain3, "vda[2]", 0, NULL, NULL); + TEST_LOOKUP_TARGET(81, "vda", NULL, "vda[3]", 0, NULL, NULL); #define TEST_RELATIVE_BACKING(id, TOP, BASE, EXPECT) \ do { \ --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177392; cv=none; d=zohomail.com; s=zohoarc; b=CIZ9Bv7fwve1IMP0T91TmgZcYv6NF3KO19CgQg73hVZbc3+llLPdsEoB+w2+RDtULQqRJ7ryLSiBR9BNcYwKC/wZ4qQxsCUX4anPYDhLwR3Lovhfrjf9JD/qTePF3lx2Cp7/OAZtGaTf6gvw1Dhwpn8CfHm86rTqco3SSGcuF54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177392; 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=bNfzxFH8/4EYE0SV+pnUMA/gSI1HRU78jMxJoAdN7D0=; b=OtCco8INdQBWrYq/RtSP5uGwILRVoogUpbLYJp2rynEZPxmBxzUj62rXyGXlMFtJ/W/3db748r1NAVsX57U0Kb4KiPB9QiWX8nZp4FPrH2cHYNND0wxYgjrRFJkP7+a/4atVDmcd6YHJsMO4kuvAzSneBWYq/7k/LKHQO7KwOoA= 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 1631177392878921.6750870227937; Thu, 9 Sep 2021 01:49:52 -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-352-BYakmhv1MPu2BvlX4UImrg-1; Thu, 09 Sep 2021 04:49:45 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 909E4802C89; Thu, 9 Sep 2021 08:49:39 +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 419FA19D9B; Thu, 9 Sep 2021 08:49: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 0E5FB4EA39; Thu, 9 Sep 2021 08:49:39 +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 1898naHD030097 for ; Thu, 9 Sep 2021 04:49:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8E4CC19D9B; Thu, 9 Sep 2021 08:49:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3D9B19736 for ; Thu, 9 Sep 2021 08:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177391; 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=bNfzxFH8/4EYE0SV+pnUMA/gSI1HRU78jMxJoAdN7D0=; b=NES4ZkbEchXmmmQCmkWlZUcQkmBJKL9JxLdSYqkr+tj1JSZQgzwrBtnmlqWZW3nWoA5yh9 Tu3dLcgjXMwUR4SFIVAIWtD1MrYEYEHivCBxAXMpOao0EslpCYb85Fx3zgDlBG59jyhcZn YA4DPlPTjN9GA+A0Hmyf2fK0ju4uWy0= X-MC-Unique: BYakmhv1MPu2BvlX4UImrg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/24] virstoragetest: Rework TEST_LOOKUP* cases to work on fake backing chain Date: Thu, 9 Sep 2021 10:49:06 +0200 Message-Id: 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.84 on 10.5.11.23 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: 1631177393337100001 Content-Type: text/plain; charset="utf-8" Rather than using 'qemu-img' and rewriting the chain we can use fake data and few empty files to ensure the same level of coverage. This is possible since we've already tested that the metadata parsing from files works properly and the only thing we are testing here is that the symlink resolution works properly. Additionally after the refactor of 'virstoragetest' is complete additional tests on real data will be added. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 140 ++++++++++------------ tests/virstoragetestdata/lookup/qcow2 | 0 tests/virstoragetestdata/lookup/raw | 0 tests/virstoragetestdata/lookup/sub/link2 | 1 + tests/virstoragetestdata/lookup/wrap | 0 5 files changed, 63 insertions(+), 78 deletions(-) create mode 100644 tests/virstoragetestdata/lookup/qcow2 create mode 100644 tests/virstoragetestdata/lookup/raw create mode 120000 tests/virstoragetestdata/lookup/sub/link2 create mode 100644 tests/virstoragetestdata/lookup/wrap diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index a3f9c537e5..299b16e119 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -499,10 +499,11 @@ mymain(void) struct testLookupData data2; struct testPathRelativeBacking data4; struct testBackingParseData data5; - virStorageSource *chain2; /* short for chain->backingStore */ - virStorageSource *chain3; /* short for chain2->backingStore */ + virStorageSource fakeChain[4]; + virStorageSource *chain =3D &fakeChain[0]; + virStorageSource *chain2 =3D &fakeChain[1]; + virStorageSource *chain3 =3D &fakeChain[2]; g_autoptr(virCommand) cmd =3D NULL; - g_autoptr(virStorageSource) chain =3D NULL; if (storageRegisterAll() < 0) return EXIT_FAILURE; @@ -622,22 +623,29 @@ mymain(void) /* Behavior of an infinite loop chain */ TEST_CHAIN("qcow2-qcow2_infinite-mutual", abswrap, VIR_STORAGE_FILE_QC= OW2, EXP_FAIL); - /* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", absraw, "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - - /* Test behavior of chain lookups, absolute backing from relative star= t */ - chain =3D testStorageFileGetMetadata("wrap", VIR_STORAGE_FILE_QCOW2, - -1, -1); - if (!chain) { - ret =3D -1; + /* setup data for backing chain lookup testing */ + if (chdir(abs_srcdir "/virstoragetestdata/lookup") < 0) { + fprintf(stderr, "unable to test relative backing chains\n"); goto cleanup; } - chain2 =3D chain->backingStore; - chain3 =3D chain2->backingStore; + + memset(fakeChain, 0, sizeof(fakeChain)); + fakeChain[0].backingStore =3D &fakeChain[1]; + fakeChain[1].backingStore =3D &fakeChain[2]; + fakeChain[2].backingStore =3D &fakeChain[3]; + + fakeChain[0].type =3D VIR_STORAGE_TYPE_FILE; + fakeChain[1].type =3D VIR_STORAGE_TYPE_FILE; + fakeChain[2].type =3D VIR_STORAGE_TYPE_FILE; + + fakeChain[0].format =3D VIR_STORAGE_FILE_QCOW2; + fakeChain[1].format =3D VIR_STORAGE_FILE_QCOW2; + fakeChain[2].format =3D VIR_STORAGE_FILE_RAW; + + /* backing chain with relative start and absolute backing paths */ + fakeChain[0].path =3D (char *) "wrap"; + fakeChain[1].path =3D (char *) abs_srcdir "/virstoragetestdata/lookup/= qcow2"; + fakeChain[2].path =3D (char *) abs_srcdir "/virstoragetestdata/lookup/= raw"; #define TEST_LOOKUP_TARGET(id, target, from, name, index, meta, parent) \ do { \ @@ -654,111 +662,87 @@ mymain(void) TEST_LOOKUP(2, NULL, "wrap", chain, NULL); TEST_LOOKUP(3, chain, "wrap", NULL, NULL); TEST_LOOKUP(4, chain2, "wrap", NULL, NULL); - TEST_LOOKUP(5, NULL, abswrap, chain, NULL); - TEST_LOOKUP(6, chain, abswrap, NULL, NULL); - TEST_LOOKUP(7, chain2, abswrap, NULL, NULL); + TEST_LOOKUP(5, NULL, abs_srcdir "/virstoragetestdata/lookup/wrap", cha= in, NULL); + TEST_LOOKUP(6, chain, abs_srcdir "/virstoragetestdata/lookup/wrap", NU= LL, NULL); + TEST_LOOKUP(7, chain2, abs_srcdir "/virstoragetestdata/lookup/wrap", N= ULL, NULL); TEST_LOOKUP(8, NULL, "qcow2", chain2, chain); TEST_LOOKUP(9, chain, "qcow2", chain2, chain); TEST_LOOKUP(10, chain2, "qcow2", NULL, NULL); TEST_LOOKUP(11, chain3, "qcow2", NULL, NULL); - TEST_LOOKUP(12, NULL, absqcow2, chain2, chain); - TEST_LOOKUP(13, chain, absqcow2, chain2, chain); - TEST_LOOKUP(14, chain2, absqcow2, NULL, NULL); - TEST_LOOKUP(15, chain3, absqcow2, NULL, NULL); + TEST_LOOKUP(12, NULL, abs_srcdir "/virstoragetestdata/lookup/qcow2", c= hain2, chain); + TEST_LOOKUP(13, chain, abs_srcdir "/virstoragetestdata/lookup/qcow2", = chain2, chain); + TEST_LOOKUP(14, chain2, abs_srcdir "/virstoragetestdata/lookup/qcow2",= NULL, NULL); + TEST_LOOKUP(15, chain3, abs_srcdir "/virstoragetestdata/lookup/qcow2",= NULL, NULL); TEST_LOOKUP(16, NULL, "raw", chain3, chain2); TEST_LOOKUP(17, chain, "raw", chain3, chain2); TEST_LOOKUP(18, chain2, "raw", chain3, chain2); TEST_LOOKUP(19, chain3, "raw", NULL, NULL); - TEST_LOOKUP(20, NULL, absraw, chain3, chain2); - TEST_LOOKUP(21, chain, absraw, chain3, chain2); - TEST_LOOKUP(22, chain2, absraw, chain3, chain2); - TEST_LOOKUP(23, chain3, absraw, NULL, NULL); + TEST_LOOKUP(20, NULL, abs_srcdir "/virstoragetestdata/lookup/raw", cha= in3, chain2); + TEST_LOOKUP(21, chain, abs_srcdir "/virstoragetestdata/lookup/raw", ch= ain3, chain2); + TEST_LOOKUP(22, chain2, abs_srcdir "/virstoragetestdata/lookup/raw", c= hain3, chain2); + TEST_LOOKUP(23, chain3, abs_srcdir "/virstoragetestdata/lookup/raw", N= ULL, NULL); TEST_LOOKUP(24, NULL, NULL, chain3, chain2); TEST_LOOKUP(25, chain, NULL, chain3, chain2); TEST_LOOKUP(26, chain2, NULL, chain3, chain2); TEST_LOOKUP(27, chain3, NULL, NULL, NULL); - /* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "raw", "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; + /* relative backing, absolute start */ + fakeChain[0].path =3D (char *) abs_srcdir "/virstoragetestdata/lookup/= wrap"; - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", "qcow2", "wrap", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - - /* Test behavior of chain lookups, relative backing from absolute star= t */ - virObjectUnref(chain); - chain =3D testStorageFileGetMetadata(abswrap, VIR_STORAGE_FILE_QCOW2, = -1, -1); - if (!chain) { - ret =3D -1; - goto cleanup; - } - chain2 =3D chain->backingStore; - chain3 =3D chain2->backingStore; + fakeChain[1].relPath =3D (char *) "qcow2"; + fakeChain[2].relPath =3D (char *) "raw"; TEST_LOOKUP(28, NULL, "bogus", NULL, NULL); TEST_LOOKUP(29, chain, "bogus", NULL, NULL); TEST_LOOKUP(30, NULL, "wrap", chain, NULL); TEST_LOOKUP(31, chain, "wrap", NULL, NULL); TEST_LOOKUP(32, chain2, "wrap", NULL, NULL); - TEST_LOOKUP(33, NULL, abswrap, chain, NULL); - TEST_LOOKUP(34, chain, abswrap, NULL, NULL); - TEST_LOOKUP(35, chain2, abswrap, NULL, NULL); + TEST_LOOKUP(33, NULL, abs_srcdir "/virstoragetestdata/lookup/wrap", ch= ain, NULL); + TEST_LOOKUP(34, chain, abs_srcdir "/virstoragetestdata/lookup/wrap", N= ULL, NULL); + TEST_LOOKUP(35, chain2, abs_srcdir "/virstoragetestdata/lookup/wrap", = NULL, NULL); TEST_LOOKUP(36, NULL, "qcow2", chain2, chain); TEST_LOOKUP(37, chain, "qcow2", chain2, chain); TEST_LOOKUP(38, chain2, "qcow2", NULL, NULL); TEST_LOOKUP(39, chain3, "qcow2", NULL, NULL); - TEST_LOOKUP(40, NULL, absqcow2, chain2, chain); - TEST_LOOKUP(41, chain, absqcow2, chain2, chain); - TEST_LOOKUP(42, chain2, absqcow2, NULL, NULL); - TEST_LOOKUP(43, chain3, absqcow2, NULL, NULL); + TEST_LOOKUP(40, NULL, abs_srcdir "/virstoragetestdata/lookup/qcow2", c= hain2, chain); + TEST_LOOKUP(41, chain, abs_srcdir "/virstoragetestdata/lookup/qcow2", = chain2, chain); + TEST_LOOKUP(42, chain2, abs_srcdir "/virstoragetestdata/lookup/qcow2",= NULL, NULL); + TEST_LOOKUP(43, chain3, abs_srcdir "/virstoragetestdata/lookup/qcow2",= NULL, NULL); TEST_LOOKUP(44, NULL, "raw", chain3, chain2); TEST_LOOKUP(45, chain, "raw", chain3, chain2); TEST_LOOKUP(46, chain2, "raw", chain3, chain2); TEST_LOOKUP(47, chain3, "raw", NULL, NULL); - TEST_LOOKUP(48, NULL, absraw, chain3, chain2); - TEST_LOOKUP(49, chain, absraw, chain3, chain2); - TEST_LOOKUP(50, chain2, absraw, chain3, chain2); - TEST_LOOKUP(51, chain3, absraw, NULL, NULL); + TEST_LOOKUP(48, NULL, abs_srcdir "/virstoragetestdata/lookup/raw", cha= in3, chain2); + TEST_LOOKUP(49, chain, abs_srcdir "/virstoragetestdata/lookup/raw", ch= ain3, chain2); + TEST_LOOKUP(50, chain2, abs_srcdir "/virstoragetestdata/lookup/raw", c= hain3, chain2); + TEST_LOOKUP(51, chain3, abs_srcdir "/virstoragetestdata/lookup/raw", N= ULL, NULL); TEST_LOOKUP(52, NULL, NULL, chain3, chain2); TEST_LOOKUP(53, chain, NULL, chain3, chain2); TEST_LOOKUP(54, chain2, NULL, chain3, chain2); TEST_LOOKUP(55, chain3, NULL, NULL, NULL); /* Use link to wrap with cross-directory relative backing */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", "../qcow2", "wrap", NU= LL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; + fakeChain[0].path =3D (char *) abs_srcdir "/virstoragetestdata/lookup/= sub/link2"; - /* Test behavior of chain lookups, relative backing */ - virObjectUnref(chain); - chain =3D testStorageFileGetMetadata("sub/link2", VIR_STORAGE_FILE_QCO= W2, - -1, -1); - if (!chain) { - ret =3D -1; - goto cleanup; - } - chain2 =3D chain->backingStore; - chain3 =3D chain2->backingStore; + fakeChain[1].relPath =3D (char *) "../qcow2"; + fakeChain[2].relPath =3D (char *) "raw"; TEST_LOOKUP(56, NULL, "bogus", NULL, NULL); TEST_LOOKUP(57, NULL, "sub/link2", chain, NULL); TEST_LOOKUP(58, NULL, "wrap", chain, NULL); - TEST_LOOKUP(59, NULL, abswrap, chain, NULL); + TEST_LOOKUP(59, NULL, abs_srcdir "/virstoragetestdata/lookup/wrap", ch= ain, NULL); TEST_LOOKUP(60, NULL, "../qcow2", chain2, chain); TEST_LOOKUP(61, NULL, "qcow2", NULL, NULL); - TEST_LOOKUP(62, NULL, absqcow2, chain2, chain); + TEST_LOOKUP(62, NULL, abs_srcdir "/virstoragetestdata/lookup/qcow2", c= hain2, chain); TEST_LOOKUP(63, NULL, "raw", chain3, chain2); - TEST_LOOKUP(64, NULL, absraw, chain3, chain2); + TEST_LOOKUP(64, NULL, abs_srcdir "/virstoragetestdata/lookup/raw", cha= in3, chain2); TEST_LOOKUP(65, NULL, NULL, chain3, chain2); + /* index lookup */ + fakeChain[0].id =3D 0; + fakeChain[1].id =3D 1; + fakeChain[2].id =3D 2; + TEST_LOOKUP_TARGET(66, "vda", NULL, "bogus[1]", 0, NULL, NULL); TEST_LOOKUP_TARGET(67, "vda", NULL, "vda[-1]", 0, NULL, NULL); TEST_LOOKUP_TARGET(68, "vda", NULL, "vda[1][1]", 0, NULL, NULL); diff --git a/tests/virstoragetestdata/lookup/qcow2 b/tests/virstoragetestda= ta/lookup/qcow2 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/virstoragetestdata/lookup/raw b/tests/virstoragetestdata= /lookup/raw new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/virstoragetestdata/lookup/sub/link2 b/tests/virstoragete= stdata/lookup/sub/link2 new file mode 120000 index 0000000000..5efbc33afa --- /dev/null +++ b/tests/virstoragetestdata/lookup/sub/link2 @@ -0,0 +1 @@ +../wrap \ No newline at end of file diff --git a/tests/virstoragetestdata/lookup/wrap b/tests/virstoragetestdat= a/lookup/wrap new file mode 100644 index 0000000000..e69de29bb2 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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 Reviewed-by: J=C3=A1n Tomko --- 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^htDWJUrB4uOQk!o(cfAR@I%NK-+WI11ips(gfNONUg=3D@%4q{u5A-t^mWtXg?b=3DCUm>)m(Bufbl-G@I;OfAkvT z{rhqKa2A8R(ff6r{yBt6*>-()Q+Auu;V~K4ZM$f?|9+7ck6qDL`81p4U7p>R(_(Oe z(YT&9Z84vhb(M8}Gh7|Q-g5qGQcSYTv#hAPwk+lY3nXEhKlNE#+>Yx-)eV)dW=3DTVo zndQx&h3hrbq|G0)AA277n{8@Z*Ujw;r2@wGT1PBlyK!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*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009EK zA&~CIHtmuC0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+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-N0t5yGlJIp8lt>XEK!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&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 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=YaHv3r94xEx0GKvFrHzbdk6yqbpnWb/3F8t/tOAS4jMhb9/dfnykwRSopMA4fmwSn16viZBJPG0Cjmmc39EQMLCn3fvprR//LlQTmNStddqq7T5E263mUS8jPnf612TjykbcW4aTi2b0UlUQxqZSCtvxnGC8foVrVPRqnZZzJo0= 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=/jNkhhUnz5doc2n3v76wIXO8sZI2U9d6La/b74npt3w=; b=aTOIeXj4cUHoRIB1utpeKUK9XDUKP3PLuYBPWigZMxbs9YgLjfkj3V5tHjs5bqKa/iw2xMrYZI7zktirVFxeL4q0lwYXu0QxBhYIoKpbtesFqxYs2O/H6JwIP43s8XtgM0l5yf/xcOLdrcnj2z+EXRaOaaT2y9AgcuVn4tlJj44= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177389853850.4252015414629; 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-449-fEONMS48PwyWltAMAdAEtA-1; Thu, 09 Sep 2021 04:49:47 -0400 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 3D57B101AFBD; Thu, 9 Sep 2021 08:49:41 +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 18BFD60C82; Thu, 9 Sep 2021 08:49:41 +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 DC02C4EA3C; Thu, 9 Sep 2021 08:49:40 +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 1898neq0030125 for ; Thu, 9 Sep 2021 04:49:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1FD2F19D9B; Thu, 9 Sep 2021 08:49:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70E1226DEC for ; Thu, 9 Sep 2021 08:49:37 +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=/jNkhhUnz5doc2n3v76wIXO8sZI2U9d6La/b74npt3w=; b=M968VmwcxkxwdceEVxWVEXAO+0cqIFQvGatxvZoqhvVi8goemNoKQUxdIe684knOU3elSv ZH0aGRtPJeOllXmgKQ5gDSX4yehoNqAcZEoPiYYmdSZDS4vgJzVmcEYGEAuy5l4NgX8VcZ vmoHvVwsgOzsn0eBOBlXpBd9+VOivxs= X-MC-Unique: fEONMS48PwyWltAMAdAEtA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/24] virstoragetest: Use existing directory in the source tree for 'directory' probing tests Date: Thu, 9 Sep 2021 10:49:08 +0200 Message-Id: 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.12 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: 1631177391128100005 Content-Type: text/plain; charset="utf-8" We don't need a special directory for the tests. Reuse the directory holding the data for the virstoragetest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 13 +++---------- tests/virstoragetestdata/out/directory-dir | 2 +- tests/virstoragetestdata/out/directory-none | 2 +- tests/virstoragetestdata/out/directory-raw | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 785699d4e8..3736280611 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -56,7 +56,6 @@ static char *absraw; static char *absqcow2; static char *abswrap; static char *absqed; -static char *absdir; static char *abslink2; static void @@ -67,7 +66,6 @@ testCleanupImages(void) VIR_FREE(absqcow2); VIR_FREE(abswrap); VIR_FREE(absqed); - VIR_FREE(absdir); VIR_FREE(abslink2); if (chdir(abs_builddir) < 0) { @@ -139,17 +137,12 @@ testPrepImages(void) absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); abswrap =3D g_strdup_printf("%s/wrap", datadir); absqed =3D g_strdup_printf("%s/qed", datadir); - absdir =3D g_strdup_printf("%s/dir", datadir); abslink2 =3D g_strdup_printf("%s/sub/link2", datadir); if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) { fprintf(stderr, "unable to create directory %s\n", datadir "/sub"); goto cleanup; } - if (g_mkdir_with_parents(datadir "/dir", 0777) < 0) { - fprintf(stderr, "unable to create directory %s\n", datadir "/dir"); - goto cleanup; - } if (chdir(datadir) < 0) { fprintf(stderr, "unable to test relative backing chains\n"); @@ -573,9 +566,9 @@ mymain(void) TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS); /* directory */ - TEST_CHAIN("directory-raw", absdir, VIR_STORAGE_FILE_RAW, EXP_PASS); - TEST_CHAIN("directory-none", absdir, VIR_STORAGE_FILE_NONE, EXP_PASS); - TEST_CHAIN("directory-dir", absdir, VIR_STORAGE_FILE_DIR, EXP_PASS); + TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", = VIR_STORAGE_FILE_RAW, EXP_PASS); + TEST_CHAIN("directory-none", abs_srcdir "/virstoragetestdata/images/",= VIR_STORAGE_FILE_NONE, EXP_PASS); + TEST_CHAIN("directory-dir", abs_srcdir "/virstoragetestdata/images/", = VIR_STORAGE_FILE_DIR, EXP_PASS); #ifdef WITH_SYMLINK /* Rewrite qcow2 and wrap file to use backing names relative to a diff --git a/tests/virstoragetestdata/out/directory-dir b/tests/virstoraget= estdata/out/directory-dir index cff67595b4..65b7b91912 100644 --- a/tests/virstoragetestdata/out/directory-dir +++ b/tests/virstoragetestdata/out/directory-dir @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/dir +path:ABS_SRCDIR/virstoragetestdata/images/ backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/directory-none b/tests/virstorage= testdata/out/directory-none index cff67595b4..65b7b91912 100644 --- a/tests/virstoragetestdata/out/directory-none +++ b/tests/virstoragetestdata/out/directory-none @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/dir +path:ABS_SRCDIR/virstoragetestdata/images/ backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/directory-raw b/tests/virstoraget= estdata/out/directory-raw index ebe23cbbd6..5def2c4b8b 100644 --- a/tests/virstoragetestdata/out/directory-raw +++ b/tests/virstoragetestdata/out/directory-raw @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/dir +path:ABS_SRCDIR/virstoragetestdata/images/ backingStoreRaw: capacity: 0 encryption: 0 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177393; cv=none; d=zohomail.com; s=zohoarc; b=eRMM6BuAONxuiDwuo/r3HgXMZSjC/qSZNPgyXiwbuoVxNvMPmVZfleQzIUmbvlDBlSatGk8l1hdBGxDGlCsOphrDNtQ/tq1fABkO7ONNbxzD3fehtGguPO1KomXM5cZD7cxkKyt2Wuzp3JPSXmPN+fNsuSTOb1YLUrfXTlD//NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177393; 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=JWbXm/HLS+IJir8jHHGEeqRPm0didCsXyGBpYV3WFFg=; b=i0rkdBm3/vN4nVZTdcwEF9c2+T2DXzfu47VntwS8K5uGet7nNYTSa/C1gxPX3s4zdjzF3Nd6wOcKHwx9ZBG1upjn6Tv/2KHZezmiA0N2o2r6E4IWs61hLzzjRU99TNUAgPXGjKgTZ3bYgqjg7M4OlhqHbwFjsCMZ2LeTPqA6YOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177393247880.911250241723; Thu, 9 Sep 2021 01:49:53 -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-109-vDC_xLz5N9eiBOBAIfhIEA-1; Thu, 09 Sep 2021 04:49:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9CB8101AFC0; Thu, 9 Sep 2021 08:49:45 +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 CD3735FC13; Thu, 9 Sep 2021 08:49:45 +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 9E4584EA40; Thu, 9 Sep 2021 08:49:45 +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 1898nicj030148 for ; Thu, 9 Sep 2021 04:49:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 447A21A7E9; Thu, 9 Sep 2021 08:49:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id A741419736 for ; Thu, 9 Sep 2021 08:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177392; 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=JWbXm/HLS+IJir8jHHGEeqRPm0didCsXyGBpYV3WFFg=; b=DP8KQIWkPthIcuaJFgvxHEuQHbue/z6ThaB1JLPOqXfHm+CHlCZh2dHkOdwxfI0SiJG/o7 fUbKMPu7wJPnnVD5TSixA0VNobIG44ZZJbcl7hzqKQCRoNfiyiXgZCXI2o1XjmzJFPSlV6 +14FimqMT5SK4+oNYrnQv3e5USDRRN8= X-MC-Unique: vDC_xLz5N9eiBOBAIfhIEA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/24] virstoragetest: Use a pre-formatted QED file for testing backing store extraction Date: Thu, 9 Sep 2021 10:49:09 +0200 Message-Id: <7c06e54d4f97c4dffbbf3baccb171f7367467a5b.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.16 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: 1631177395318100003 Content-Type: text/plain; charset="utf-8" The QED format isn't really being developed any more. Use a pre-formatted image to test the existing code. In this instance we switch to using a relative backing path for simplicity. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 21 +++++------------- .../images/qed_raw-raw-relative | Bin 0 -> 327680 bytes tests/virstoragetestdata/images/raw | Bin 0 -> 1024 bytes tests/virstoragetestdata/out/qed-auto_raw | 2 +- tests/virstoragetestdata/out/qed-qed_raw | 8 +++---- 5 files changed, 11 insertions(+), 20 deletions(-) create mode 100644 tests/virstoragetestdata/images/qed_raw-raw-relative create mode 100644 tests/virstoragetestdata/images/raw diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 3736280611..96aeaef9ce 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -42,7 +42,6 @@ VIR_LOG_INIT("tests.storagetest"); * raw: 1024-byte raw file * qcow2: qcow2 file with 'raw' as backing * wrap: qcow2 file with 'qcow2' as backing - * qed: qed file with 'raw' as backing * sub/link1: symlink to qcow2 * sub/link2: symlink to wrap * @@ -55,7 +54,6 @@ static char *qemuimg; static char *absraw; static char *absqcow2; static char *abswrap; -static char *absqed; static char *abslink2; static void @@ -65,7 +63,6 @@ testCleanupImages(void) VIR_FREE(absraw); VIR_FREE(absqcow2); VIR_FREE(abswrap); - VIR_FREE(absqed); VIR_FREE(abslink2); if (chdir(abs_builddir) < 0) { @@ -136,7 +133,6 @@ testPrepImages(void) absraw =3D g_strdup_printf("%s/raw", datadir); absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); abswrap =3D g_strdup_printf("%s/wrap", datadir); - absqed =3D g_strdup_printf("%s/qed", datadir); abslink2 =3D g_strdup_printf("%s/sub/link2", datadir); if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) { @@ -181,15 +177,6 @@ testPrepImages(void) if (virCommandRun(cmd, NULL) < 0) goto skip; - /* Create a qed file. */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "create", "-f", "qed", NULL); - virCommandAddArgFormat(cmd, "-obacking_file=3D%s,backing_fmt=3Draw", - absraw); - virCommandAddArg(cmd, "qed"); - if (virCommandRun(cmd, NULL) < 0) - goto skip; - #ifdef WITH_SYMLINK /* Create some symlinks in a sub-directory. */ if (symlink("../qcow2", datadir "/sub/link1") < 0 || @@ -562,8 +549,12 @@ mymain(void) TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_PASS); /* qed file */ - TEST_CHAIN("qed-qed_raw", absqed, VIR_STORAGE_FILE_QED, EXP_PASS); - TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS); + TEST_CHAIN("qed-qed_raw", + abs_srcdir "/virstoragetestdata/images/qed_raw-raw-relative= ", + VIR_STORAGE_FILE_QED, EXP_PASS); + TEST_CHAIN("qed-auto_raw", + abs_srcdir "/virstoragetestdata/images/qed_raw-raw-relative= ", + VIR_STORAGE_FILE_AUTO, EXP_PASS); /* directory */ TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", = VIR_STORAGE_FILE_RAW, EXP_PASS); diff --git a/tests/virstoragetestdata/images/qed_raw-raw-relative b/tests/v= irstoragetestdata/images/qed_raw-raw-relative new file mode 100644 index 0000000000000000000000000000000000000000..5c91c3fcfe3dc4f25455bafada2= 7b9c95c28c6e7 GIT binary patch literal 327680 zcmeIuu?>JQ3cvEfb)7>21k!b^Ep^X_=3Dpy^xEHP@A-bLEY+zx zjvg&cmMzZ literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/raw b/tests/virstoragetestdata= /images/raw new file mode 100644 index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4= af10487da3d20 GIT binary patch literal 1024 ScmZQz7zLvtFd70QH3R?z00031 literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/out/qed-auto_raw b/tests/virstoragete= stdata/out/qed-auto_raw index e8ab498038..292a8fa7fb 100644 --- a/tests/virstoragetestdata/out/qed-auto_raw +++ b/tests/virstoragetestdata/out/qed-auto_raw @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/qed +path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/qed-qed_raw b/tests/virstoragetes= tdata/out/qed-qed_raw index 70a75c4e37..043ec4240b 100644 --- a/tests/virstoragetestdata/out/qed-qed_raw +++ b/tests/virstoragetestdata/out/qed-qed_raw @@ -1,5 +1,5 @@ -path:ABS_BUILDDIR/virstoragedata/qed -backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw +path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative +backingStoreRaw: raw capacity: 1024 encryption: 0 relPath: @@ -8,11 +8,11 @@ format:15 protocol:none hostname: -path:ABS_BUILDDIR/virstoragedata/raw +path:ABS_SRCDIR/virstoragetestdata/images/raw backingStoreRaw: capacity: 0 encryption: 0 -relPath: +relPath:raw type:1 format:1 protocol:none --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177406; cv=none; d=zohomail.com; s=zohoarc; b=fp2Ot2DYUxDqXINYla6Mo1yrqJm9hE3zagPcvv/pzuvBh2kqtXKFyMru0fCFshWKEr8YE1Tt+dkiOLVHCYFecvlRkQdKGd8cYvxracz1C4lfVOymiV2TMDqbDxNJH4hYzjq5BvwHx6HaTWyx0BnrescmGv+YbfihLtNgvCN62Qw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177406; 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=02z8m6DAU3RLVoqk3bD3663uI8Ha/2Mh6eoRrCqrXEc=; b=YlkRoUG0rwEOkJZXtLVgqrnnMmr17BQj9y0lExQD7Mze+rGrM1EhyEbIE79EZmbK7RFN+UGwd/zGUOJ9DYeZsAHUQoZPpaUVNmOiVfhFQYadMofONazwl2sfq8lPfQ8lu8LgTTgeB+azO5QrNhs8RMnedtM7wUyjfu54Mt3nVy4= 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 1631177406799445.3261563631603; Thu, 9 Sep 2021 01:50:06 -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-157-QgdC0J6dPVaHAMYzU5V96Q-1; Thu, 09 Sep 2021 04:49:58 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25FE41006AA7; Thu, 9 Sep 2021 08:49:53 +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 0A4A26F7EF; Thu, 9 Sep 2021 08:49:53 +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 C67FA4EA43; Thu, 9 Sep 2021 08:49:52 +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 1898nqbD030218 for ; Thu, 9 Sep 2021 04:49:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0414219736; Thu, 9 Sep 2021 08:49:52 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D8B319D9B for ; Thu, 9 Sep 2021 08:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177405; 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=02z8m6DAU3RLVoqk3bD3663uI8Ha/2Mh6eoRrCqrXEc=; b=Cwc4DvzfBFKr1WS320fXoBwUeEB5Sfm2KuhAuCv3t56MhNAdrnd2z0PktUk1t4k4ZAZepA cfDzh12n/Ck9T96fzVNI+JE7zvP+TLnUQWwgrbMNJqbckuTmoCMTcSsNJ/HYNEG0Kz+vcp Im46mrkpHhsRh+Ta2WH7uVJu/45AJvk= X-MC-Unique: QgdC0J6dPVaHAMYzU5V96Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/24] virstoragetest: Use pre-formatted file for non-path extraction test Date: Thu, 9 Sep 2021 10:49:10 +0200 Message-Id: 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.11 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: 1631177408572100001 Content-Type: text/plain; charset="utf-8" This one doesn't require using qemu-img either. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 13 +++---------- .../images/qcow2_nbd-raw.qcow2 | Bin 0 -> 196616 bytes .../virstoragetestdata/out/qcow2-qcow2_nbd-raw | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 96aeaef9ce..8d3dde265f 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -536,17 +536,10 @@ mymain(void) /* Qcow2 file with missing backing file but specified type */ TEST_CHAIN("qcow2-qcow2_missing", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_FAIL); - - /* Rewrite qcow2 to use an nbd: protocol as backend */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "nbd+tcp://example.org:6= 000/blah", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - /* Qcow2 file with backing protocol instead of file */ - TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_PASS); + TEST_CHAIN("qcow2-qcow2_nbd-raw", + abs_srcdir "/virstoragetestdata/images/qcow2_nbd-raw.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); /* qed file */ TEST_CHAIN("qed-qed_raw", diff --git a/tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2 b/tests/vi= rstoragetestdata/images/qcow2_nbd-raw.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..848da7ac9da8e115c7e2fbd334a= 25c1d7e6bfa28 GIT binary patch literal 196616 zcmeIuJ&x2c6aZi+!vVMfsX<~!6cl>^BqSOt>deH;M#?0SCo6WSI3LI06i769{Zr25No>TdD#Q!f84gr-f?zFN1_C3QX)n<1t9ar)mKWqg=3Do>g%p*>Zz`7+b+%? zu-FXSF~!}k9r|k8kMr4?>QKLLVpDy1Q^kHtZQRWqP=3Dv1jy022a-3<5rG?#j;Qid$E zt;c^Rp3f|cEL{C@=3Db68GT-J*3Y!Z&$0;a^2N;kBLSE2oNAZ 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&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXFT&F;Jo!4?J0t5&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*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBm#flOG7e&9Zo literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw b/tests/virst= oragetestdata/out/qcow2-qcow2_nbd-raw index 64acdb880a..08a93b9f32 100644 --- a/tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw +++ b/tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/qcow2 +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_nbd-raw.qcow2 backingStoreRaw: nbd+tcp://example.org:6000/blah capacity: 1024 encryption: 0 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177529; cv=none; d=zohomail.com; s=zohoarc; b=D33/kJ3FQ2sWZAtm6bSZgkPtzQBpbwA+HIotRGtX0dAtfZcT846gNVY4nzf+RSXp/g6E4NGpL/kDGZYBknwlkAbb/aaQ1ACCucMR8gl6vUOakBc8myPCWJrqfU4xy1IwAOYCZfgomAHv/IQVPjmwKGCT7LiQoQ6o+4sHaeemAL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177529; 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=r8EnLPyvLgGYaekQRDq2U31g8pU5dm7iIyAy730xbYY=; b=eTjkcmMolI8U7uDJlTpRikJPsgXVqN/hoBpwUKsAfTMSDWSSttdfSL90ZJd+XrRNcO6aLBjWDTzk6a41uRLdflavut4T95lmHt9M8diOasQbotxcOyzu2rlncgt2xz285chLNocqoJVxh4chgfgtuGIjKcYxHmSVuKVsZWiQ9K0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177529623736.3557854671367; Thu, 9 Sep 2021 01:52:09 -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-259-w7TX6jWRNfGADZpXOjUAIQ-1; Thu, 09 Sep 2021 04:50:01 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CE1D1835AC9; Thu, 9 Sep 2021 08:49:56 +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 67BD219736; Thu, 9 Sep 2021 08:49:56 +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 37BCA1832DD5; Thu, 9 Sep 2021 08:49:56 +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 1898ntjO030277 for ; Thu, 9 Sep 2021 04:49:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A14E19D9B; Thu, 9 Sep 2021 08:49:55 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDADA19736 for ; Thu, 9 Sep 2021 08:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177528; 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=r8EnLPyvLgGYaekQRDq2U31g8pU5dm7iIyAy730xbYY=; b=fPpgc9rYRQUrIocU/WKtPzp5Y8sxIWxP2Ewwqz+L8bmdZ0RWbhV+Gt0yU7Lsxq/hHH41fc T/cjE8yhGthcr+Wa63e7DxHSfAXh6sIcx4h6UPnJ8Qghtbh6NWZpuxF8zdBoR34L50Fqpl at39mUQHixwXGsOx+EvN3XwwS7drCDU= X-MC-Unique: w7TX6jWRNfGADZpXOjUAIQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/24] virstoragetest: Use preformatted file for testing missing backing store Date: Thu, 9 Sep 2021 10:49:11 +0200 Message-Id: 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.84 on 10.5.11.23 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: 1631177531955100001 Content-Type: text/plain; charset="utf-8" Similarly to previous ones, this one doesn't need to be created by qemu-img in order for the test to make sense. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 12 +++--------- .../images/qcow2_qcow2-missing.qcow2 | Bin 0 -> 196616 bytes 2 files changed, 3 insertions(+), 9 deletions(-) create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-missing.qco= w2 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 8d3dde265f..34aff3e6dd 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -525,16 +525,10 @@ mymain(void) /* qcow2 with a longer backing chain */ TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FIL= E_QCOW2, EXP_PASS); - /* Rewrite qcow2 to a missing backing file, with backing type */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", datadir "/bogus", - "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - /* Qcow2 file with missing backing file but specified type */ - TEST_CHAIN("qcow2-qcow2_missing", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_FAIL); + TEST_CHAIN("qcow2-qcow2_missing", + abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-missing.= qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_FAIL); /* Qcow2 file with backing protocol instead of file */ TEST_CHAIN("qcow2-qcow2_nbd-raw", diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-missing.qcow2 b/te= sts/virstoragetestdata/images/qcow2_qcow2-missing.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..cb9afb25dcd0b489fe848160255= d9e5b427ddf0f GIT binary patch literal 196616 zcmeIuOHPA87y#gb>fR%;cIhEZOx(C~O(`l#1*9~!t~{T|@DwI)oW9by5SuQW4>HWa z{14{4yT17jA&laPS9%d2=3DW(p&c%5yg5R&y`8?}AgeA`9*J+F$iyY0{AzCQM>UW{Tb5b;2H*fnxGt%<4FS|OQW|O?nvxjP04mKDS&2!t8 zvsu;DS-)(Dqa)R-emyBC+3i(U)_qr%vw;RlnC5TGtScXiW?uJ0q3bGXh%(Q4`)}a3 zXPR{RBKvjbfxp>rjhn~$p*{9lRs;wTAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+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*pk1PGjrKzcGKaS#Fo 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 z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5I9yK37h-ae0c;25FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+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 IAaGIwKRetu*Z=3D?k literal 0 HcmV?d00001 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177409; cv=none; d=zohomail.com; s=zohoarc; b=XJY2w4VnT7Wm00OharC3W2uuNooz3AhHtum28EjMiWGewP5nyKV2a2RTY59tfeUPNOJjARu0/y09crgX0eCefATabFLgngh0Ty7QjnVF1y6Rc13yFswQ6q4uhUezcgzilK4i3DKwVMJ3ak3VnawnKx1WPk22eYv+5s7BVomOzp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177409; 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=ybc2A9Gu7wx/5e4RreVX8vjHZ4gp0PNMJe/JdPZfBQI=; b=b+bJt/jyRwUYZTZvy/ul6Y3Gk1tCKe//antDZww9khflyhTLLkRMa5DugjVJupIM+HW04+VfRSLCcPifyTS/aOfmsyusTEp9g7mzEtvljJ0jRgEbrxpRl9BbXjuPpBWcHSzpSl4+5B3qC1ZgUtIUXTdhGunrDg4+XXSOwe1Pogg= 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 1631177409578697.0918612479904; Thu, 9 Sep 2021 01:50:09 -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-488-6WYYwAQyOC2j30gsispi4g-1; Thu, 09 Sep 2021 04:50:06 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 10907101AFB4; Thu, 9 Sep 2021 08:50:01 +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 E794A1B5C1; Thu, 9 Sep 2021 08:50:00 +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 B17AE180598A; Thu, 9 Sep 2021 08:50:00 +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 1898nxO4030304 for ; Thu, 9 Sep 2021 04:49:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8137D19D9B; Thu, 9 Sep 2021 08:49:59 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCEB419736 for ; Thu, 9 Sep 2021 08:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177408; 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=ybc2A9Gu7wx/5e4RreVX8vjHZ4gp0PNMJe/JdPZfBQI=; b=RcnF9iMawdV8i4cBmjS30oUS3xjXPvy2t9x0mxmkQzjVYg8v71HcozncoPbrolKrhy+GDl Jl3bniUpPGEra4gcCmKoR8c5GMWaT0K1kXePlIH6GkmQEQs96JiuvLkBj6DnBu96YrFluI 4rACTFxgjcib/Gujc1l+ScOHn4uQDyE= X-MC-Unique: 6WYYwAQyOC2j30gsispi4g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/24] virstoragetest: Use existing file for testing 'raw' image lookup Date: Thu, 9 Sep 2021 10:49:12 +0200 Message-Id: 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.13 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: 1631177410922100001 Content-Type: text/plain; charset="utf-8" We've already added a 'raw' file to the example image directory so we can use that instead of formatting one. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 8 ++++++-- tests/virstoragetestdata/out/raw-auto | 2 +- tests/virstoragetestdata/out/raw-raw | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 34aff3e6dd..dcb5a8a427 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -504,8 +504,12 @@ mymain(void) TEST_CHAIN("missing", "bogus", VIR_STORAGE_FILE_RAW, EXP_FAIL); /* Raw image, whether with right format or no specified format */ - TEST_CHAIN("raw-raw", absraw, VIR_STORAGE_FILE_RAW, EXP_PASS); - TEST_CHAIN("raw-auto", absraw, VIR_STORAGE_FILE_AUTO, EXP_PASS); + TEST_CHAIN("raw-raw", + abs_srcdir "/virstoragetestdata/images/raw", + VIR_STORAGE_FILE_RAW, EXP_PASS); + TEST_CHAIN("raw-auto", + abs_srcdir "/virstoragetestdata/images/raw", + VIR_STORAGE_FILE_AUTO, EXP_PASS); /* Qcow2 file with relative raw backing, format provided */ TEST_CHAIN("qcow2-qcow2_raw-raw-relative", absqcow2, VIR_STORAGE_FILE_= QCOW2, EXP_PASS); diff --git a/tests/virstoragetestdata/out/raw-auto b/tests/virstoragetestda= ta/out/raw-auto index 8d6c525896..d98b6e8bf5 100644 --- a/tests/virstoragetestdata/out/raw-auto +++ b/tests/virstoragetestdata/out/raw-auto @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/raw +path:ABS_SRCDIR/virstoragetestdata/images/raw backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/raw-raw b/tests/virstoragetestdat= a/out/raw-raw index 8d6c525896..d98b6e8bf5 100644 --- a/tests/virstoragetestdata/out/raw-raw +++ b/tests/virstoragetestdata/out/raw-raw @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/raw +path:ABS_SRCDIR/virstoragetestdata/images/raw backingStoreRaw: capacity: 0 encryption: 0 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177430; cv=none; d=zohomail.com; s=zohoarc; b=PA1bKBFUs+A4+U01IgAJpRdZeY3FEbJpQW3ixzodlhHc974qAzPcbm3sSXSzwdXv9EUjEHAenuMdLcyi2tOT5/nTUpQA9kgX277kOEx+3ohBC7ULqfX6xLCPNSe+JVNIaG/5dDArSfnRBv+HAUvsZHawLThBflzsavUJdPEQt4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177430; 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=Q7JDSCu5kLx2i/EzbguQYmWrpQB2sS/nOhmBlzBhnAA=; b=ePJN9/ELA72qocVtML/TzFu78iBiB5tpiX2GsvF0rmY2KcVpWR89wJM2y6/J6BiDRrd4q5rL16Ftqvccn4d/O/rT1kNAmHLHlyZ7BTEpqVBKV2LA4PG2l0+ZyHR+JA30YpZsb3+nr7dMTYr6eRc4WaJKXY2o6B/ObzVd01Q89sI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177430227528.5543228338394; Thu, 9 Sep 2021 01:50:30 -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-449-sABZ7qZhNSGgEQM_HebTkQ-1; Thu, 09 Sep 2021 04:50:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBF151006AA2; Thu, 9 Sep 2021 08:50:22 +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 CD8615C1D0; Thu, 9 Sep 2021 08:50:22 +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 9FE471806D03; Thu, 9 Sep 2021 08:50:22 +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 1898oKMD030681 for ; Thu, 9 Sep 2021 04:50:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA3C326E4B; Thu, 9 Sep 2021 08:50:20 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C7EE26E49 for ; Thu, 9 Sep 2021 08:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177429; 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=Q7JDSCu5kLx2i/EzbguQYmWrpQB2sS/nOhmBlzBhnAA=; b=LxE62a0ltT12UqkNQF7X+/PB+Q8IERsnPSZkOd8F0gKMQOXLoMak2HupahInENFQM9MxAG NP3CEhueZyzctkTsI/2+b/WsKbuHg7WFX6lWE/U/4uYNdKFaK240gUb31Il4gtm7+6l4Ui vL3dmZsEpq0rU+qmCtzf++JjbaFrERM= X-MC-Unique: sABZ7qZhNSGgEQM_HebTkQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/24] virstoragetest: Convert symlink and relative image testing use preformatted images Date: Thu, 9 Sep 2021 10:49:13 +0200 Message-Id: <5f83478c2c589f81845f9a7f227a6263cd717540.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.16 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: 1631177432452100001 Content-Type: text/plain; charset="utf-8" Use prepared test images instead to simplify and clarify the code instead of rewriting existing images multiple times. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 39 +++--------------- ...2_qcow2-qcow2-symlink_raw-raw-reldir.qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_raw-raw-reldir.qcow2 | Bin 0 -> 196616 bytes tests/virstoragetestdata/images/sub/link1 | 1 + tests/virstoragetestdata/images/sub/link2 | 1 + tests/virstoragetestdata/out/qcow2-symlinks | 6 +-- 6 files changed, 10 insertions(+), 37 deletions(-) create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-qcow2-symli= nk_raw-raw-reldir.qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_raw-raw-reldir.qc= ow2 create mode 120000 tests/virstoragetestdata/images/sub/link1 create mode 120000 tests/virstoragetestdata/images/sub/link2 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index dcb5a8a427..15296cc14f 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -42,8 +42,6 @@ VIR_LOG_INIT("tests.storagetest"); * raw: 1024-byte raw file * qcow2: qcow2 file with 'raw' as backing * wrap: qcow2 file with 'qcow2' as backing - * sub/link1: symlink to qcow2 - * sub/link2: symlink to wrap * * Relative names to these files are known at compile time, but absolute * names depend on where the test is run; for convenience, @@ -54,7 +52,6 @@ static char *qemuimg; static char *absraw; static char *absqcow2; static char *abswrap; -static char *abslink2; static void testCleanupImages(void) @@ -63,7 +60,6 @@ testCleanupImages(void) VIR_FREE(absraw); VIR_FREE(absqcow2); VIR_FREE(abswrap); - VIR_FREE(abslink2); if (chdir(abs_builddir) < 0) { fprintf(stderr, "unable to return to correct directory, refusing t= o " @@ -133,10 +129,9 @@ testPrepImages(void) absraw =3D g_strdup_printf("%s/raw", datadir); absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); abswrap =3D g_strdup_printf("%s/wrap", datadir); - abslink2 =3D g_strdup_printf("%s/sub/link2", datadir); - if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) { - fprintf(stderr, "unable to create directory %s\n", datadir "/sub"); + if (g_mkdir_with_parents(datadir, 0777) < 0) { + fprintf(stderr, "unable to create directory %s\n", datadir); goto cleanup; } @@ -177,15 +172,6 @@ testPrepImages(void) if (virCommandRun(cmd, NULL) < 0) goto skip; -#ifdef WITH_SYMLINK - /* Create some symlinks in a sub-directory. */ - if (symlink("../qcow2", datadir "/sub/link1") < 0 || - symlink("../wrap", datadir "/sub/link2") < 0) { - fprintf(stderr, "unable to create symlink"); - goto cleanup; - } -#endif - ret =3D 0; cleanup: if (ret) @@ -552,25 +538,10 @@ mymain(void) TEST_CHAIN("directory-none", abs_srcdir "/virstoragetestdata/images/",= VIR_STORAGE_FILE_NONE, EXP_PASS); TEST_CHAIN("directory-dir", abs_srcdir "/virstoragetestdata/images/", = VIR_STORAGE_FILE_DIR, EXP_PASS); -#ifdef WITH_SYMLINK - /* Rewrite qcow2 and wrap file to use backing names relative to a - * symlink from a different directory */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "../raw", "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "qcow2", "-b", "../sub/link1", "wrap", - NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - /* Behavior of symlinks to qcow2 with relative backing files */ - TEST_CHAIN("qcow2-symlinks", abslink2, VIR_STORAGE_FILE_QCOW2, EXP_PAS= S); -#endif + TEST_CHAIN("qcow2-symlinks", + abs_srcdir "/virstoragetestdata/images/sub/link2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); /* Behavior of an infinite loop chain */ TEST_CHAIN("qcow2-qcow2_infinite-self", diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-qcow2-symlink_raw-= raw-reldir.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2-symlin= k_raw-raw-reldir.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..9620410502f21101fb64d0314cb= 4a0c710870dd2 GIT binary patch literal 196616 zcmeIuJ5Iwu5CG7%104lNa7_V%Lm(m1P*FRHBP@b#97iEkoR4F03M3jfKOu@3`aE0f z8Sjo~z3=3DY&<|~9Sh$CLqDl4k4EsI&t21%Iaugk10CZl>@b$zAlE@_A|PkHla z;dak7Y4b()>&!iW^Rsk*eleR5FQ#Snc=3DfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+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+z&?Q_Z0>#Q<_QoWK!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&UAV7cs0RjXF5FkK+ Q009C72oNAZ;GhJ)0p$faq5uE@ literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/qcow2_raw-raw-reldir.qcow2 b/t= ests/virstoragetestdata/images/qcow2_raw-raw-reldir.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..1e32c78a46e0ca9881e85ea9e36= aef0a67fccaf7 GIT binary patch literal 196616 zcmeIvO-_SA6ae4>jBAg;+C@z~go%k8SFW+pNKz@GG>R+F=3DP^8mi5sVXXloYFHiVFD2D_}?({^s3aXhYzwEN}H;qoJnv#xmA zOg&{^53&4v2xZ;%L;hIz`_%E6Oc!0ZYWx4bkyfvL)iuRDFN?m&XZ5@q-5{GTp4+Zk zF6%{;_d`3L9jVs!o3bkNyX(Aa`mU~)BO4@PUc3!?SIwr2Rnw29ZmOgq$~+hCpNYFY z( -path:ABS_BUILDDIR/virstoragedata/sub/../sub/link1 +path:ABS_SRCDIR/virstoragetestdata/images/sub/../sub/link1 backingStoreRaw: ../raw capacity: 1024 encryption: 0 @@ -18,7 +18,7 @@ format:14 protocol:none hostname: -path:ABS_BUILDDIR/virstoragedata/sub/../sub/../raw +path:ABS_SRCDIR/virstoragetestdata/images/sub/../sub/../raw backingStoreRaw: capacity: 0 encryption: 0 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177447; cv=none; d=zohomail.com; s=zohoarc; b=iFADR2bxKTrSb4UlOp1iuuXaIQKDbAoTEEbX6ZrSoluLi9Mh51Nhn+URwkRU6vEuSjT+PeTamwwj7hl7vJmGRpKOnxuXSCeE8PkNI2bvw/TliHFt7ah5d0ungai+abY8tOiIl8EOlC+v/DWaggznHrhO4jSbVqYXyIkGix6A1bI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177447; 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=+TQeWUBVccsahfxfgaUSao8u3WAWn9KU7mLV+dipPJQ=; b=cUJ8TYMeK/Qg0EqSqyzebWQd+V+/O83AwhybdHRTUOOSKQKqUfxG8RbarKow8lrV4JvAXi9Hy6DahtiR/UNnMrAEnJDI+w6JDJSOS/JoqjHir4ek6sFMSEJwdoh0umQRjWWj0kc+HPwTDakkMzheympMH2xTWFKaZRGL2kpHZ+0= 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 1631177447411889.387292714985; Thu, 9 Sep 2021 01:50:47 -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-544-8FuPq0LRMcKgqPG3Y-rf-Q-1; Thu, 09 Sep 2021 04:50:44 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26489101AFAA; Thu, 9 Sep 2021 08:50: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 3C64926DF9; Thu, 9 Sep 2021 08:50:38 +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 07B564EA2F; Thu, 9 Sep 2021 08:50:38 +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 1898oapB030742 for ; Thu, 9 Sep 2021 04:50:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 580CC26DFD; Thu, 9 Sep 2021 08:50:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B54319C79 for ; Thu, 9 Sep 2021 08:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177446; 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=+TQeWUBVccsahfxfgaUSao8u3WAWn9KU7mLV+dipPJQ=; b=Mt3HD8U6wJmbegfDEYKNo5R1cc/NgYzPrPZ41bIb2mu8iDpdaUuYdN/XOV+GTmf5VxOO66 EccxT2okRzxl0wvxOmmdXv4KUHmlrEAF0T9vi/6YRLHS+cn40wCJrdJQ/gWBDiMvOMTJu1 MLG1HwC+tIYYm/M5L2J4fbGsi8LKiAs= X-MC-Unique: 8FuPq0LRMcKgqPG3Y-rf-Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/24] virstoragetest: Use preformatted qcow2 image for testing relative paths Date: Thu, 9 Sep 2021 10:49:14 +0200 Message-Id: <40405f44fd712fe5bb22173bbd20a1e5a56efbcd.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.84 on 10.5.11.23 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: 1631177447668100001 Content-Type: text/plain; charset="utf-8" More preparation for eliminating image rewriting. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 8 ++++++-- .../images/qcow2_raw-raw-relative.qcow2 | Bin 0 -> 196616 bytes .../out/qcow2-auto_raw-raw-relative | 2 +- .../out/qcow2-qcow2_raw-raw-relative | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 tests/virstoragetestdata/images/qcow2_raw-raw-relative.= qcow2 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 15296cc14f..9af8795492 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -498,8 +498,12 @@ mymain(void) VIR_STORAGE_FILE_AUTO, EXP_PASS); /* Qcow2 file with relative raw backing, format provided */ - TEST_CHAIN("qcow2-qcow2_raw-raw-relative", absqcow2, VIR_STORAGE_FILE_= QCOW2, EXP_PASS); - TEST_CHAIN("qcow2-auto_raw-raw-relative", absqcow2, VIR_STORAGE_FILE_A= UTO, EXP_PASS); + TEST_CHAIN("qcow2-qcow2_raw-raw-relative", + abs_srcdir "/virstoragetestdata/images/qcow2_raw-raw-relati= ve.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-auto_raw-raw-relative", + abs_srcdir "/virstoragetestdata/images/qcow2_raw-raw-relati= ve.qcow2", + VIR_STORAGE_FILE_AUTO, EXP_PASS); /* Rewrite qcow2 file to use absolute backing name */ virCommandFree(cmd); diff --git a/tests/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2 b= /tests/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..492d9bca1902564ba0128fee271= 22f5beb0e9e32 GIT binary patch literal 196616 zcmeIuyAi@L3;K literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative b/tes= ts/virstoragetestdata/out/qcow2-auto_raw-raw-relative index 4a01b24589..f9afc138f0 100644 --- a/tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative +++ b/tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/qcow2 +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2 backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative b/te= sts/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative index a1fb142e98..6e3f7ab339 100644 --- a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative +++ b/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/qcow2 +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2 backingStoreRaw: raw capacity: 1024 encryption: 0 @@ -8,7 +8,7 @@ format:14 protocol:none hostname: -path:ABS_BUILDDIR/virstoragedata/raw +path:ABS_SRCDIR/virstoragetestdata/images/raw backingStoreRaw: capacity: 0 encryption: 0 --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177449; cv=none; d=zohomail.com; s=zohoarc; b=Ysnp4mVf2ZmmMR9lgEb2yK5pbJfhy83/agHHlDO1Ybx0EtQLIHHP2wm1zh8L2hm0O+AkWKKf8dJw5FBzcl/tC1FwSY8uEsIRGi+QrgdiFdPhqFk50J2vD5mjE6FMgOO3TN0b8RqFL0G8mHWS8eVK/NWs4zZdpZh1mdNvStOobR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177449; 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=W+s5PrqXYsJWISh4a6xGWmea6HoIOuUs6a5I/q6Cp4E=; b=dg+5r7QkbL890JSt23vel3BTObr+ukmp8tuzfQOH5COmfFLWnPeWwGG2O4qyNvC9oxE411DIqTwuZKxoSscQFJHeqowoxLpasZPYsYBSMqzY7TTRaLj2cBrwoaswg0HvAEybq5nD5LY0yefaf25qIzRwjHYwVn9OwIuNoDMIBWU= 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 1631177449256323.40276241342326; Thu, 9 Sep 2021 01:50: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-222-LqPv94z7MSOs_26ztiTpkA-1; Thu, 09 Sep 2021 04:50:46 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 55E2D50756; Thu, 9 Sep 2021 08:50:41 +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 3AEAE6E0B0; Thu, 9 Sep 2021 08:50:41 +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 0F26B1832DDE; Thu, 9 Sep 2021 08:50:41 +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 1898obWD030752 for ; Thu, 9 Sep 2021 04:50:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6137E1A26A; Thu, 9 Sep 2021 08:50:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDFB119C79 for ; Thu, 9 Sep 2021 08:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177448; 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=W+s5PrqXYsJWISh4a6xGWmea6HoIOuUs6a5I/q6Cp4E=; b=aFJ7+MHuQPcyj6YgaUJwcKM0ryrKKk/ogGzd54wkVlqVfXWmjlwXSYHlmjGwpe+92ln35U p8cDSP1xseQCjysfxkLoEr4tYeJqk77yEuoAZQ5gf4DV0avFc+LzX3jBI50WPYVjPuzBTL Kj2kAh3XUsn8D8lj9KGasL1GRsTmcFs= X-MC-Unique: LqPv94z7MSOs_26ztiTpkA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 15/24] virstoragetest: Unify testing of QCOW2 images with absolute backing Date: Thu, 9 Sep 2021 10:49:15 +0200 Message-Id: <4fadffe39edb626da1aa1c66c9b33808045660e3.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.11 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: 1631177449785100004 Content-Type: text/plain; charset="utf-8" We have 3 test cases for this currently: 1) "qcow2->raw" 1.1) VIR_STORAGE_FILE_QCOW2 as top level format 1.2) VIR_STORAGE_FILE_AUTO as top level format 2) "wrap->qcow2->raw" whith just VIR_STORAGE_FILE_QCOW2 This patch adds also testing of VIR_STORAGE_FILE_AUTO for case 2) and removes both 1) subcases as they are being actually tested as part of 2). Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 7 ++----- ...raw-raw =3D> qcow2-auto_qcow2-qcow2_raw-raw} | 2 +- .../out/qcow2-qcow2_raw-raw | 19 ------------------- 3 files changed, 3 insertions(+), 25 deletions(-) rename tests/virstoragetestdata/out/{qcow2-auto_raw-raw =3D> qcow2-auto_qc= ow2-qcow2_raw-raw} (74%) delete mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_raw-raw diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 9af8795492..475ff23ce0 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -512,12 +512,9 @@ mymain(void) if (virCommandRun(cmd, NULL) < 0) ret =3D -1; - /* Qcow2 file with raw as absolute backing, backing format provided */ - TEST_CHAIN("qcow2-qcow2_raw-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EX= P_PASS); - TEST_CHAIN("qcow2-auto_raw-raw", absqcow2, VIR_STORAGE_FILE_AUTO, EXP_= PASS); - - /* qcow2 with a longer backing chain */ + /* qcow2 chain with absolute backing formatted with a real qemu-img */ TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FIL= E_QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-auto_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FILE= _AUTO, EXP_PASS); /* Qcow2 file with missing backing file but specified type */ TEST_CHAIN("qcow2-qcow2_missing", diff --git a/tests/virstoragetestdata/out/qcow2-auto_raw-raw b/tests/virsto= ragetestdata/out/qcow2-auto_qcow2-qcow2_raw-raw similarity index 74% rename from tests/virstoragetestdata/out/qcow2-auto_raw-raw rename to tests/virstoragetestdata/out/qcow2-auto_qcow2-qcow2_raw-raw index 4a01b24589..2ea087592e 100644 --- a/tests/virstoragetestdata/out/qcow2-auto_raw-raw +++ b/tests/virstoragetestdata/out/qcow2-auto_qcow2-qcow2_raw-raw @@ -1,4 +1,4 @@ -path:ABS_BUILDDIR/virstoragedata/qcow2 +path:ABS_BUILDDIR/virstoragedata/wrap backingStoreRaw: capacity: 0 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw b/tests/virst= oragetestdata/out/qcow2-qcow2_raw-raw deleted file mode 100644 index 57ce62a376..0000000000 --- a/tests/virstoragetestdata/out/qcow2-qcow2_raw-raw +++ /dev/null @@ -1,19 +0,0 @@ -path:ABS_BUILDDIR/virstoragedata/qcow2 -backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw -capacity: 1024 -encryption: 0 -relPath: -type:1 -format:14 -protocol:none -hostname: - -path:ABS_BUILDDIR/virstoragedata/raw -backingStoreRaw: -capacity: 0 -encryption: 0 -relPath: -type:1 -format:1 -protocol:none -hostname: --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1631177448; cv=none; d=zohomail.com; s=zohoarc; b=LktGG7R0WsCvMTpKOdqkE024qJrJkL3Fq4VcvG0zab2IORX7/q+/AuVV1yHHvBRyPe3ScP/jNGaoIE2m7jyEc5PoyilkswwZYrmO/UfHw73cyo0IBPHPHivy6BZVVvBwVdKPA4tCuoLglQUKyw53qwU9Hg5pOEngXJr53IlP6YM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177448; 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=oW8K9ln57gJeIaXN4Q4Yvamv1ll1es1GCmxcx7C8xAk=; b=Zs2NAyHxqwlcO/kLjrf9qkC8YOaGGZ2HMLGehTsnzT3u+TgtwF0yqID57txwbzDzxPklQEjYTtVBpABQLTVLk3bRSKWlrQKw4pi19b2ZxSIzuElDmEg1VK1bO5czJC2Rrxn+w99UUdZVleYJEJsNiPVJF7rBptdcnW9krQEr8BU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1631177448275801.6665897898698; Thu, 9 Sep 2021 01:50:48 -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-41-AsAw14uONayzCtTvkakGnA-1; Thu, 09 Sep 2021 04:50:45 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B36CD84A5E8; Thu, 9 Sep 2021 08:50: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 755D826E49; Thu, 9 Sep 2021 08:50:40 +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 347C74EA39; Thu, 9 Sep 2021 08:50:40 +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 1898ocMp030766 for ; Thu, 9 Sep 2021 04:50:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C8F126E43; Thu, 9 Sep 2021 08:50:38 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id C73FE26DFD for ; Thu, 9 Sep 2021 08:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177447; 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=oW8K9ln57gJeIaXN4Q4Yvamv1ll1es1GCmxcx7C8xAk=; b=YkSz7lBXdDp+3pKQVFbt2UPOZBIebnjFzW/5z8YCQmvgmBiJr7v+UknY2aK4kvsfXpGodg pP/YIOo9r8UqwlzG0ei8t3oW85rxZGoNCyRjtVIk0nAvbYWt+6IjMt63Nl70pq0E8leXrY LdfYeKwceAj15ZA1C6ICRirwqLlhxe4= X-MC-Unique: AsAw14uONayzCtTvkakGnA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/24] virstoragetest: Stop rewriting images in 'mymain' Date: Thu, 9 Sep 2021 10:49:16 +0200 Message-Id: <702ef0bc20ee8b7ceacfbd5cfafc0bb8e31e9069.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.84 on 10.5.11.23 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: 1631177449675100003 Content-Type: text/plain; charset="utf-8" For testing of real images formatted by 'qemu-img' it's now sufficient to format them once without the need to rewrtie them since we use the real images only for testing of one scenario. This allows us to also remove moust of the global variables holding the path to the images which was necessary when they were being rewritten. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 475ff23ce0..1ee7bb5230 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -37,28 +37,11 @@ VIR_LOG_INIT("tests.storagetest"); #define datadir abs_builddir "/virstoragedata" -/* This test creates the following files, all in datadir: - - * raw: 1024-byte raw file - * qcow2: qcow2 file with 'raw' as backing - * wrap: qcow2 file with 'qcow2' as backing - * - * Relative names to these files are known at compile time, but absolute - * names depend on where the test is run; for convenience, - * we pre-populate the computation of these names for use during the test. -*/ - -static char *qemuimg; -static char *absraw; -static char *absqcow2; static char *abswrap; static void testCleanupImages(void) { - VIR_FREE(qemuimg); - VIR_FREE(absraw); - VIR_FREE(absqcow2); VIR_FREE(abswrap); if (chdir(abs_builddir) < 0) { @@ -106,8 +89,10 @@ testPrepImages(void) bool compat =3D false; g_autoptr(virCommand) cmd =3D NULL; g_autofree char *buf =3D NULL; + g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); + g_autofree char *absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); + g_autofree char *qemuimg =3D virFindFileInPath("qemu-img"); - qemuimg =3D virFindFileInPath("qemu-img"); if (!qemuimg) goto skip; @@ -126,8 +111,6 @@ testPrepImages(void) compat =3D true; VIR_FREE(buf); - absraw =3D g_strdup_printf("%s/raw", datadir); - absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); abswrap =3D g_strdup_printf("%s/wrap", datadir); if (g_mkdir_with_parents(datadir, 0777) < 0) { @@ -158,7 +141,7 @@ testPrepImages(void) /* Make sure our later uses of 'qemu-img rebase' will work */ virCommandFree(cmd); cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", "raw", "qcow2", NULL); + "-F", "raw", "-b", absraw, "qcow2", NULL); if (virCommandRun(cmd, NULL) < 0) goto skip; @@ -469,7 +452,6 @@ mymain(void) virStorageSource *chain =3D &fakeChain[0]; virStorageSource *chain2 =3D &fakeChain[1]; virStorageSource *chain3 =3D &fakeChain[2]; - g_autoptr(virCommand) cmd =3D NULL; if (storageRegisterAll() < 0) return EXIT_FAILURE; @@ -505,13 +487,6 @@ mymain(void) abs_srcdir "/virstoragetestdata/images/qcow2_raw-raw-relati= ve.qcow2", VIR_STORAGE_FILE_AUTO, EXP_PASS); - /* Rewrite qcow2 file to use absolute backing name */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", absraw, "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - ret =3D -1; - /* qcow2 chain with absolute backing formatted with a real qemu-img */ TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FIL= E_QCOW2, EXP_PASS); TEST_CHAIN("qcow2-auto_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FILE= _AUTO, EXP_PASS); --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177450; cv=none; d=zohomail.com; s=zohoarc; b=E29ZEp0PHtkdHisldLZeDFV8rySuEWz+Wsi9aUwDRyFPEN+LZ8F2TmNWcYt+FFaY+2PWu2Xvo+Lttd/0N4Rk+LKlSRDkyTTVvFx0Jk8db7uFxezYqqUBwkJLgy3wo/OQRzlWjmIq/alWp9fYmuoHWEXO1MHTc8eNhhEopMoqlVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177450; 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=/luQhag0BnCUK57OW/h5IqOUhcoWmKltWMOb+eYnnlA=; b=iab65QQXJvseZVWjbHuVp63/m7dzh4mUz2upRoj1E/eYe4EvWcFw43M0LVGdwjKyWLnUQSgZBCQk8RbGtG8fNO5ixR39Yd/1YA+4kj5iI9G744b1KXM9czsUqF2wwpA6J76TAGMDZ+zKzCgKn5nfq7w0llF6wjouo2JaFy863Vg= 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 1631177450784681.0294820135437; Thu, 9 Sep 2021 01:50:50 -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-558-F2st_ePeOvSty4NCnabj4Q-1; Thu, 09 Sep 2021 04:50:48 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AB0F101AFA7; Thu, 9 Sep 2021 08:50: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 E313C19C79; Thu, 9 Sep 2021 08:50:41 +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 B367B1832DF2; Thu, 9 Sep 2021 08:50:41 +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 1898odpm030782 for ; Thu, 9 Sep 2021 04:50:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F15926DEC; Thu, 9 Sep 2021 08:50:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4E8226E40 for ; Thu, 9 Sep 2021 08:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177449; 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=/luQhag0BnCUK57OW/h5IqOUhcoWmKltWMOb+eYnnlA=; b=JdKJL1XKp/vwfVtzM3zq9CzqjGobiagiCYR0IEhv3wwhpB777lWrqKNlKbOZghZOh8bXY5 AB/Um/1HQU+8Rhj6km4tl2NiheKLp14Iwa6opfsg8rrQ1T6nr7oy/UqT9eI3wOG08UbLMr g+D+VkNZGndG8kLyust4fP/Vo+85NQA= X-MC-Unique: F2st_ePeOvSty4NCnabj4Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/24] virstoragetest: Don't rewrite the 'qcow2' image Date: Thu, 9 Sep 2021 10:49:17 +0200 Message-Id: <11133815fa813635a195af8176983cbc9bcfbb17.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.84 on 10.5.11.23 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: 1631177451999100001 Content-Type: text/plain; charset="utf-8" Create it with the appropriate backing file path rather than using another instance of 'qemu-img rebase'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 1ee7bb5230..9a7905e28d 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -132,18 +132,15 @@ testPrepImages(void) /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", NULL); - virCommandAddArgFormat(cmd, "-obacking_file=3Draw,backing_fmt=3Draw%s", - compat ? ",compat=3D0.10" : ""); + cmd =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "raw", + "-b", absraw, NULL); + if (compat) + virCommandAddArgList(cmd, "-o", "compat=3D0.10", NULL); virCommandAddArg(cmd, "qcow2"); if (virCommandRun(cmd, NULL) < 0) goto skip; - /* Make sure our later uses of 'qemu-img rebase' will work */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", - "-F", "raw", "-b", absraw, "qcow2", NULL); - if (virCommandRun(cmd, NULL) < 0) - goto skip; /* Create a second qcow2 wrapping the first, to be sure that we * can correctly avoid insecure probing. */ --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177454; cv=none; d=zohomail.com; s=zohoarc; b=Mk7rnKF3G1nyn2Crz6ou4X5j3dWpw9NygFGcTLrtMrFxMBEg17OwGforYTVet1GmeM1Vq8nbbXfl/x+qBiyzdbzwNtGgU+ISNm1YZkkGdhCInDtOJ65DtflDhMzZcYqQhxG8UAt7F8+/21nOsWJOi6GZeEWu10Ysba/GTVrQp1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177454; 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=VMqF020tzlQcYRoKh/0aT1TEZjxsrTYWYQGZfGwcwM4=; b=bRVi0hMpXz9SxyP9hfZrUAZdmGBpMAUMinQBRzddlFaGkVOsvyZmL+EJnNI3T1m2N9ibAeyz7nuI0kKp/2FqEPJeaiyISTmcviqOx1ttf+aYUJmNBEyoWso8YJ6KOfXnfqRCUa/s8KJA6G/WRWT+CyitcyTlKpzFlbU3DaDRVl0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 163117745452444.46304834926093; Thu, 9 Sep 2021 01:50:54 -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-105-EfoiUsA8Ns6kUT-k-PhlQQ-1; Thu, 09 Sep 2021 04:50:52 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E93BB56AA8; Thu, 9 Sep 2021 08:50:43 +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 CDCE577BF5; Thu, 9 Sep 2021 08:50:43 +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 9C7E0181A1D0; Thu, 9 Sep 2021 08:50:43 +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 1898oeN3030790 for ; Thu, 9 Sep 2021 04:50:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id A00BF19C79; Thu, 9 Sep 2021 08:50:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04F3B19736 for ; Thu, 9 Sep 2021 08:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177453; 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=VMqF020tzlQcYRoKh/0aT1TEZjxsrTYWYQGZfGwcwM4=; b=Dgg1Phm2eHd7iYppmpbj6mWmNNei68sY6Ut24ygcsYGrMvOXRnqutETPl24N3qiS21PcLS /lXuyydc/50efywtrIBKxfofNfCeB9NbVPHeysCeSSxdJ8umZH5/gBpRa27lvAI1LuyZWg tGL721KVWOZ8JFdJNL/pLDcb1ePz9S0= X-MC-Unique: EfoiUsA8Ns6kUT-k-PhlQQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 18/24] virstoragetest: Assume that 'qemu-img' supports '-o compat=' Date: Thu, 9 Sep 2021 10:49:18 +0200 Message-Id: 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.13 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: 1631177456129100005 Content-Type: text/plain; charset="utf-8" All supported qemu versions have the parameter, so we don't need to check. This allows us to simplify the code used for formating real images for virstoragetest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 9a7905e28d..955ac64e0b 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -86,7 +86,6 @@ static int testPrepImages(void) { int ret =3D EXIT_FAILURE; - bool compat =3D false; g_autoptr(virCommand) cmd =3D NULL; g_autofree char *buf =3D NULL; g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); @@ -99,18 +98,6 @@ testPrepImages(void) /* Clean up from any earlier failed tests */ virFileDeleteTree(datadir); - /* See if qemu-img supports '-o compat=3Dxxx'. If so, we force the - * use of both v2 and v3 files; if not, it is v2 only but the test - * still works. */ - cmd =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", - "-o?", "/dev/null", NULL); - virCommandSetOutputBuffer(cmd, &buf); - if (virCommandRun(cmd, NULL) < 0) - goto skip; - if (strstr(buf, "compat ")) - compat =3D true; - VIR_FREE(buf); - abswrap =3D g_strdup_printf("%s/wrap", datadir); if (g_mkdir_with_parents(datadir, 0777) < 0) { @@ -131,24 +118,24 @@ testPrepImages(void) /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ - virCommandFree(cmd); cmd =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", "-F", "raw", - "-b", absraw, NULL); - if (compat) - virCommandAddArgList(cmd, "-o", "compat=3D0.10", NULL); - virCommandAddArg(cmd, "qcow2"); + "-b", absraw, + "-o", "compat=3D0.10", + absqcow2, NULL); if (virCommandRun(cmd, NULL) < 0) goto skip; /* Create a second qcow2 wrapping the first, to be sure that we * can correctly avoid insecure probing. */ virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", NULL); - virCommandAddArgFormat(cmd, "-obacking_file=3D%s,backing_fmt=3Dqcow2%s= ", - absqcow2, compat ? ",compat=3D1.1" : ""); - virCommandAddArg(cmd, "wrap"); + cmd =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "qcow2", + "-b", absqcow2, + "-o", "compat=3D1.1", + abswrap, NULL); if (virCommandRun(cmd, NULL) < 0) goto skip; --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177453; cv=none; d=zohomail.com; s=zohoarc; b=L5+QwoiUMH+ae5fpH9Gg3pUOk84OiVmC5r+5MhPbmudBxAqKTpnSmRtk/O2SaFQgX4gU4BeAeRbC5gHpZZrmNVsqIBaywoBu5CyLBPAiV0vJEqQCUIJ8VG1+0KjLPbXS9ZFE4OopBp18od6edaOa4WefCrRaBYXIAL9SLKBlblk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177453; 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=tX15mcwe/XJQhVxpf4gVLlLPDYYmT3NetllVSdV1uPc=; b=geS4wDveEYAg35OTyJijPryoIwTJ+ckuLjrpk8HIZOVSI5IGDIXothZKD/LqQOyDzpOdu606MQtfCwKL1kS4kicv+ecJ9z4hoZfvQYlnInDGkVWn7zNgbF087O1ziIDA709BrGdaSvgi75HnUiAdWhf7PmmgqvuaXKWkUYrAI8U= 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 1631177453360477.4518191324453; Thu, 9 Sep 2021 01:50:53 -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-156-E-pnioOlOyW2A5ANNiPLig-1; Thu, 09 Sep 2021 04:50:50 -0400 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 98E7510168E7; Thu, 9 Sep 2021 08:50:44 +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 16E936C8D4; Thu, 9 Sep 2021 08:50:44 +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 D10E34EA3A; Thu, 9 Sep 2021 08:50:43 +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 1898ofSQ030797 for ; Thu, 9 Sep 2021 04:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0FC319736; Thu, 9 Sep 2021 08:50:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E71B1A26A for ; Thu, 9 Sep 2021 08:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177452; 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=tX15mcwe/XJQhVxpf4gVLlLPDYYmT3NetllVSdV1uPc=; b=eYEaWyBpND1T/zIJ+4c+LfZxhq0dd+a7Iqnxxzh7FHSAluyUS4qzI2ltA9t2dewNh4VG4m avXS95YN807Ha3HhORbc5AkK0Tjplnl6dFD6w+hXrDRvxMO/65HEdkxjGiMSBnQOcZEZJf JPHpG1EV04yrwNQUTBaZx/c8/N17/Cc= X-MC-Unique: E-pnioOlOyW2A5ANNiPLig-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/24] virstoragetest: testPrepImages: Don't reuse 'cmd' pointer Date: Thu, 9 Sep 2021 10:49:19 +0200 Message-Id: <050e89d6bd8144cba296fc774f44c5130f8e9709.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.15 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: 1631177454066100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 955ac64e0b..90dde512cf 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -86,7 +86,8 @@ static int testPrepImages(void) { int ret =3D EXIT_FAILURE; - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmdqcow2 =3D NULL; + g_autoptr(virCommand) cmdwrap =3D NULL; g_autofree char *buf =3D NULL; g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); g_autofree char *absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); @@ -118,25 +119,24 @@ testPrepImages(void) /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ - cmd =3D virCommandNewArgList(qemuimg, "create", - "-f", "qcow2", - "-F", "raw", - "-b", absraw, - "-o", "compat=3D0.10", - absqcow2, NULL); - if (virCommandRun(cmd, NULL) < 0) + cmdqcow2 =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "raw", + "-b", absraw, + "-o", "compat=3D0.10", + absqcow2, NULL); + if (virCommandRun(cmdqcow2, NULL) < 0) goto skip; /* Create a second qcow2 wrapping the first, to be sure that we * can correctly avoid insecure probing. */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "create", - "-f", "qcow2", - "-F", "qcow2", - "-b", absqcow2, - "-o", "compat=3D1.1", - abswrap, NULL); - if (virCommandRun(cmd, NULL) < 0) + cmdwrap =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "qcow2", + "-b", absqcow2, + "-o", "compat=3D1.1", + abswrap, NULL); + if (virCommandRun(cmdwrap, NULL) < 0) goto skip; ret =3D 0; --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177583; cv=none; d=zohomail.com; s=zohoarc; b=azc6z29tEiDX/U36G2//A9ky2R+Px4BsUBK4WL3jGCsJRY5RoO6kF6w5pieWoiBhyB0pZ8t+AzmLCzyFIEQDADbDSVOIV1WyZC5qkTVRRmHCCHRL0SP1ix8F8qCPc3R6JgGr/wiOELari74Zk4tMi6hCYkiWBC8Lq2YUL9bGrnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177583; 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=qSwXewGxS7dU5KacoZhY9ESzMbNT4Iz6VibcdqI9LKo=; b=h5lljQfTp+ms27b3Vab2TIgS87ERdnNxqg4pszaCd2+d2b++T1vbAy1cDm5IyYRCdrbTDj+Y2U4fSMe2fH3gUl5DrpNGKCv2qbTaaeV2yWtAKuGunESuFXb5R0XnPhLxHNn0WhYwKSgLjWOyR9r6erWhsFCDzzj1Ch+Ql4pxgAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177583518134.44047921108643; Thu, 9 Sep 2021 01:53:03 -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-235-_ptiHTErO_y6bYljf4pZUQ-1; Thu, 09 Sep 2021 04:50:56 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C9D81895817; Thu, 9 Sep 2021 08:50:47 +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 2C34819C79; Thu, 9 Sep 2021 08:50: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 E48184EA47; Thu, 9 Sep 2021 08:50:46 +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 1898ogp6030812 for ; Thu, 9 Sep 2021 04:50:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id BF5C726E41; Thu, 9 Sep 2021 08:50:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2348519D9B for ; Thu, 9 Sep 2021 08:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177582; 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=qSwXewGxS7dU5KacoZhY9ESzMbNT4Iz6VibcdqI9LKo=; b=deslyRDNV3e98FNMPJxBqytmzdBFyg2yDwjJ314UtZAzIQ22yXuzZsYj40+dBuPtiOneiP ILVUmRh4ZlqSx7uKzuonU0xDNAKb8R2ryZiXyX+Vb9g1MMFpFbeyJ2QHi49EwfyWVwqojO P9ljStM2aYKAAoK1s1NdX2+ePJl0gtA= X-MC-Unique: _ptiHTErO_y6bYljf4pZUQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/24] virstoragetest: testPrepImages: Use 'qemu-img' to format 'raw' image Date: Thu, 9 Sep 2021 10:49:20 +0200 Message-Id: <3075b29675c981fbced384eafa0d8b2d3c9a6b9c.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.84 on 10.5.11.23 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: 1631177585681100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 90dde512cf..c258bc1709 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -86,9 +86,9 @@ static int testPrepImages(void) { int ret =3D EXIT_FAILURE; + g_autoptr(virCommand) cmdraw =3D NULL; g_autoptr(virCommand) cmdqcow2 =3D NULL; g_autoptr(virCommand) cmdwrap =3D NULL; - g_autofree char *buf =3D NULL; g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); g_autofree char *absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); g_autofree char *qemuimg =3D virFindFileInPath("qemu-img"); @@ -111,11 +111,11 @@ testPrepImages(void) goto cleanup; } - buf =3D g_strdup_printf("%1024d", 0); - if (virFileWriteStr("raw", buf, 0600) < 0) { - fprintf(stderr, "unable to create raw file\n"); - goto cleanup; - } + cmdraw =3D virCommandNewArgList(qemuimg, "create", + "-f", "raw", + absraw, "1k", NULL); + if (virCommandRun(cmdraw, NULL) < 0) + goto skip; /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177537; cv=none; d=zohomail.com; s=zohoarc; b=ICnd50HWDEQDmrp32KCdzpHrhMvDiTVyrkPpEW54k9Trjl0/QBNGrb7Tsw674jWSw+aqPAC5dplIBwFc9qqF3R2uv+WI7HgqGO9iP8i9Uz7A7ccOgWc1gNBGPe06sZI6eOLBl+nW16hDWruuI2E2b9+tDkBRh+ER4bnsJbyTShw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177537; 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=ruFIQ0igVyCzhyJZPVuLrRvbf8PoEOIzHyNryj9kdFA=; b=f/l4qp8fa5uE4gwrZGO2kw81SIJ2J0FXnBVtX3SQapsPeVSQjcvqSKORXQ11DMEXR1FUHl00Hs7d0xxAycGzqRtwAfLS0TM1k0TJI7mXwQxwhZo0aLrw3XPvwWI2al2xr2AB4sMojjD67RfxuhTl/korkFYcybBKiiafQoyPF0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177537460260.7892536574335; Thu, 9 Sep 2021 01:52:17 -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-169-z-Y4y-_POYG2m73i_pCSgA-1; Thu, 09 Sep 2021 04:50:55 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4881969733; Thu, 9 Sep 2021 08:50: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 D3ED026FA3; Thu, 9 Sep 2021 08:50: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 8FBE11806D02; Thu, 9 Sep 2021 08:50:46 +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 1898ohwt030825 for ; Thu, 9 Sep 2021 04:50:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id E675026E50; Thu, 9 Sep 2021 08:50:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BDDF19736 for ; Thu, 9 Sep 2021 08:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177536; 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=ruFIQ0igVyCzhyJZPVuLrRvbf8PoEOIzHyNryj9kdFA=; b=OsROnYEuIclyAb7vfmzK0HgbZS61tFuQgLbzj5vCDp0kNhNSs2evXCOO5bgFiw9h/36W5/ neSYrp8xnAZ+y6fQeHyovDZmTzUDWpZl5l8myYvlhhwt5zNiLwvfro1kUT3C6esIiralIj S76UZRsVxjR2LeArsvtsAWkCPtJ8dRY= X-MC-Unique: z-Y4y-_POYG2m73i_pCSgA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/24] virstoragetest: testStorageChain: Skip test if filename is NULL Date: Thu, 9 Sep 2021 10:49:21 +0200 Message-Id: <19bfc1123106146228e92ddf2293e8c4734ad0b9.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.84 on 10.5.11.23 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: 1631177538176100001 Content-Type: text/plain; charset="utf-8" Prepare the test runner for skipping individual tests if images can't be formatted rather than the whole virstoragetest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index c258bc1709..d9ab630600 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -176,6 +176,11 @@ testStorageChain(const void *args) g_autofree char *expectpath =3D g_strdup_printf("%s/virstoragetestdata= /out/%s", abs_srcdir, data->testna= me); + /* If the filename is NULL it means that the images couldn't be create= d, + * thus skip this particular test. */ + if (!data->start) + return EXIT_AM_SKIP; + meta =3D testStorageFileGetMetadata(data->start, data->format, -1, -1); if (!meta) { if (data->flags & EXP_FAIL) { --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 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=1631177459; cv=none; d=zohomail.com; s=zohoarc; b=BjrTm10jyrRfQbzKrWJ6pQvEo8DF7Mieth40e3qCAgVvbxXBy6Ko/ml1JWAtGWDjOz3qD0UtRbgV57z/P+kwuExFxWnGb0p34Ai8O2CwVdPjSmPHr7dkh8xm3DFaEZ4uom2gYU/AWcK5AXCNi3A6x6oJ16uNWw5gRqNqJpdqE/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177459; 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=q8pNWu/+42wHdBIPhDcSiXmb+l7hC0VlzxIMR19RKgQ=; b=ldowd+qoRsL3kdddb56RJ8/6cLyqfVTXeGJaoXxN282mDYakxATPkSz8bQt/VIiMizvid37RZ/wzvY/RhxE1PSfytMmudZoH+z7oMLhwIjAu5+Ji9Ct0eX/4C6V1hxfA5QR0zrjXMy3qN85kiPln504ZaZUgEN24UZ+CY1fX6HY= 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 1631177459002885.9702273675002; Thu, 9 Sep 2021 01:50:59 -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-526-M_eIG6OMPdu5R1Tx-5Q_ZA-1; Thu, 09 Sep 2021 04:50:56 -0400 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 B42DC18A0745; Thu, 9 Sep 2021 08:50:49 +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 95CF25453A; Thu, 9 Sep 2021 08:50: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 16AF54EA3A; Thu, 9 Sep 2021 08:50:49 +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 1898oj7T030837 for ; Thu, 9 Sep 2021 04:50:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id E7EE91A26A; Thu, 9 Sep 2021 08:50:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 498F526DFF for ; Thu, 9 Sep 2021 08:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177457; 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=q8pNWu/+42wHdBIPhDcSiXmb+l7hC0VlzxIMR19RKgQ=; b=YwUbr8BTlruJ8RSoXhZ7dqx4mJAFZOSxQrnysA9HzY01Y4ZklN+Rp3VZABvhliq+MaL1wm 8lt2fO4MwUU8828Pro6agybwW6dqJr2raAUjs5VQ0zMfrS5ddiaw7orhJ5trqFKTYE2yAv uVPz7afWUZX9OiojsvsD0cpNvzWMSLo= X-MC-Unique: M_eIG6OMPdu5R1Tx-5Q_ZA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/24] virstoragetest: Don't skip the whole test when qemu-img fails to format images Date: Thu, 9 Sep 2021 10:49:22 +0200 Message-Id: <2c1f4730c72ae577787d0adc0346ced678753464.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.15 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: 1631177460480100002 Content-Type: text/plain; charset="utf-8" We have plenty of other work to do in this test. Skip only the real image testing case when we can't find qemu-img or it failed to format the image. This allows us to also remove the last global variable in the test and move the creation and cleanup of the images closer to the actual test. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 73 ++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index d9ab630600..bbeb5ecd88 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -37,13 +37,9 @@ VIR_LOG_INIT("tests.storagetest"); #define datadir abs_builddir "/virstoragedata" -static char *abswrap; - static void testCleanupImages(void) { - VIR_FREE(abswrap); - if (chdir(abs_builddir) < 0) { fprintf(stderr, "unable to return to correct directory, refusing t= o " "clean up %s\n", datadir); @@ -82,75 +78,60 @@ testStorageFileGetMetadata(const char *path, return g_steal_pointer(&def); } -static int +static char * testPrepImages(void) { - int ret =3D EXIT_FAILURE; g_autoptr(virCommand) cmdraw =3D NULL; g_autoptr(virCommand) cmdqcow2 =3D NULL; g_autoptr(virCommand) cmdwrap =3D NULL; g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); g_autofree char *absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); + g_autofree char *abswrap =3D g_strdup_printf("%s/wrap", datadir); g_autofree char *qemuimg =3D virFindFileInPath("qemu-img"); if (!qemuimg) - goto skip; + return NULL; /* Clean up from any earlier failed tests */ virFileDeleteTree(datadir); - abswrap =3D g_strdup_printf("%s/wrap", datadir); - if (g_mkdir_with_parents(datadir, 0777) < 0) { - fprintf(stderr, "unable to create directory %s\n", datadir); - goto cleanup; - } - - if (chdir(datadir) < 0) { - fprintf(stderr, "unable to test relative backing chains\n"); - goto cleanup; + VIR_TEST_VERBOSE("unable to create directory '%s'\n", datadir); + return NULL; } + /* create the folowing real backing chain with qcow2 images with absol= ute + * backing and different qcow2 versions: + * datadir/raw <- datadir/qcow2 (qcow2v2) <- datadir/wrap (qcow2v3) */ cmdraw =3D virCommandNewArgList(qemuimg, "create", "-f", "raw", absraw, "1k", NULL); - if (virCommandRun(cmdraw, NULL) < 0) - goto skip; - /* Create a qcow2 wrapping relative raw; later on, we modify its - * metadata to test other configurations */ cmdqcow2 =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", "-F", "raw", "-b", absraw, "-o", "compat=3D0.10", absqcow2, NULL); - if (virCommandRun(cmdqcow2, NULL) < 0) - goto skip; - /* Create a second qcow2 wrapping the first, to be sure that we - * can correctly avoid insecure probing. */ cmdwrap =3D virCommandNewArgList(qemuimg, "create", "-f", "qcow2", "-F", "qcow2", "-b", absqcow2, "-o", "compat=3D1.1", abswrap, NULL); - if (virCommandRun(cmdwrap, NULL) < 0) - goto skip; - ret =3D 0; - cleanup: - if (ret) - testCleanupImages(); - return ret; + if (virCommandRun(cmdraw, NULL) < 0 || + virCommandRun(cmdqcow2, NULL) < 0 || + virCommandRun(cmdwrap, NULL) < 0) { + VIR_TEST_VERBOSE("failed to create backing chain in '%s'\n", datad= ir); + return NULL; + } - skip: - fputs("qemu-img is too old; skipping this test\n", stderr); - ret =3D EXIT_AM_SKIP; - goto cleanup; + return g_steal_pointer(&abswrap); } + enum { EXP_PASS =3D 0, EXP_FAIL =3D 1, @@ -432,11 +413,12 @@ testBackingParse(const void *args) static int mymain(void) { - int ret; + int ret =3D 0; struct testChainData data; struct testLookupData data2; struct testPathRelativeBacking data4; struct testBackingParseData data5; + g_autofree char *realchain =3D NULL; virStorageSource fakeChain[4]; virStorageSource *chain =3D &fakeChain[0]; virStorageSource *chain2 =3D &fakeChain[1]; @@ -445,11 +427,6 @@ mymain(void) if (storageRegisterAll() < 0) return EXIT_FAILURE; - /* Prep some files with qemu-img; if that is not found on PATH, or - * if it lacks support for qcow2 and qed, skip this test. */ - if ((ret =3D testPrepImages()) !=3D 0) - return ret; - #define TEST_CHAIN(testname, start, format, flags) \ do { \ data =3D (struct testChainData){ testname, start, format, flags };= \ @@ -477,8 +454,15 @@ mymain(void) VIR_STORAGE_FILE_AUTO, EXP_PASS); /* qcow2 chain with absolute backing formatted with a real qemu-img */ - TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FIL= E_QCOW2, EXP_PASS); - TEST_CHAIN("qcow2-auto_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FILE= _AUTO, EXP_PASS); + + /* Prep some files with qemu-img; if that is not found on PATH, the te= st + * using the data skips itself if the data can't be prepared */ + realchain =3D testPrepImages(); + + TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", realchain, VIR_STORAGE_F= ILE_QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-auto_qcow2-qcow2_raw-raw", realchain, VIR_STORAGE_FI= LE_AUTO, EXP_PASS); + + testCleanupImages(); /* Qcow2 file with missing backing file but specified type */ TEST_CHAIN("qcow2-qcow2_missing", @@ -1188,9 +1172,6 @@ mymain(void) #endif /* WITH_YAJL */ cleanup: - /* Final cleanup */ - testCleanupImages(); - return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177458; cv=none; d=zohomail.com; s=zohoarc; b=CiHc5K0o3QMHS1wiksIB/2skdZ7MEKfhCN0Y8FCVALCgCT8HCr8gLjv0wENcj24lM5Haaaw69pRr4mdJUqifZaht6hqR95PAl1il0w1OmOaKYuAmjaHZTNbEtFkhf04lViH6v9QvD8GGUnECyZQOsWPBp3nM1lbuykWm+1M4IuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177458; 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=jymSUNcW6LKtRR915NBQz9t8XokOJfQAAq8OVOGGs4s=; b=jeIwslzWMvkkHM94C6I0LjUI2pJFD7XMyLp4y2UCSmnnLmSAJjBBLjlgq8T2Tvt5FJ5RaOsEUqAhr8VXbgKE1sXod9/zN2A+E5CQ/E7+4XleximtWAURyHojdTqBEr6S5m+XcgHbjOylWWKmknJAr2NOnPPdl6pvvnTIOVcRy3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631177458885862.5509557780061; Thu, 9 Sep 2021 01:50:58 -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-235-W0VtAg1hN0C6nGUhB3RAWA-1; Thu, 09 Sep 2021 04:50:55 -0400 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 9B83718A0744; Thu, 9 Sep 2021 08:50: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 769856CA20; Thu, 9 Sep 2021 08:50: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 19FB41800FE4; Thu, 9 Sep 2021 08:50:49 +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 1898ojN7030844 for ; Thu, 9 Sep 2021 04:50:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id F26E019D9B; Thu, 9 Sep 2021 08:50:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6019C26FB6 for ; Thu, 9 Sep 2021 08:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177457; 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=jymSUNcW6LKtRR915NBQz9t8XokOJfQAAq8OVOGGs4s=; b=MkPPTBCd/kiGPJG0OpHWzrwaENHP0I9T6dvrwJ2RqlC9FsINCr97bmkzj7b65kLJCRVh7I GJW2OXTVbyUuZ1DPd0C3FhdWJ0O3NvlcbyhucgmQ/D1skWBQCAJ0WiWbpT8Ij+dHT6j3Ki 8AdYLUOGGhLaTy6ghW3F1UlKcIg+TTU= X-MC-Unique: W0VtAg1hN0C6nGUhB3RAWA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 23/24] virstoragetest: Remove pointless goto from mymain Date: Thu, 9 Sep 2021 10:49:23 +0200 Message-Id: <987330f13b09517a673fadddf03bdfaff74ea0f2.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.15 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: 1631177460454100001 Content-Type: text/plain; charset="utf-8" Improve the error message and abort the test. Continuing here is not desired as without chdiring into the appropriate directory the test would fail anyways and worse could attempt stat-ing random files on the host. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index bbeb5ecd88..513ffdeb41 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -502,8 +502,9 @@ mymain(void) /* setup data for backing chain lookup testing */ if (chdir(abs_srcdir "/virstoragetestdata/lookup") < 0) { - fprintf(stderr, "unable to test relative backing chains\n"); - goto cleanup; + VIR_TEST_VERBOSE("failed to chdir into '%s'\n", + abs_srcdir "/virstoragetestdata/lookup"); + return EXIT_FAILURE; } memset(fakeChain, 0, sizeof(fakeChain)); @@ -1171,7 +1172,6 @@ mymain(void) #endif /* WITH_YAJL */ - cleanup: return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.31.1 From nobody Fri Apr 19 12:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631177460; cv=none; d=zohomail.com; s=zohoarc; b=dV6vjXHIFpzakRqbuF1OCZwF6GkrgOwgGNOor5xJfpTW1wkM/vIkCw3EmtO3ezMTBya0uv+DeDGjnh7kvNcTklHSqVNMGcCIA4sJ/1J8TYLlS8/4kHihSUWkuqrCaHS3vSgdNqcXtKtVsd9w/+WfI5vmQfwSY2FsCk3zD2qQhYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177460; 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=qLJCMWYRl5eRPEtRlHc37gSC7lUzsg9v9mqMaAsDelE=; b=JhSVilZPU5D0dUiyeuom4YtqHe7zslQ5Eflt7xdszB8nMdzgH0hGCuRzKG9DRMduAA6A2Uv8AFUNQDR1VdleLJ40k55tjPIz7cRMdk8seqAmdng/n/hC42AWJyBW0xXRy9aiT9Qaf/t7C8CwWrOHEp09Kt1aYBZ/pWRtvMkykdA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 163117746055434.973800418718724; Thu, 9 Sep 2021 01:51:00 -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-447-tPBHw4cKOhmCFvxDiUZGEg-1; Thu, 09 Sep 2021 04:50:58 -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 2F75E18D6A56; Thu, 9 Sep 2021 08:50:52 +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 0EC565D9F4; Thu, 9 Sep 2021 08:50:52 +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 D50EE1832DD5; Thu, 9 Sep 2021 08:50:51 +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 1898ol5T030852 for ; Thu, 9 Sep 2021 04:50:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2566F1A26A; Thu, 9 Sep 2021 08:50:47 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C94619C79 for ; Thu, 9 Sep 2021 08:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177459; 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=qLJCMWYRl5eRPEtRlHc37gSC7lUzsg9v9mqMaAsDelE=; b=gVYsDAGdEv+B7VhIzDXm4rzfCBqhyWIHWEmj5L7S+84zOawzHJBwsmuCL3LoZIrl6+zQe2 KHC0MNE5SzmmZAbZiKTgyi7Nztd1bSFS51wENKX6JJBySJy0WYoqVmGUnHqgAnaZ0kYHWC s13+GQjcFt1okuPLdsDuJ/LKeMvc1U0= X-MC-Unique: tPBHw4cKOhmCFvxDiUZGEg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 24/24] virstoragetest: Reinstate testing of images without 'backing_fmt' Date: Thu, 9 Sep 2021 10:49:24 +0200 Message-Id: <5fa046259153475e464cab7c5bb7c0298a9475c6.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: 1631177462606100001 Content-Type: text/plain; charset="utf-8" There are important security implications when we'd misprobe those images. This commit reinstates the tests removed by commit 979d1ba3ae13 since 'qemu-img' refused to format them. With the new testing approach with stored images we won't run into that problem. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virstoragetest.c | 14 +++++++++ tests/virstoragetestdata/images/qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_qcow2-auto.qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_qcow2-auto_qcow2-auto.qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_qcow2-qcow2_qcow2-auto.qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_qcow2-qcow2_raw-auto.qcow2 | Bin 0 -> 196616 bytes .../images/qcow2_raw-auto.qcow2 | Bin 0 -> 196616 bytes .../out/qcow2-qcow2_qcow2-auto | 19 ++++++++++++ .../out/qcow2-qcow2_qcow2-qcow2_qcow2-auto | 29 ++++++++++++++++++ .../out/qcow2-qcow2_qcow2-qcow2_raw-auto | 29 ++++++++++++++++++ 10 files changed, 91 insertions(+) create mode 100644 tests/virstoragetestdata/images/qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-auto_qcow2-= auto.qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2= -auto.qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-a= uto.qcow2 create mode 100644 tests/virstoragetestdata/images/qcow2_raw-auto.qcow2 create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qc= ow2-auto create mode 100644 tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_ra= w-auto diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 513ffdeb41..ec185d8660 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -464,6 +464,20 @@ mymain(void) testCleanupImages(); + /* Test various combinations of qcow2 images with missing 'backing_for= mat' */ + TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_qcow2-auto", + abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-qcow2_qc= ow2-auto.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-auto", + abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-qcow2_ra= w-auto.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); + TEST_CHAIN("qcow2-qcow2_qcow2-auto_qcow2-auto", + abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-auto_qco= w2-auto.qcow2", + VIR_STORAGE_FILE_QCOW2, EXP_FAIL); + TEST_CHAIN("qcow2-qcow2_qcow2-auto", + abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-auto.qco= w2", + VIR_STORAGE_FILE_QCOW2, EXP_PASS); + /* Qcow2 file with missing backing file but specified type */ TEST_CHAIN("qcow2-qcow2_missing", abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-missing.= qcow2", diff --git a/tests/virstoragetestdata/images/qcow2 b/tests/virstoragetestda= ta/images/qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..31a144e4b947692c834363797fa= 34457edc2094c GIT binary patch literal 196616 zcmeIuK~94}6adhH_5dDX&fpJXO4{o6X#@$NdNHV;kO z%`_;&rh41QA+1;4bDQT%PrH=3DiAhWIdKMTKmmc>xL#9wEg`5P$$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 z5FkK+009C72%Hfp&%}iZ5FkK+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*pk1PBlyK!5-N0t5&UAVA=3D91d1@;mvdq#B|v}x 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&UAV7cs0RjXF5FkK+ a009C72oNAZfB*pk1PBlyK!5;&8G$bzfG}YI literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 b/tests= /virstoragetestdata/images/qcow2_qcow2-auto.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..490482150d476032cfccd91be40= 3f15430682f67 GIT binary patch literal 196616 zcmeIuK~94}6adhH>fR%8h91Ji#EmQ02sDzkfOMK#S03BMjnL9GE=3D2b}$S{AH&;QJO zxV`%fAuNV5T&cWgm875LP(Cmlr^nR@6H)N&tsA9y#2iRcpS>ThfvmiJY-LG zJa5gCAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PJ_hf%LxvI6nab1PBlyK!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*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2!v$1Q4kHRMECt5%sl2j z-Z0<8?cG-hVbnkUm2QTs{<+))AzbXH5Rz@MuiC%u)(#cF&zmOgA^kG?eC*qOgfOYP zxXzxdct{P;NzruOvW@@!A}!xy+12?ho8&Rirq!$*++b8R^R_D&i>j%!xNe85dzwxE zdQwiZ`*Bv*v8&3(zy?W}tfB*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 z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs R0RjXF5FkK+0D*lM_y(Y-Jpcdz literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qco= w2 b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..90b0a9a0594bc7e1e00dea41825= fcf7996c7fc33 GIT binary patch literal 196616 zcmeIvJx;?g00vMeg`I%|WJZF4Lm(lsFfpRg1`(+wA$0|1;(Q!~Qy{V6{s}P$1m3xmtP@-QL3rrN9lH)>atDcVBLg}tvZ|3=3D4t(IoA|q3F4Ap>KNctNsekx1 zZlBLn=3DVA1Dla_xAVN&;TQQXyW8y#-5aohLvF77%buU=3Dx+H|4aLl(8)C>uEK(!D!q* zc6~LQ)ooM6MK_#IRLk|7Ni`|1&WoyveO=3D84Hps%Xd|ecMbw6(BO&p4@R>?z>c`Uns zgPT3`tS_I7UuPcpnxCQ7f4NO_Ps@31&$hqmC!j}w009C72oNAZfB*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 z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7e? zehcLLeLSZlK!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+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=3DCV1hTNcc8H1)AV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+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 SfB*pk1PBlyK!Cvh3w#6G^E_Mt literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/images/qcow2_raw-auto.qcow2 b/tests/v= irstoragetestdata/images/qcow2_raw-auto.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..c942c3816af0cd506863cecc456= 691b2418d2863 GIT binary patch literal 196616 zcmeIuO-_SA6ae6XdH|0wXYddvCT?80#xjj0Es!Zj>&j!BxDoo3#)as<9|Y#jyf<&) zd$_&(3Lz}UXS~YkHO1Fc5W>}A2%*>q$ExG(uy(5WeVm%~r}XpU^KoqV5klSMVHcm8 z;gp&mi)EMdOF#T~N15J+l-p_@>uRXts#&Mm0~X6})919^HeDNsT|Zwv(oFr^I@R(1 zCZ=3D}CP1?>JP=3Ds~$zKc1nmfcG`%$4rDlwp+FRQ;cY$1}?!SFiEMKhJ#4IW_J&PecR=3D 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*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UC=3Dn1KK!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&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfWXBI6yb1R zJOls&1PBlyK!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+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly hK!5-N0t5&UAV7cs0RjXF5FkK+009C72oRVAz5&h(F|Yst literal 0 HcmV?d00001 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto b/tests/vi= rstoragetestdata/out/qcow2-qcow2_qcow2-auto new file mode 100644 index 0000000000..e23c43f328 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto @@ -0,0 +1,19 @@ +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 +backingStoreRaw: qcow2 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2 +backingStoreRaw: +capacity: 1024 +encryption: 0 +relPath:qcow2 +type:1 +format:14 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-aut= o b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto new file mode 100644 index 0000000000..17f53f3ed0 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto @@ -0,0 +1,29 @@ +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qco= w2 +backingStoreRaw: qcow2_qcow2-auto.qcow2 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 +backingStoreRaw: qcow2 +capacity: 1024 +encryption: 0 +relPath:qcow2_qcow2-auto.qcow2 +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2 +backingStoreRaw: +capacity: 1024 +encryption: 0 +relPath:qcow2 +type:1 +format:14 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto = b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto new file mode 100644 index 0000000000..1be5a82cc9 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto @@ -0,0 +1,29 @@ +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 +backingStoreRaw: qcow2_raw-auto.qcow2 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-auto.qcow2 +backingStoreRaw: raw +capacity: 1024 +encryption: 0 +relPath:qcow2_raw-auto.qcow2 +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath:raw +type:1 +format:1 +protocol:none +hostname: --=20 2.31.1