mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
tests: storage: Absorb ALLOW_PROBE flag into the TEST_CHAIN macro
The second set of arguments for TEST_CHAIN always specifies the 'ALLOW_PROBE' flag. Make it part of the macro. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
300515b414
commit
67d7d41615
@ -757,7 +757,7 @@ mymain(void)
|
|||||||
#define TEST_CHAIN(path, format, chain1, flags1, chain2, flags2) \
|
#define TEST_CHAIN(path, format, chain1, flags1, chain2, flags2) \
|
||||||
do { \
|
do { \
|
||||||
TEST_ONE_CHAIN(path, format, flags1, VIR_FLATTEN_1(chain1)); \
|
TEST_ONE_CHAIN(path, format, flags1, VIR_FLATTEN_1(chain1)); \
|
||||||
TEST_ONE_CHAIN(path, format, flags2, VIR_FLATTEN_1(chain2)); \
|
TEST_ONE_CHAIN(path, format, ALLOW_PROBE | flags2, VIR_FLATTEN_1(chain2)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* The actual tests, in several groups. */
|
/* The actual tests, in several groups. */
|
||||||
@ -774,10 +774,10 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absraw, VIR_STORAGE_FILE_RAW,
|
TEST_CHAIN(absraw, VIR_STORAGE_FILE_RAW,
|
||||||
(&raw), EXP_PASS,
|
(&raw), EXP_PASS,
|
||||||
(&raw), ALLOW_PROBE | EXP_PASS);
|
(&raw), EXP_PASS);
|
||||||
TEST_CHAIN(absraw, VIR_STORAGE_FILE_AUTO,
|
TEST_CHAIN(absraw, VIR_STORAGE_FILE_AUTO,
|
||||||
(&raw), EXP_PASS,
|
(&raw), EXP_PASS,
|
||||||
(&raw), ALLOW_PROBE | EXP_PASS);
|
(&raw), EXP_PASS);
|
||||||
|
|
||||||
/* Qcow2 file with relative raw backing, format provided */
|
/* Qcow2 file with relative raw backing, format provided */
|
||||||
raw.pathRel = "raw";
|
raw.pathRel = "raw";
|
||||||
@ -795,10 +795,10 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &raw), EXP_PASS,
|
(&qcow2, &raw), EXP_PASS,
|
||||||
(&qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &raw), EXP_PASS);
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO,
|
||||||
(&qcow2_as_raw), EXP_PASS,
|
(&qcow2_as_raw), EXP_PASS,
|
||||||
(&qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &raw), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 file to use absolute backing name */
|
/* Rewrite qcow2 file to use absolute backing name */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -812,10 +812,10 @@ mymain(void)
|
|||||||
/* Qcow2 file with raw as absolute backing, backing format provided */
|
/* Qcow2 file with raw as absolute backing, backing format provided */
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &raw), EXP_PASS,
|
(&qcow2, &raw), EXP_PASS,
|
||||||
(&qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &raw), EXP_PASS);
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_AUTO,
|
||||||
(&qcow2_as_raw), EXP_PASS,
|
(&qcow2_as_raw), EXP_PASS,
|
||||||
(&qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &raw), EXP_PASS);
|
||||||
|
|
||||||
/* Wrapped file access */
|
/* Wrapped file access */
|
||||||
testFileData wrap = {
|
testFileData wrap = {
|
||||||
@ -827,7 +827,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&wrap, &qcow2, &raw), EXP_PASS,
|
(&wrap, &qcow2, &raw), EXP_PASS,
|
||||||
(&wrap, &qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&wrap, &qcow2, &raw), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 and wrap file to omit backing file type */
|
/* Rewrite qcow2 and wrap file to omit backing file type */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -852,7 +852,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&wrap_as_raw, &qcow2_as_raw), EXP_PASS,
|
(&wrap_as_raw, &qcow2_as_raw), EXP_PASS,
|
||||||
(&wrap, &qcow2, &raw), ALLOW_PROBE | EXP_PASS);
|
(&wrap, &qcow2, &raw), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 to a missing backing file, with backing type */
|
/* Rewrite qcow2 to a missing backing file, with backing type */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -866,7 +866,7 @@ mymain(void)
|
|||||||
/* Qcow2 file with missing backing file but specified type */
|
/* Qcow2 file with missing backing file but specified type */
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2), EXP_WARN,
|
(&qcow2), EXP_WARN,
|
||||||
(&qcow2), ALLOW_PROBE | EXP_WARN);
|
(&qcow2), EXP_WARN);
|
||||||
|
|
||||||
/* Rewrite qcow2 to a missing backing file, without backing type */
|
/* Rewrite qcow2 to a missing backing file, without backing type */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -878,7 +878,7 @@ mymain(void)
|
|||||||
/* Qcow2 file with missing backing file and no specified type */
|
/* Qcow2 file with missing backing file and no specified type */
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2), EXP_WARN,
|
(&qcow2), EXP_WARN,
|
||||||
(&qcow2), ALLOW_PROBE | EXP_WARN);
|
(&qcow2), EXP_WARN);
|
||||||
|
|
||||||
/* Rewrite qcow2 to use an nbd: protocol as backend */
|
/* Rewrite qcow2 to use an nbd: protocol as backend */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -899,7 +899,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &nbd), EXP_PASS,
|
(&qcow2, &nbd), EXP_PASS,
|
||||||
(&qcow2, &nbd), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &nbd), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 to use an nbd: protocol as backend */
|
/* Rewrite qcow2 to use an nbd: protocol as backend */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -920,7 +920,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &nbd2), EXP_PASS,
|
(&qcow2, &nbd2), EXP_PASS,
|
||||||
(&qcow2, &nbd2), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &nbd2), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 to use an nbd: protocol without path as backend */
|
/* Rewrite qcow2 to use an nbd: protocol without path as backend */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -934,7 +934,7 @@ mymain(void)
|
|||||||
nbd2.path = NULL;
|
nbd2.path = NULL;
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &nbd2), EXP_PASS,
|
(&qcow2, &nbd2), EXP_PASS,
|
||||||
(&qcow2, &nbd2), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &nbd2), EXP_PASS);
|
||||||
|
|
||||||
/* qed file */
|
/* qed file */
|
||||||
testFileData qed = {
|
testFileData qed = {
|
||||||
@ -951,10 +951,10 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqed, VIR_STORAGE_FILE_QED,
|
TEST_CHAIN(absqed, VIR_STORAGE_FILE_QED,
|
||||||
(&qed, &raw), EXP_PASS,
|
(&qed, &raw), EXP_PASS,
|
||||||
(&qed, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qed, &raw), EXP_PASS);
|
||||||
TEST_CHAIN(absqed, VIR_STORAGE_FILE_AUTO,
|
TEST_CHAIN(absqed, VIR_STORAGE_FILE_AUTO,
|
||||||
(&qed_as_raw), EXP_PASS,
|
(&qed_as_raw), EXP_PASS,
|
||||||
(&qed, &raw), ALLOW_PROBE | EXP_PASS);
|
(&qed, &raw), EXP_PASS);
|
||||||
|
|
||||||
/* directory */
|
/* directory */
|
||||||
testFileData dir = {
|
testFileData dir = {
|
||||||
@ -969,13 +969,13 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absdir, VIR_STORAGE_FILE_RAW,
|
TEST_CHAIN(absdir, VIR_STORAGE_FILE_RAW,
|
||||||
(&dir_as_raw), EXP_PASS,
|
(&dir_as_raw), EXP_PASS,
|
||||||
(&dir_as_raw), ALLOW_PROBE | EXP_PASS);
|
(&dir_as_raw), EXP_PASS);
|
||||||
TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE,
|
TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE,
|
||||||
(&dir), EXP_PASS,
|
(&dir), EXP_PASS,
|
||||||
(&dir), ALLOW_PROBE | EXP_PASS);
|
(&dir), EXP_PASS);
|
||||||
TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR,
|
TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR,
|
||||||
(&dir), EXP_PASS,
|
(&dir), EXP_PASS,
|
||||||
(&dir), ALLOW_PROBE | EXP_PASS);
|
(&dir), EXP_PASS);
|
||||||
|
|
||||||
#ifdef HAVE_SYMLINK
|
#ifdef HAVE_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
|
||||||
@ -1014,7 +1014,7 @@ mymain(void)
|
|||||||
raw.pathRel = "../raw";
|
raw.pathRel = "../raw";
|
||||||
TEST_CHAIN(abslink2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(abslink2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&link2, &link1, &raw), EXP_PASS,
|
(&link2, &link1, &raw), EXP_PASS,
|
||||||
(&link2, &link1, &raw), ALLOW_PROBE | EXP_PASS);
|
(&link2, &link1, &raw), EXP_PASS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Rewrite qcow2 to be a self-referential loop */
|
/* Rewrite qcow2 to be a self-referential loop */
|
||||||
@ -1028,7 +1028,7 @@ mymain(void)
|
|||||||
/* Behavior of an infinite loop chain */
|
/* Behavior of an infinite loop chain */
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2), EXP_WARN,
|
(&qcow2), EXP_WARN,
|
||||||
(&qcow2), ALLOW_PROBE | EXP_WARN);
|
(&qcow2), EXP_WARN);
|
||||||
|
|
||||||
/* Rewrite wrap and qcow2 to be mutually-referential loop */
|
/* Rewrite wrap and qcow2 to be mutually-referential loop */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -1047,7 +1047,7 @@ mymain(void)
|
|||||||
/* Behavior of an infinite loop chain */
|
/* Behavior of an infinite loop chain */
|
||||||
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&wrap, &qcow2), EXP_WARN,
|
(&wrap, &qcow2), EXP_WARN,
|
||||||
(&wrap, &qcow2), ALLOW_PROBE | EXP_WARN);
|
(&wrap, &qcow2), EXP_WARN);
|
||||||
|
|
||||||
/* Rewrite qcow2 to use an rbd: protocol as backend */
|
/* Rewrite qcow2 to use an rbd: protocol as backend */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -1067,7 +1067,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &rbd1), EXP_PASS,
|
(&qcow2, &rbd1), EXP_PASS,
|
||||||
(&qcow2, &rbd1), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &rbd1), EXP_PASS);
|
||||||
|
|
||||||
/* Rewrite qcow2 to use an rbd: protocol as backend */
|
/* Rewrite qcow2 to use an rbd: protocol as backend */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -1089,7 +1089,7 @@ mymain(void)
|
|||||||
};
|
};
|
||||||
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2,
|
||||||
(&qcow2, &rbd2), EXP_PASS,
|
(&qcow2, &rbd2), EXP_PASS,
|
||||||
(&qcow2, &rbd2), ALLOW_PROBE | EXP_PASS);
|
(&qcow2, &rbd2), EXP_PASS);
|
||||||
|
|
||||||
|
|
||||||
/* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */
|
/* Rewrite wrap and qcow2 back to 3-deep chain, absolute backing */
|
||||||
|
Loading…
Reference in New Issue
Block a user