From nobody Fri Dec 27 00:23:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1706309320139936.3295875002079; Fri, 26 Jan 2024 14:48:40 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id ACA4C1A68; Fri, 26 Jan 2024 17:48:38 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C53A61A62; Fri, 26 Jan 2024 17:44:12 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3C99A1A5C; Fri, 26 Jan 2024 17:44:09 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6C2A11A53 for ; Fri, 26 Jan 2024 17:44:05 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-fNHOw15aPOeZH6pmexrOKA-1; Fri, 26 Jan 2024 17:44:02 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2461185A780 for ; Fri, 26 Jan 2024 22:44:01 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.8.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D0F22028CD2 for ; Fri, 26 Jan 2024 22:44:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: fNHOw15aPOeZH6pmexrOKA-1 From: Jonathon Jongsma To: devel@lists.libvirt.org Subject: [PATCH] qemu: fix nbdkit command test for backing chains Date: Fri, 26 Jan 2024 16:44:00 -0600 Message-ID: <20240126224400.1352605-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: RBFAZOQTWGBZ24H5D5MHCWKLSJZNDTBY X-Message-ID-Hash: RBFAZOQTWGBZ24H5D5MHCWKLSJZNDTBY X-MailFrom: jjongsma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706309321908100001 Previously this test only tested the generated nbdkit command for the top level disk source. Update it to test the generated commmands for all sources in the chain. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- ...sk0 =3D> disk-cdrom-network.args.disk0-src0} | 2 +- ...sk1 =3D> disk-cdrom-network.args.disk1-src0} | 2 +- ...sk-cdrom-network.args.disk1-src0.pipe.778} | 0 ...sk2 =3D> disk-cdrom-network.args.disk2-src0} | 2 +- ...sk-cdrom-network.args.disk2-src0.pipe.780} | 0 ...isk0 =3D> disk-network-http.args.disk0-src0} | 2 +- ...isk1 =3D> disk-network-http.args.disk1-src0} | 2 +- ...isk2 =3D> disk-network-http.args.disk2-src0} | 2 +- ...isk-network-http.args.disk2-src0.pipe.778} | 0 ...isk3 =3D> disk-network-http.args.disk3-src0} | 2 +- ...isk-network-http.args.disk3-src0.pipe.780} | 0 ...ource-curl-nbdkit-backing.args.disk0-src0} | 2 +- ...l-nbdkit-backing.args.disk0-src0.pipe.778} | 0 ...source-curl-nbdkit-backing.args.disk0-src1 | 7 ++ ...rl-nbdkit-backing.args.disk0-src1.pipe.780 | 1 + ... disk-network-source-curl.args.disk0-src0} | 2 +- ...work-source-curl.args.disk0-src0.pipe.778} | 0 ... disk-network-source-curl.args.disk1-src0} | 2 +- ...work-source-curl.args.disk1-src0.pipe.780} | 0 ...work-source-curl.args.disk1-src0.pipe.782} | 0 ... disk-network-source-curl.args.disk2-src0} | 2 +- ...work-source-curl.args.disk2-src0.pipe.784} | 0 ... disk-network-source-curl.args.disk3-src0} | 2 +- ... disk-network-source-curl.args.disk4-src0} | 2 +- ...0 =3D> disk-network-ssh-key.args.disk0-src0} | 2 +- ...1 =3D> disk-network-ssh-key.args.disk1-src0} | 2 +- ...disk-network-ssh-password.args.disk0-src0} | 2 +- ...ork-ssh-password.args.disk0-src0.pipe.778} | 0 ...disk0 =3D> disk-network-ssh.args.disk0-src0} | 2 +- tests/qemunbdkittest.c | 96 ++++++++++--------- 30 files changed, 77 insertions(+), 61 deletions(-) rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk0 =3D> disk-cdrom= -network.args.disk0-src0} (63%) rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk1 =3D> disk-cdrom= -network.args.disk1-src0} (70%) rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk1.pipe.778 =3D> d= isk-cdrom-network.args.disk1-src0.pipe.778} (100%) rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk2 =3D> disk-cdrom= -network.args.disk2-src0} (72%) rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk2.pipe.780 =3D> d= isk-cdrom-network.args.disk2-src0.pipe.780} (100%) rename tests/qemunbdkitdata/{disk-network-http.args.disk0 =3D> disk-networ= k-http.args.disk0-src0} (64%) rename tests/qemunbdkitdata/{disk-network-http.args.disk1 =3D> disk-networ= k-http.args.disk1-src0} (59%) rename tests/qemunbdkitdata/{disk-network-http.args.disk2 =3D> disk-networ= k-http.args.disk2-src0} (64%) rename tests/qemunbdkitdata/{disk-network-http.args.disk2.pipe.778 =3D> di= sk-network-http.args.disk2-src0.pipe.778} (100%) rename tests/qemunbdkitdata/{disk-network-http.args.disk3 =3D> disk-networ= k-http.args.disk3-src0} (70%) rename tests/qemunbdkitdata/{disk-network-http.args.disk3.pipe.780 =3D> di= sk-network-http.args.disk3-src0.pipe.780} (100%) rename tests/qemunbdkitdata/{disk-network-source-curl-nbdkit-backing.args.= disk0 =3D> disk-network-source-curl-nbdkit-backing.args.disk0-src0} (69%) rename tests/qemunbdkitdata/{disk-network-source-curl-nbdkit-backing.args.= disk0.pipe.778 =3D> disk-network-source-curl-nbdkit-backing.args.disk0-src0= .pipe.778} (100%) create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-ba= cking.args.disk0-src1 create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-ba= cking.args.disk0-src1.pipe.780 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk0 =3D> disk= -network-source-curl.args.disk0-src0} (69%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk0.pipe.778 = =3D> disk-network-source-curl.args.disk0-src0.pipe.778} (100%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1 =3D> disk= -network-source-curl.args.disk1-src0} (75%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1.pipe.780 = =3D> disk-network-source-curl.args.disk1-src0.pipe.780} (100%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1.pipe.782 = =3D> disk-network-source-curl.args.disk1-src0.pipe.782} (100%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk2 =3D> disk= -network-source-curl.args.disk2-src0} (69%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk2.pipe.784 = =3D> disk-network-source-curl.args.disk2-src0.pipe.784} (100%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk3 =3D> disk= -network-source-curl.args.disk3-src0} (64%) rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk4 =3D> disk= -network-source-curl.args.disk4-src0} (65%) rename tests/qemunbdkitdata/{disk-network-ssh-key.args.disk0 =3D> disk-net= work-ssh-key.args.disk0-src0} (74%) rename tests/qemunbdkitdata/{disk-network-ssh-key.args.disk1 =3D> disk-net= work-ssh-key.args.disk1-src0} (73%) rename tests/qemunbdkitdata/{disk-network-ssh-password.args.disk0 =3D> dis= k-network-ssh-password.args.disk0-src0} (71%) rename tests/qemunbdkitdata/{disk-network-ssh-password.args.disk0.pipe.778= =3D> disk-network-ssh-password.args.disk0-src0.pipe.778} (100%) rename tests/qemunbdkitdata/{disk-network-ssh.args.disk0 =3D> disk-network= -ssh.args.disk0-src0} (66%) diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk0 b/tests/qem= unbdkitdata/disk-cdrom-network.args.disk0-src0 similarity index 63% rename from tests/qemunbdkitdata/disk-cdrom-network.args.disk0 rename to tests/qemunbdkitdata/disk-cdrom-network.args.disk0-src0 index b2f3be4cba..cec0c758cd 100644 --- a/tests/qemunbdkitdata/disk-cdrom-network.args.disk0 +++ b/tests/qemunbdkitdata/disk-cdrom-network.args.disk0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground \ --readonly curl \ protocols=3Dftp \ diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk1 b/tests/qem= unbdkitdata/disk-cdrom-network.args.disk1-src0 similarity index 70% rename from tests/qemunbdkitdata/disk-cdrom-network.args.disk1 rename to tests/qemunbdkitdata/disk-cdrom-network.args.disk1-src0 index a23f6573d6..62368ac3e6 100644 --- a/tests/qemunbdkitdata/disk-cdrom-network.args.disk1 +++ b/tests/qemunbdkitdata/disk-cdrom-network.args.disk1-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-1/nbdkit-test-disk-1.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk1-src0.socket \ --foreground \ --readonly curl \ protocols=3Dftps \ diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk1.pipe.778 b/= tests/qemunbdkitdata/disk-cdrom-network.args.disk1-src0.pipe.778 similarity index 100% rename from tests/qemunbdkitdata/disk-cdrom-network.args.disk1.pipe.778 rename to tests/qemunbdkitdata/disk-cdrom-network.args.disk1-src0.pipe.778 diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk2 b/tests/qem= unbdkitdata/disk-cdrom-network.args.disk2-src0 similarity index 72% rename from tests/qemunbdkitdata/disk-cdrom-network.args.disk2 rename to tests/qemunbdkitdata/disk-cdrom-network.args.disk2-src0 index 04e918609a..70bfa39252 100644 --- a/tests/qemunbdkitdata/disk-cdrom-network.args.disk2 +++ b/tests/qemunbdkitdata/disk-cdrom-network.args.disk2-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-2/nbdkit-test-disk-2.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk2-src0.socket \ --foreground \ --readonly curl \ protocols=3Dhttps \ diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk2.pipe.780 b/= tests/qemunbdkitdata/disk-cdrom-network.args.disk2-src0.pipe.780 similarity index 100% rename from tests/qemunbdkitdata/disk-cdrom-network.args.disk2.pipe.780 rename to tests/qemunbdkitdata/disk-cdrom-network.args.disk2-src0.pipe.780 diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk0 b/tests/qemu= nbdkitdata/disk-network-http.args.disk0-src0 similarity index 64% rename from tests/qemunbdkitdata/disk-network-http.args.disk0 rename to tests/qemunbdkitdata/disk-network-http.args.disk0-src0 index 8316f353cb..a850610593 100644 --- a/tests/qemunbdkitdata/disk-network-http.args.disk0 +++ b/tests/qemunbdkitdata/disk-network-http.args.disk0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground curl \ protocols=3Dhttp,https \ url=3Dhttp://example.org:80/test.img \ diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk1 b/tests/qemu= nbdkitdata/disk-network-http.args.disk1-src0 similarity index 59% rename from tests/qemunbdkitdata/disk-network-http.args.disk1 rename to tests/qemunbdkitdata/disk-network-http.args.disk1-src0 index a546a68b27..0864840e41 100644 --- a/tests/qemunbdkitdata/disk-network-http.args.disk1 +++ b/tests/qemunbdkitdata/disk-network-http.args.disk1-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-1/nbdkit-test-disk-1.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk1-src0.socket \ --foreground curl \ protocols=3Dhttps \ url=3Dhttps://example.org:443/test2.img diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk2 b/tests/qemu= nbdkitdata/disk-network-http.args.disk2-src0 similarity index 64% rename from tests/qemunbdkitdata/disk-network-http.args.disk2 rename to tests/qemunbdkitdata/disk-network-http.args.disk2-src0 index 1004547b3a..359767f20c 100644 --- a/tests/qemunbdkitdata/disk-network-http.args.disk2 +++ b/tests/qemunbdkitdata/disk-network-http.args.disk2-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-2/nbdkit-test-disk-2.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk2-src0.socket \ --foreground curl \ protocols=3Dhttp,https \ url=3Dhttp://example.org:1234/test3.img \ diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk2.pipe.778 b/t= ests/qemunbdkitdata/disk-network-http.args.disk2-src0.pipe.778 similarity index 100% rename from tests/qemunbdkitdata/disk-network-http.args.disk2.pipe.778 rename to tests/qemunbdkitdata/disk-network-http.args.disk2-src0.pipe.778 diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk3 b/tests/qemu= nbdkitdata/disk-network-http.args.disk3-src0 similarity index 70% rename from tests/qemunbdkitdata/disk-network-http.args.disk3 rename to tests/qemunbdkitdata/disk-network-http.args.disk3-src0 index e3c357b89a..6f2fa96b63 100644 --- a/tests/qemunbdkitdata/disk-network-http.args.disk3 +++ b/tests/qemunbdkitdata/disk-network-http.args.disk3-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-3/nbdkit-test-disk-3.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk3-src0.socket \ --foreground curl \ protocols=3Dhttps \ 'url=3Dhttps://example.org:1234/test4.img?par=3Dval&other=3Dble' \ diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk3.pipe.780 b/t= ests/qemunbdkitdata/disk-network-http.args.disk3-src0.pipe.780 similarity index 100% rename from tests/qemunbdkitdata/disk-network-http.args.disk3.pipe.780 rename to tests/qemunbdkitdata/disk-network-http.args.disk3-src0.pipe.780 diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.a= rgs.disk0 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.ar= gs.disk0-src0 similarity index 69% rename from tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.ar= gs.disk0 rename to tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args= .disk0-src0 index 605354433b..ea54fb56d0 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.dis= k0 +++ b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.dis= k0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground \ --readonly curl \ protocols=3Dhttps \ diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.a= rgs.disk0.pipe.778 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-b= acking.args.disk0-src0.pipe.778 similarity index 100% rename from tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.ar= gs.disk0.pipe.778 rename to tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args= .disk0-src0.pipe.778 diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.a= rgs.disk0-src1 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backi= ng.args.disk0-src1 new file mode 100644 index 0000000000..f9e2d8b86f --- /dev/null +++ b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.dis= k0-src1 @@ -0,0 +1,7 @@ +nbdkit \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src1.socket \ +--foreground \ +--readonly curl \ +protocols=3Dhttps \ +url=3Dhttps://https.example2.org:8444/path/to/backing.qcow2 \ +cookie=3D-779 diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.a= rgs.disk0-src1.pipe.780 b/tests/qemunbdkitdata/disk-network-source-curl-nbd= kit-backing.args.disk0-src1.pipe.780 new file mode 100644 index 0000000000..0aafdfb733 --- /dev/null +++ b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.dis= k0-src1.pipe.780 @@ -0,0 +1 @@ +cookie3=3Dcookievalue3; cookie4=3Dcookievalue4 diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk0 b/tes= ts/qemunbdkitdata/disk-network-source-curl.args.disk0-src0 similarity index 69% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk0 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk0-src0 index 948dbfbe5a..ff3b06760d 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl.args.disk0 +++ b/tests/qemunbdkitdata/disk-network-source-curl.args.disk0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground \ --readonly curl \ protocols=3Dhttps \ diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk0.pipe.= 778 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk0-src0.pipe.778 similarity index 100% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk0.pipe.7= 78 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk0-src0.pip= e.778 diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1 b/tes= ts/qemunbdkitdata/disk-network-source-curl.args.disk1-src0 similarity index 75% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk1 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0 index d1288dd242..972b07b0e2 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1 +++ b/tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-1/nbdkit-test-disk-1.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk1-src0.socket \ --foreground curl \ protocols=3Dhttps \ 'url=3Dhttps://https.example.org:8443/path/to/disk5.iso?foo=3Dbar' \ diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.= 780 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pipe.780 similarity index 100% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.7= 80 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pip= e.780 diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.= 782 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pipe.782 similarity index 100% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.7= 82 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pip= e.782 diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk2 b/tes= ts/qemunbdkitdata/disk-network-source-curl.args.disk2-src0 similarity index 69% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk2 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk2-src0 index f1d0e1929e..6cfa70ad36 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl.args.disk2 +++ b/tests/qemunbdkitdata/disk-network-source-curl.args.disk2-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-2/nbdkit-test-disk-2.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk2-src0.socket \ --foreground \ --readonly curl \ protocols=3Dhttp,https \ diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.= 784 b/tests/qemunbdkitdata/disk-network-source-curl.args.disk2-src0.pipe.784 similarity index 100% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.7= 84 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk2-src0.pip= e.784 diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk3 b/tes= ts/qemunbdkitdata/disk-network-source-curl.args.disk3-src0 similarity index 64% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk3 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk3-src0 index f517baa948..2377d2e41b 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl.args.disk3 +++ b/tests/qemunbdkitdata/disk-network-source-curl.args.disk3-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-3/nbdkit-test-disk-3.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk3-src0.socket \ --foreground \ --readonly curl \ protocols=3Dftp \ diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk4 b/tes= ts/qemunbdkitdata/disk-network-source-curl.args.disk4-src0 similarity index 65% rename from tests/qemunbdkitdata/disk-network-source-curl.args.disk4 rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk4-src0 index 1df47a9d54..584c30bee9 100644 --- a/tests/qemunbdkitdata/disk-network-source-curl.args.disk4 +++ b/tests/qemunbdkitdata/disk-network-source-curl.args.disk4-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-4/nbdkit-test-disk-4.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk4-src0.socket \ --foreground \ --readonly curl \ protocols=3Dftps \ diff --git a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk0 b/tests/q= emunbdkitdata/disk-network-ssh-key.args.disk0-src0 similarity index 74% rename from tests/qemunbdkitdata/disk-network-ssh-key.args.disk0 rename to tests/qemunbdkitdata/disk-network-ssh-key.args.disk0-src0 index f627700490..e16f2ca0c4 100644 --- a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk0 +++ b/tests/qemunbdkitdata/disk-network-ssh-key.args.disk0-src0 @@ -1,6 +1,6 @@ SSH_AUTH_SOCK=3D/path/to/agent/socket \ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground ssh \ host=3Dexample.org \ port=3D2222 \ diff --git a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk1 b/tests/q= emunbdkitdata/disk-network-ssh-key.args.disk1-src0 similarity index 73% rename from tests/qemunbdkitdata/disk-network-ssh-key.args.disk1 rename to tests/qemunbdkitdata/disk-network-ssh-key.args.disk1-src0 index 80df9c30c6..fbac8313d7 100644 --- a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk1 +++ b/tests/qemunbdkitdata/disk-network-ssh-key.args.disk1-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-1/nbdkit-test-disk-1.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk1-src0.socket \ --foreground ssh \ host=3Dexample.org \ port=3D2222 \ diff --git a/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0 b/te= sts/qemunbdkitdata/disk-network-ssh-password.args.disk0-src0 similarity index 71% rename from tests/qemunbdkitdata/disk-network-ssh-password.args.disk0 rename to tests/qemunbdkitdata/disk-network-ssh-password.args.disk0-src0 index ee2d7c3343..0da07e19f4 100644 --- a/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0 +++ b/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground ssh \ host=3Dexample.org \ port=3D2222 \ diff --git a/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0.pipe= .778 b/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0-src0.pipe.= 778 similarity index 100% rename from tests/qemunbdkitdata/disk-network-ssh-password.args.disk0.pipe.= 778 rename to tests/qemunbdkitdata/disk-network-ssh-password.args.disk0-src0.pi= pe.778 diff --git a/tests/qemunbdkitdata/disk-network-ssh.args.disk0 b/tests/qemun= bdkitdata/disk-network-ssh.args.disk0-src0 similarity index 66% rename from tests/qemunbdkitdata/disk-network-ssh.args.disk0 rename to tests/qemunbdkitdata/disk-network-ssh.args.disk0-src0 index 481b218936..2c8f54d5ce 100644 --- a/tests/qemunbdkitdata/disk-network-ssh.args.disk0 +++ b/tests/qemunbdkitdata/disk-network-ssh.args.disk0-src0 @@ -1,5 +1,5 @@ nbdkit \ ---unix /tmp/statedir-0/nbdkit-test-disk-0.socket \ +--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src0.socket \ --foreground ssh \ host=3Dexample.org \ port=3D2222 \ diff --git a/tests/qemunbdkittest.c b/tests/qemunbdkittest.c index 3f6bd09616..d0332a8e9f 100644 --- a/tests/qemunbdkittest.c +++ b/tests/qemunbdkittest.c @@ -174,7 +174,10 @@ testNbdkit(const void *data) const TestInfo *info =3D data; g_autoptr(virDomainDef) def =3D NULL; size_t i; + size_t n; int ret =3D 0; + virStorageSource *backing =3D NULL; + g_autofree char *statedir =3D NULL; =20 /* restart mock pipe fds so tests are consistent */ mockpipefd =3D PIPE_FD_START; @@ -189,56 +192,61 @@ testNbdkit(const void *data) VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) return -1; =20 + statedir =3D g_strdup_printf("/tmp/domain-%s", def->name); for (i =3D 0; i < def->ndisks; i++) { virDomainDiskDef *disk =3D def->disks[i]; - g_autofree char *statedir =3D g_strdup_printf("/tmp/statedir-%zi",= i); - g_autofree char *alias =3D g_strdup_printf("test-disk-%zi", i); - g_autofree char *cmdfile =3D g_strdup_printf("%s.args.disk%zi", - info->outtemplate, i); - - if (qemuNbdkitInitStorageSource(info->nbdkitcaps, disk->src, state= dir, - alias, 101, 101)) { - qemuDomainStorageSourcePrivate *srcPriv =3D - qemuDomainStorageSourcePrivateFetch(disk->src); - g_autoptr(virCommand) cmd =3D NULL; - g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDry= RunTokenNew(); - g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - g_autofree char *actualCmdline =3D NULL; - virCommandSendBuffer *sendbuffers; - int nsendbuffers; - size_t j; - - virCommandSetDryRun(dryRunToken, &buf, true, true, NULL, NULL); - cmd =3D qemuNbdkitProcessBuildCommand(srcPriv->nbdkitProcess); - - if (virCommandRun(cmd, NULL) < 0) { - ret =3D -1; - continue; - } - virCommandPeekSendBuffers(cmd, &sendbuffers, &nsendbuffers); - - if (!(actualCmdline =3D virBufferContentAndReset(&buf))) { - ret =3D -1; - continue; - } + for (n =3D 0, backing =3D disk->src; backing !=3D NULL; n++, backi= ng =3D backing->backingStore) { + g_autofree char *alias =3D g_strdup_printf("disk%zi-src%zi", i= , n); + g_autofree char *cmdfile =3D g_strdup_printf("%s.args.%s", + info->outtemplate, = alias); + + if (qemuNbdkitInitStorageSource(info->nbdkitcaps, backing, sta= tedir, + alias, 101, 101)) { + qemuDomainStorageSourcePrivate *srcPriv =3D + qemuDomainStorageSourcePrivateFetch(backing); + g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommandDryRunToken) dryRunToken =3D virComman= dDryRunTokenNew(); + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *actualCmdline =3D NULL; + virCommandSendBuffer *sendbuffers; + int nsendbuffers; + size_t j; + + if (srcPriv->nbdkitProcess =3D=3D NULL) + continue; + + virCommandSetDryRun(dryRunToken, &buf, true, true, NULL, N= ULL); + cmd =3D qemuNbdkitProcessBuildCommand(srcPriv->nbdkitProce= ss); + + if (virCommandRun(cmd, NULL) < 0) { + ret =3D -1; + continue; + } + virCommandPeekSendBuffers(cmd, &sendbuffers, &nsendbuffers= ); =20 - if (virTestCompareToFileFull(actualCmdline, cmdfile, false) < = 0) - ret =3D -1; + if (!(actualCmdline =3D virBufferContentAndReset(&buf))) { + ret =3D -1; + continue; + } =20 - for (j =3D 0; j < nsendbuffers; j++) { - virCommandSendBuffer *buffer =3D &sendbuffers[j]; - g_autofree char *pipefile =3D g_strdup_printf("%s.pipe.%i", - cmdfile, - buffer->fd); + if (virTestCompareToFileFull(actualCmdline, cmdfile, false= ) < 0) + ret =3D -1; =20 - if (virTestCompareToFile((const char*)buffer->buffer, pipe= file) < 0) + for (j =3D 0; j < nsendbuffers; j++) { + virCommandSendBuffer *buffer =3D &sendbuffers[j]; + g_autofree char *pipefile =3D g_strdup_printf("%s.pipe= .%i", + cmdfile, + buffer->fd= ); + + if (virTestCompareToFile((const char*)buffer->buffer, = pipefile) < 0) + ret =3D -1; + } + } else { + if (virFileExists(cmdfile)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + "qemuNbdkitInitStorageSource() was not = expected to fail"); ret =3D -1; - } - } else { - if (virFileExists(cmdfile)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "qemuNbdkitInitStorageSource() was not expe= cted to fail"); - ret =3D -1; + } } } } --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org