[PATCH 07/24] virstoragetest: Test backing chain loops with hardcoded images

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

 



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 <pkrempa@xxxxxxxxxx>
---
 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 = \
   (\.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 = \
-  (^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 = \
   (^(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_PASS);
 #endif

-    /* Rewrite qcow2 to be a self-referential loop */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-F", "qcow2", "-b", "qcow2", "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
-    /* Behavior of an infinite loop chain */
-    TEST_CHAIN("qcow2-qcow2_infinite-self", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
-
-    /* Rewrite wrap and qcow2 to be mutually-referential loop */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-F", "qcow2", "-b", "wrap", "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-F", "qcow2", "-b", absqcow2, "wrap", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
     /* Behavior of an infinite loop chain */
-    TEST_CHAIN("qcow2-qcow2_infinite-mutual", abswrap, VIR_STORAGE_FILE_QCOW2, 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/virstoragetestdata/images/loop-1.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..21b0bb8d8749647b3de277175de0611d070b9ee8
GIT binary patch
literal 196616
zcmeIvF;2rU6aY{sEgJ(z$czL-4}pZl!o(cfAR?6{q^U}nI11<C7@Pu$1-G;y1_FCu
zBHKUtKX&|ld3OFDLKwvsuk<K(hq0~45S};vx=S|EwrczI`R=Ra*I*no%`W@eAHT%-
z;C@=KCNa1jy<NrWpF)_GZP#blWw$FG9+PR^w#%mb?-yzD&=qZ!&$C(H<=IU+F9sJF
zP3ya+Ef$NiuClIghO0vuujj93#Vos+WJT4rWw97oAPMvQvCrD#W?C<+Zm4uKOB$lg
zUEcgzxLq?%+I*G$*z>^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(=G`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/virstoragetestdata/images/loop-2.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..3e2e020b5a3ac98516e4a5fc557fbe5aa7e89d39
GIT binary patch
literal 196616
zcmeIvF;2rU6aY{sg^htDWJUrB4uOQk!o(cfAR@I%NK-+WI11<C7@Pu$1-G<R3<UPR
zM7DqOf9&}A>ips(gfNONUg=@%4q{u5A-t^mWtXg?b=CUm>)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=TVo
zndQx&h3hrbq|G0)AA277n{8@Z*Uj<i$>w;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/virstoragetestdata/images/loop-self.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..c8f5927bed91990513b7d2acacbda043602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WMO-cSIH6}K!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
V5FkK+009C72oNAZfWVOmyaSe$I|%>)

literal 0
HcmV?d00001

-- 
2.31.1




[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