mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Use separate macros for failure/success in vol-to-argv test
Reindent them to put the input volume on a separate line.
This commit is contained in:
parent
e4f0a55e79
commit
7064eee95a
@ -161,7 +161,8 @@ mymain(void)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int flags = VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
|
unsigned int flags = VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
|
||||||
|
|
||||||
#define DO_TEST(shouldFail, pool, vol, inputvol, cmdline, flags, imgformat) \
|
#define DO_TEST_FULL(shouldFail, pool, vol, inputvol, cmdline, flags, \
|
||||||
|
imgformat) \
|
||||||
do { \
|
do { \
|
||||||
struct testInfo info = { shouldFail, pool, vol, inputvol, cmdline, \
|
struct testInfo info = { shouldFail, pool, vol, inputvol, cmdline, \
|
||||||
flags, imgformat }; \
|
flags, imgformat }; \
|
||||||
@ -171,31 +172,54 @@ mymain(void)
|
|||||||
} \
|
} \
|
||||||
while (0);
|
while (0);
|
||||||
|
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2", NULL, "qcow2", 0, FMT_OPTIONS);
|
#define DO_TEST(pool, ...) \
|
||||||
DO_TEST(true, "pool-dir", "vol-qcow2", NULL, "qcow2-prealloc", flags,
|
DO_TEST_FULL(false, pool, __VA_ARGS__)
|
||||||
FMT_OPTIONS);
|
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", NULL,
|
#define DO_TEST_FAIL(pool, ...) \
|
||||||
|
DO_TEST_FULL(true, pool, __VA_ARGS__)
|
||||||
|
|
||||||
|
DO_TEST("pool-dir", "vol-qcow2",
|
||||||
|
NULL,
|
||||||
|
"qcow2", 0, FMT_OPTIONS);
|
||||||
|
DO_TEST_FAIL("pool-dir", "vol-qcow2",
|
||||||
|
NULL,
|
||||||
|
"qcow2-prealloc", flags, FMT_OPTIONS);
|
||||||
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
NULL,
|
||||||
"qcow2-nobacking-prealloc", flags, FMT_OPTIONS);
|
"qcow2-nobacking-prealloc", flags, FMT_OPTIONS);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", "vol-file",
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
"vol-file",
|
||||||
"qcow2-nobacking-convert-prealloc", flags, FMT_OPTIONS);
|
"qcow2-nobacking-convert-prealloc", flags, FMT_OPTIONS);
|
||||||
DO_TEST(true, "pool-dir", "vol-qcow2", "vol-file",
|
DO_TEST_FAIL("pool-dir", "vol-qcow2",
|
||||||
|
"vol-file",
|
||||||
"qcow2-convert-prealloc", flags, FMT_OPTIONS);
|
"qcow2-convert-prealloc", flags, FMT_OPTIONS);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2", NULL, "qcow2-flag", 0, FMT_FLAG);
|
DO_TEST("pool-dir", "vol-qcow2",
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", NULL,
|
NULL,
|
||||||
|
"qcow2-flag", 0, FMT_FLAG);
|
||||||
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
NULL,
|
||||||
"qcow2-nobacking-flag", 0, FMT_FLAG);
|
"qcow2-nobacking-flag", 0, FMT_FLAG);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", "vol-file",
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
"vol-file",
|
||||||
"qcow2-nobacking-convert-flag", 0, FMT_FLAG);
|
"qcow2-nobacking-convert-flag", 0, FMT_FLAG);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2", NULL, "qcow2-none", 0, FMT_NONE);
|
DO_TEST("pool-dir", "vol-qcow2",
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", NULL,
|
NULL,
|
||||||
|
"qcow2-none", 0, FMT_NONE);
|
||||||
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
NULL,
|
||||||
"qcow2-nobacking-none", 0, FMT_NONE);
|
"qcow2-nobacking-none", 0, FMT_NONE);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-nobacking", "vol-file",
|
DO_TEST("pool-dir", "vol-qcow2-nobacking",
|
||||||
|
"vol-file",
|
||||||
"qcow2-nobacking-convert-none", 0, FMT_NONE);
|
"qcow2-nobacking-convert-none", 0, FMT_NONE);
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-lazy", NULL, "qcow2-lazy", 0,
|
DO_TEST("pool-dir", "vol-qcow2-lazy",
|
||||||
FMT_OPTIONS);
|
NULL,
|
||||||
DO_TEST(false, "pool-dir", "vol-qcow2-1.1", NULL, "qcow2-1.1", 0,
|
"qcow2-lazy", 0, FMT_OPTIONS);
|
||||||
FMT_OPTIONS);
|
DO_TEST("pool-dir", "vol-qcow2-1.1",
|
||||||
DO_TEST(true, "pool-dir", "vol-qcow2-0.10-lazy", NULL, "qcow2-0.10-lazy", 0,
|
NULL,
|
||||||
FMT_OPTIONS);
|
"qcow2-1.1", 0, FMT_OPTIONS);
|
||||||
|
DO_TEST_FAIL("pool-dir", "vol-qcow2-0.10-lazy",
|
||||||
|
NULL,
|
||||||
|
"qcow2-0.10-lazy", 0, FMT_OPTIONS);
|
||||||
|
|
||||||
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user