[PATCH] qemu: fix nbdkit command test for backing chains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jjongsma@xxxxxxxxxx>
---
 ...sk0 => disk-cdrom-network.args.disk0-src0} |  2 +-
 ...sk1 => disk-cdrom-network.args.disk1-src0} |  2 +-
 ...sk-cdrom-network.args.disk1-src0.pipe.778} |  0
 ...sk2 => disk-cdrom-network.args.disk2-src0} |  2 +-
 ...sk-cdrom-network.args.disk2-src0.pipe.780} |  0
 ...isk0 => disk-network-http.args.disk0-src0} |  2 +-
 ...isk1 => disk-network-http.args.disk1-src0} |  2 +-
 ...isk2 => disk-network-http.args.disk2-src0} |  2 +-
 ...isk-network-http.args.disk2-src0.pipe.778} |  0
 ...isk3 => 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 => disk-network-ssh-key.args.disk0-src0} |  2 +-
 ...1 => 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 => 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 => disk-cdrom-network.args.disk0-src0} (63%)
 rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk1 => disk-cdrom-network.args.disk1-src0} (70%)
 rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk1.pipe.778 => disk-cdrom-network.args.disk1-src0.pipe.778} (100%)
 rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk2 => disk-cdrom-network.args.disk2-src0} (72%)
 rename tests/qemunbdkitdata/{disk-cdrom-network.args.disk2.pipe.780 => disk-cdrom-network.args.disk2-src0.pipe.780} (100%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk0 => disk-network-http.args.disk0-src0} (64%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk1 => disk-network-http.args.disk1-src0} (59%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk2 => disk-network-http.args.disk2-src0} (64%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk2.pipe.778 => disk-network-http.args.disk2-src0.pipe.778} (100%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk3 => disk-network-http.args.disk3-src0} (70%)
 rename tests/qemunbdkitdata/{disk-network-http.args.disk3.pipe.780 => disk-network-http.args.disk3-src0.pipe.780} (100%)
 rename tests/qemunbdkitdata/{disk-network-source-curl-nbdkit-backing.args.disk0 => disk-network-source-curl-nbdkit-backing.args.disk0-src0} (69%)
 rename tests/qemunbdkitdata/{disk-network-source-curl-nbdkit-backing.args.disk0.pipe.778 => disk-network-source-curl-nbdkit-backing.args.disk0-src0.pipe.778} (100%)
 create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src1
 create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src1.pipe.780
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk0 => disk-network-source-curl.args.disk0-src0} (69%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk0.pipe.778 => disk-network-source-curl.args.disk0-src0.pipe.778} (100%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1 => disk-network-source-curl.args.disk1-src0} (75%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1.pipe.780 => disk-network-source-curl.args.disk1-src0.pipe.780} (100%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk1.pipe.782 => disk-network-source-curl.args.disk1-src0.pipe.782} (100%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk2 => disk-network-source-curl.args.disk2-src0} (69%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk2.pipe.784 => disk-network-source-curl.args.disk2-src0.pipe.784} (100%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk3 => disk-network-source-curl.args.disk3-src0} (64%)
 rename tests/qemunbdkitdata/{disk-network-source-curl.args.disk4 => disk-network-source-curl.args.disk4-src0} (65%)
 rename tests/qemunbdkitdata/{disk-network-ssh-key.args.disk0 => disk-network-ssh-key.args.disk0-src0} (74%)
 rename tests/qemunbdkitdata/{disk-network-ssh-key.args.disk1 => disk-network-ssh-key.args.disk1-src0} (73%)
 rename tests/qemunbdkitdata/{disk-network-ssh-password.args.disk0 => disk-network-ssh-password.args.disk0-src0} (71%)
 rename tests/qemunbdkitdata/{disk-network-ssh-password.args.disk0.pipe.778 => disk-network-ssh-password.args.disk0-src0.pipe.778} (100%)
 rename tests/qemunbdkitdata/{disk-network-ssh.args.disk0 => disk-network-ssh.args.disk0-src0} (66%)

diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk0 b/tests/qemunbdkitdata/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=ftp \
diff --git a/tests/qemunbdkitdata/disk-cdrom-network.args.disk1 b/tests/qemunbdkitdata/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=ftps \
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/qemunbdkitdata/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=https \
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/qemunbdkitdata/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=http,https \
 url=http://example.org:80/test.img \
diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk1 b/tests/qemunbdkitdata/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=https \
 url=https://example.org:443/test2.img
diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk2 b/tests/qemunbdkitdata/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=http,https \
 url=http://example.org:1234/test3.img \
diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk2.pipe.778 b/tests/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/qemunbdkitdata/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=https \
 'url=https://example.org:1234/test4.img?par=val&other=ble' \
diff --git a/tests/qemunbdkitdata/disk-network-http.args.disk3.pipe.780 b/tests/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.args.disk0 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src0
similarity index 69%
rename from tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.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.disk0
+++ b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.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=https \
diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0.pipe.778 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src0.pipe.778
similarity index 100%
rename from tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.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.args.disk0-src1 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src1
new file mode 100644
index 0000000000..f9e2d8b86f
--- /dev/null
+++ b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src1
@@ -0,0 +1,7 @@
+nbdkit \
+--unix /tmp/domain-QEMUGuest1/nbdkit-disk0-src1.socket \
+--foreground \
+--readonly curl \
+protocols=https \
+url=https://https.example2.org:8444/path/to/backing.qcow2 \
+cookie=-779
diff --git a/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0-src1.pipe.780 b/tests/qemunbdkitdata/disk-network-source-curl-nbdkit-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.disk0-src1.pipe.780
@@ -0,0 +1 @@
+cookie3=cookievalue3; cookie4=cookievalue4
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk0 b/tests/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=https \
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.778
rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk0-src0.pipe.778
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk1 b/tests/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=https \
 'url=https://https.example.org:8443/path/to/disk5.iso?foo=bar' \
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.780
rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pipe.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.782
rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk1-src0.pipe.782
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk2 b/tests/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=http,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.784
rename to tests/qemunbdkitdata/disk-network-source-curl.args.disk2-src0.pipe.784
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk3 b/tests/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=ftp \
diff --git a/tests/qemunbdkitdata/disk-network-source-curl.args.disk4 b/tests/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=ftps \
diff --git a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk0 b/tests/qemunbdkitdata/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=/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=example.org \
 port=2222 \
diff --git a/tests/qemunbdkitdata/disk-network-ssh-key.args.disk1 b/tests/qemunbdkitdata/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=example.org \
 port=2222 \
diff --git a/tests/qemunbdkitdata/disk-network-ssh-password.args.disk0 b/tests/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=example.org \
 port=2222 \
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.pipe.778
diff --git a/tests/qemunbdkitdata/disk-network-ssh.args.disk0 b/tests/qemunbdkitdata/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=example.org \
 port=2222 \
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 = data;
     g_autoptr(virDomainDef) def = NULL;
     size_t i;
+    size_t n;
     int ret = 0;
+    virStorageSource *backing = NULL;
+    g_autofree char *statedir = NULL;
 
     /* restart mock pipe fds so tests are consistent */
     mockpipefd = PIPE_FD_START;
@@ -189,56 +192,61 @@ testNbdkit(const void *data)
                                       VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         return -1;
 
+    statedir = g_strdup_printf("/tmp/domain-%s", def->name);
     for (i = 0; i < def->ndisks; i++) {
         virDomainDiskDef *disk = def->disks[i];
-        g_autofree char *statedir = g_strdup_printf("/tmp/statedir-%zi", i);
-        g_autofree char *alias = g_strdup_printf("test-disk-%zi", i);
-        g_autofree char *cmdfile = g_strdup_printf("%s.args.disk%zi",
-                                                   info->outtemplate, i);
-
-        if (qemuNbdkitInitStorageSource(info->nbdkitcaps, disk->src, statedir,
-                                        alias, 101, 101)) {
-            qemuDomainStorageSourcePrivate *srcPriv =
-                qemuDomainStorageSourcePrivateFetch(disk->src);
-            g_autoptr(virCommand) cmd = NULL;
-            g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
-            g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-            g_autofree char *actualCmdline = NULL;
-            virCommandSendBuffer *sendbuffers;
-            int nsendbuffers;
-            size_t j;
-
-            virCommandSetDryRun(dryRunToken, &buf, true, true, NULL, NULL);
-            cmd = qemuNbdkitProcessBuildCommand(srcPriv->nbdkitProcess);
-
-            if (virCommandRun(cmd, NULL) < 0) {
-                ret = -1;
-                continue;
-            }
-            virCommandPeekSendBuffers(cmd, &sendbuffers, &nsendbuffers);
-
-            if (!(actualCmdline = virBufferContentAndReset(&buf))) {
-                ret = -1;
-                continue;
-            }
+        for (n = 0, backing = disk->src; backing != NULL; n++, backing = backing->backingStore) {
+            g_autofree char *alias = g_strdup_printf("disk%zi-src%zi", i, n);
+            g_autofree char *cmdfile = g_strdup_printf("%s.args.%s",
+                                                       info->outtemplate, alias);
+
+            if (qemuNbdkitInitStorageSource(info->nbdkitcaps, backing, statedir,
+                                            alias, 101, 101)) {
+                qemuDomainStorageSourcePrivate *srcPriv =
+                    qemuDomainStorageSourcePrivateFetch(backing);
+                g_autoptr(virCommand) cmd = NULL;
+                g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
+                g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
+                g_autofree char *actualCmdline = NULL;
+                virCommandSendBuffer *sendbuffers;
+                int nsendbuffers;
+                size_t j;
+
+                if (srcPriv->nbdkitProcess == NULL)
+                    continue;
+
+                virCommandSetDryRun(dryRunToken, &buf, true, true, NULL, NULL);
+                cmd = qemuNbdkitProcessBuildCommand(srcPriv->nbdkitProcess);
+
+                if (virCommandRun(cmd, NULL) < 0) {
+                    ret = -1;
+                    continue;
+                }
+                virCommandPeekSendBuffers(cmd, &sendbuffers, &nsendbuffers);
 
-            if (virTestCompareToFileFull(actualCmdline, cmdfile, false) < 0)
-                ret = -1;
+                if (!(actualCmdline = virBufferContentAndReset(&buf))) {
+                    ret = -1;
+                    continue;
+                }
 
-            for (j = 0; j < nsendbuffers; j++) {
-                virCommandSendBuffer *buffer = &sendbuffers[j];
-                g_autofree char *pipefile = g_strdup_printf("%s.pipe.%i",
-                                                            cmdfile,
-                                                            buffer->fd);
+                if (virTestCompareToFileFull(actualCmdline, cmdfile, false) < 0)
+                    ret = -1;
 
-                if (virTestCompareToFile((const char*)buffer->buffer, pipefile) < 0)
+                for (j = 0; j < nsendbuffers; j++) {
+                    virCommandSendBuffer *buffer = &sendbuffers[j];
+                    g_autofree char *pipefile = g_strdup_printf("%s.pipe.%i",
+                                                                cmdfile,
+                                                                buffer->fd);
+
+                    if (virTestCompareToFile((const char*)buffer->buffer, pipefile) < 0)
+                        ret = -1;
+                }
+            } else {
+                if (virFileExists(cmdfile)) {
+                    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                   "qemuNbdkitInitStorageSource() was not expected to fail");
                     ret = -1;
-            }
-        } else {
-            if (virFileExists(cmdfile)) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               "qemuNbdkitInitStorageSource() was not expected to fail");
-                ret = -1;
+                }
             }
         }
     }
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux