1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

virstoragetest: Use existing directory in the source tree for 'directory' probing tests

We don't need a special directory for the tests. Reuse the directory
holding the data for the virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-09-08 09:03:06 +02:00
parent df94a4e907
commit 55688197ee
4 changed files with 6 additions and 13 deletions

View File

@ -56,7 +56,6 @@ static char *absraw;
static char *absqcow2;
static char *abswrap;
static char *absqed;
static char *absdir;
static char *abslink2;
static void
@ -67,7 +66,6 @@ testCleanupImages(void)
VIR_FREE(absqcow2);
VIR_FREE(abswrap);
VIR_FREE(absqed);
VIR_FREE(absdir);
VIR_FREE(abslink2);
if (chdir(abs_builddir) < 0) {
@ -139,17 +137,12 @@ testPrepImages(void)
absqcow2 = g_strdup_printf("%s/qcow2", datadir);
abswrap = g_strdup_printf("%s/wrap", datadir);
absqed = g_strdup_printf("%s/qed", datadir);
absdir = g_strdup_printf("%s/dir", datadir);
abslink2 = g_strdup_printf("%s/sub/link2", datadir);
if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
fprintf(stderr, "unable to create directory %s\n", datadir "/sub");
goto cleanup;
}
if (g_mkdir_with_parents(datadir "/dir", 0777) < 0) {
fprintf(stderr, "unable to create directory %s\n", datadir "/dir");
goto cleanup;
}
if (chdir(datadir) < 0) {
fprintf(stderr, "unable to test relative backing chains\n");
@ -573,9 +566,9 @@ mymain(void)
TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS);
/* directory */
TEST_CHAIN("directory-raw", absdir, VIR_STORAGE_FILE_RAW, EXP_PASS);
TEST_CHAIN("directory-none", absdir, VIR_STORAGE_FILE_NONE, EXP_PASS);
TEST_CHAIN("directory-dir", absdir, VIR_STORAGE_FILE_DIR, EXP_PASS);
TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
TEST_CHAIN("directory-none", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_NONE, EXP_PASS);
TEST_CHAIN("directory-dir", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_DIR, EXP_PASS);
#ifdef WITH_SYMLINK
/* Rewrite qcow2 and wrap file to use backing names relative to a

View File

@ -1,4 +1,4 @@
path:ABS_BUILDDIR/virstoragedata/dir
path:ABS_SRCDIR/virstoragetestdata/images/
backingStoreRaw: <null>
capacity: 0
encryption: 0

View File

@ -1,4 +1,4 @@
path:ABS_BUILDDIR/virstoragedata/dir
path:ABS_SRCDIR/virstoragetestdata/images/
backingStoreRaw: <null>
capacity: 0
encryption: 0

View File

@ -1,4 +1,4 @@
path:ABS_BUILDDIR/virstoragedata/dir
path:ABS_SRCDIR/virstoragetestdata/images/
backingStoreRaw: <null>
capacity: 0
encryption: 0