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 0000000000..21b0bb8d87 Binary files /dev/null and b/tests/virstoragetestdata/images/loop-1.qcow2 differ diff --git a/tests/virstoragetestdata/images/loop-2.qcow2 b/tests/virstoragetestdata/images/loop-2.qcow2 new file mode 100644 index 0000000000..3e2e020b5a Binary files /dev/null and b/tests/virstoragetestdata/images/loop-2.qcow2 differ diff --git a/tests/virstoragetestdata/images/loop-self.qcow2 b/tests/virstoragetestdata/images/loop-self.qcow2 new file mode 100644 index 0000000000..c8f5927bed Binary files /dev/null and b/tests/virstoragetestdata/images/loop-self.qcow2 differ