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:
parent
df94a4e907
commit
55688197ee
@ -56,7 +56,6 @@ static char *absraw;
|
|||||||
static char *absqcow2;
|
static char *absqcow2;
|
||||||
static char *abswrap;
|
static char *abswrap;
|
||||||
static char *absqed;
|
static char *absqed;
|
||||||
static char *absdir;
|
|
||||||
static char *abslink2;
|
static char *abslink2;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -67,7 +66,6 @@ testCleanupImages(void)
|
|||||||
VIR_FREE(absqcow2);
|
VIR_FREE(absqcow2);
|
||||||
VIR_FREE(abswrap);
|
VIR_FREE(abswrap);
|
||||||
VIR_FREE(absqed);
|
VIR_FREE(absqed);
|
||||||
VIR_FREE(absdir);
|
|
||||||
VIR_FREE(abslink2);
|
VIR_FREE(abslink2);
|
||||||
|
|
||||||
if (chdir(abs_builddir) < 0) {
|
if (chdir(abs_builddir) < 0) {
|
||||||
@ -139,17 +137,12 @@ testPrepImages(void)
|
|||||||
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);
|
absqed = g_strdup_printf("%s/qed", datadir);
|
||||||
absdir = g_strdup_printf("%s/dir", 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) {
|
||||||
fprintf(stderr, "unable to create directory %s\n", datadir "/sub");
|
fprintf(stderr, "unable to create directory %s\n", datadir "/sub");
|
||||||
goto cleanup;
|
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) {
|
if (chdir(datadir) < 0) {
|
||||||
fprintf(stderr, "unable to test relative backing chains\n");
|
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);
|
TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS);
|
||||||
|
|
||||||
/* directory */
|
/* directory */
|
||||||
TEST_CHAIN("directory-raw", absdir, VIR_STORAGE_FILE_RAW, EXP_PASS);
|
TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
|
||||||
TEST_CHAIN("directory-none", absdir, VIR_STORAGE_FILE_NONE, EXP_PASS);
|
TEST_CHAIN("directory-none", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_NONE, EXP_PASS);
|
||||||
TEST_CHAIN("directory-dir", absdir, VIR_STORAGE_FILE_DIR, EXP_PASS);
|
TEST_CHAIN("directory-dir", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_DIR, EXP_PASS);
|
||||||
|
|
||||||
#ifdef WITH_SYMLINK
|
#ifdef WITH_SYMLINK
|
||||||
/* Rewrite qcow2 and wrap file to use backing names relative to a
|
/* Rewrite qcow2 and wrap file to use backing names relative to a
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
path:ABS_BUILDDIR/virstoragedata/dir
|
path:ABS_SRCDIR/virstoragetestdata/images/
|
||||||
backingStoreRaw: <null>
|
backingStoreRaw: <null>
|
||||||
capacity: 0
|
capacity: 0
|
||||||
encryption: 0
|
encryption: 0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
path:ABS_BUILDDIR/virstoragedata/dir
|
path:ABS_SRCDIR/virstoragetestdata/images/
|
||||||
backingStoreRaw: <null>
|
backingStoreRaw: <null>
|
||||||
capacity: 0
|
capacity: 0
|
||||||
encryption: 0
|
encryption: 0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
path:ABS_BUILDDIR/virstoragedata/dir
|
path:ABS_SRCDIR/virstoragetestdata/images/
|
||||||
backingStoreRaw: <null>
|
backingStoreRaw: <null>
|
||||||
capacity: 0
|
capacity: 0
|
||||||
encryption: 0
|
encryption: 0
|
||||||
|
Loading…
Reference in New Issue
Block a user