mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virstoragetest: Use a pre-formatted QED file for testing backing store extraction
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
55688197ee
commit
325fce82d1
@ -42,7 +42,6 @@ VIR_LOG_INIT("tests.storagetest");
|
|||||||
* raw: 1024-byte raw file
|
* raw: 1024-byte raw file
|
||||||
* qcow2: qcow2 file with 'raw' as backing
|
* qcow2: qcow2 file with 'raw' as backing
|
||||||
* wrap: qcow2 file with 'qcow2' as backing
|
* wrap: qcow2 file with 'qcow2' as backing
|
||||||
* qed: qed file with 'raw' as backing
|
|
||||||
* sub/link1: symlink to qcow2
|
* sub/link1: symlink to qcow2
|
||||||
* sub/link2: symlink to wrap
|
* sub/link2: symlink to wrap
|
||||||
*
|
*
|
||||||
@ -55,7 +54,6 @@ static char *qemuimg;
|
|||||||
static char *absraw;
|
static char *absraw;
|
||||||
static char *absqcow2;
|
static char *absqcow2;
|
||||||
static char *abswrap;
|
static char *abswrap;
|
||||||
static char *absqed;
|
|
||||||
static char *abslink2;
|
static char *abslink2;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -65,7 +63,6 @@ testCleanupImages(void)
|
|||||||
VIR_FREE(absraw);
|
VIR_FREE(absraw);
|
||||||
VIR_FREE(absqcow2);
|
VIR_FREE(absqcow2);
|
||||||
VIR_FREE(abswrap);
|
VIR_FREE(abswrap);
|
||||||
VIR_FREE(absqed);
|
|
||||||
VIR_FREE(abslink2);
|
VIR_FREE(abslink2);
|
||||||
|
|
||||||
if (chdir(abs_builddir) < 0) {
|
if (chdir(abs_builddir) < 0) {
|
||||||
@ -136,7 +133,6 @@ testPrepImages(void)
|
|||||||
absraw = g_strdup_printf("%s/raw", datadir);
|
absraw = g_strdup_printf("%s/raw", datadir);
|
||||||
absqcow2 = g_strdup_printf("%s/qcow2", datadir);
|
absqcow2 = g_strdup_printf("%s/qcow2", datadir);
|
||||||
abswrap = g_strdup_printf("%s/wrap", datadir);
|
abswrap = g_strdup_printf("%s/wrap", datadir);
|
||||||
absqed = g_strdup_printf("%s/qed", datadir);
|
|
||||||
abslink2 = g_strdup_printf("%s/sub/link2", datadir);
|
abslink2 = g_strdup_printf("%s/sub/link2", datadir);
|
||||||
|
|
||||||
if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
|
if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
|
||||||
@ -181,15 +177,6 @@ testPrepImages(void)
|
|||||||
if (virCommandRun(cmd, NULL) < 0)
|
if (virCommandRun(cmd, NULL) < 0)
|
||||||
goto skip;
|
goto skip;
|
||||||
|
|
||||||
/* Create a qed file. */
|
|
||||||
virCommandFree(cmd);
|
|
||||||
cmd = virCommandNewArgList(qemuimg, "create", "-f", "qed", NULL);
|
|
||||||
virCommandAddArgFormat(cmd, "-obacking_file=%s,backing_fmt=raw",
|
|
||||||
absraw);
|
|
||||||
virCommandAddArg(cmd, "qed");
|
|
||||||
if (virCommandRun(cmd, NULL) < 0)
|
|
||||||
goto skip;
|
|
||||||
|
|
||||||
#ifdef WITH_SYMLINK
|
#ifdef WITH_SYMLINK
|
||||||
/* Create some symlinks in a sub-directory. */
|
/* Create some symlinks in a sub-directory. */
|
||||||
if (symlink("../qcow2", datadir "/sub/link1") < 0 ||
|
if (symlink("../qcow2", datadir "/sub/link1") < 0 ||
|
||||||
@ -562,8 +549,12 @@ mymain(void)
|
|||||||
TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_PASS);
|
TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_PASS);
|
||||||
|
|
||||||
/* qed file */
|
/* qed file */
|
||||||
TEST_CHAIN("qed-qed_raw", absqed, VIR_STORAGE_FILE_QED, EXP_PASS);
|
TEST_CHAIN("qed-qed_raw",
|
||||||
TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS);
|
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 */
|
/* directory */
|
||||||
TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
|
TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
|
||||||
|
BIN
tests/virstoragetestdata/images/qed_raw-raw-relative
Normal file
BIN
tests/virstoragetestdata/images/qed_raw-raw-relative
Normal file
Binary file not shown.
BIN
tests/virstoragetestdata/images/raw
Normal file
BIN
tests/virstoragetestdata/images/raw
Normal file
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
path:ABS_BUILDDIR/virstoragedata/qed
|
path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
|
||||||
backingStoreRaw: <null>
|
backingStoreRaw: <null>
|
||||||
capacity: 0
|
capacity: 0
|
||||||
encryption: 0
|
encryption: 0
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
path:ABS_BUILDDIR/virstoragedata/qed
|
path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
|
||||||
backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw
|
backingStoreRaw: raw
|
||||||
capacity: 1024
|
capacity: 1024
|
||||||
encryption: 0
|
encryption: 0
|
||||||
relPath:<null>
|
relPath:<null>
|
||||||
@ -8,11 +8,11 @@ format:15
|
|||||||
protocol:none
|
protocol:none
|
||||||
hostname:<null>
|
hostname:<null>
|
||||||
|
|
||||||
path:ABS_BUILDDIR/virstoragedata/raw
|
path:ABS_SRCDIR/virstoragetestdata/images/raw
|
||||||
backingStoreRaw: <null>
|
backingStoreRaw: <null>
|
||||||
capacity: 0
|
capacity: 0
|
||||||
encryption: 0
|
encryption: 0
|
||||||
relPath:<null>
|
relPath:raw
|
||||||
type:1
|
type:1
|
||||||
format:1
|
format:1
|
||||||
protocol:none
|
protocol:none
|
||||||
|
Loading…
Reference in New Issue
Block a user