提交 655b95a0 编写于 作者: P Peter Krempa

tests: storage: Drop format probing from tests

Storage drivers now don't allow it so there's no need to test it.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 67d7d416
...@@ -95,8 +95,7 @@ testCleanupImages(void) ...@@ -95,8 +95,7 @@ testCleanupImages(void)
static virStorageSourcePtr static virStorageSourcePtr
testStorageFileGetMetadata(const char *path, testStorageFileGetMetadata(const char *path,
int format, int format,
uid_t uid, gid_t gid, uid_t uid, gid_t gid)
bool allow_probe)
{ {
struct stat st; struct stat st;
virStorageSourcePtr ret = NULL; virStorageSourcePtr ret = NULL;
...@@ -118,7 +117,7 @@ testStorageFileGetMetadata(const char *path, ...@@ -118,7 +117,7 @@ testStorageFileGetMetadata(const char *path,
if (VIR_STRDUP(ret->path, path) < 0) if (VIR_STRDUP(ret->path, path) < 0)
goto error; goto error;
if (virStorageFileGetMetadata(ret, uid, gid, allow_probe, false) < 0) if (virStorageFileGetMetadata(ret, uid, gid, false, false) < 0)
goto error; goto error;
return ret; return ret;
...@@ -320,8 +319,7 @@ testStorageChain(const void *args) ...@@ -320,8 +319,7 @@ testStorageChain(const void *args)
size_t i = 0; size_t i = 0;
char *broken = NULL; char *broken = NULL;
meta = testStorageFileGetMetadata(data->start, data->format, -1, -1, meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
(data->flags & ALLOW_PROBE) != 0);
if (!meta) { if (!meta) {
if (data->flags & EXP_FAIL) { if (data->flags & EXP_FAIL) {
virResetLastError(); virResetLastError();
...@@ -757,7 +755,7 @@ mymain(void) ...@@ -757,7 +755,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, ALLOW_PROBE | flags2, VIR_FLATTEN_1(chain2)); \ TEST_ONE_CHAIN(path, format, flags2, VIR_FLATTEN_1(chain2)); \
} while (0) } while (0)
/* The actual tests, in several groups. */ /* The actual tests, in several groups. */
...@@ -798,7 +796,7 @@ mymain(void) ...@@ -798,7 +796,7 @@ mymain(void)
(&qcow2, &raw), 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), EXP_PASS); (&qcow2_as_raw), EXP_PASS);
/* Rewrite qcow2 file to use absolute backing name */ /* Rewrite qcow2 file to use absolute backing name */
virCommandFree(cmd); virCommandFree(cmd);
...@@ -815,7 +813,7 @@ mymain(void) ...@@ -815,7 +813,7 @@ mymain(void)
(&qcow2, &raw), 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), EXP_PASS); (&qcow2_as_raw), EXP_PASS);
/* Wrapped file access */ /* Wrapped file access */
testFileData wrap = { testFileData wrap = {
...@@ -852,7 +850,7 @@ mymain(void) ...@@ -852,7 +850,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), EXP_PASS); (&wrap_as_raw, &qcow2_as_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);
...@@ -954,7 +952,7 @@ mymain(void) ...@@ -954,7 +952,7 @@ mymain(void)
(&qed, &raw), 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), EXP_PASS); (&qed_as_raw), EXP_PASS);
/* directory */ /* directory */
testFileData dir = { testFileData dir = {
...@@ -1101,7 +1099,7 @@ mymain(void) ...@@ -1101,7 +1099,7 @@ mymain(void)
/* Test behavior of chain lookups, absolute backing from relative start */ /* Test behavior of chain lookups, absolute backing from relative start */
chain = testStorageFileGetMetadata("wrap", VIR_STORAGE_FILE_QCOW2, chain = testStorageFileGetMetadata("wrap", VIR_STORAGE_FILE_QCOW2,
-1, -1, false); -1, -1);
if (!chain) { if (!chain) {
ret = -1; ret = -1;
goto cleanup; goto cleanup;
...@@ -1166,8 +1164,7 @@ mymain(void) ...@@ -1166,8 +1164,7 @@ mymain(void)
/* Test behavior of chain lookups, relative backing from absolute start */ /* Test behavior of chain lookups, relative backing from absolute start */
virStorageSourceFree(chain); virStorageSourceFree(chain);
chain = testStorageFileGetMetadata(abswrap, VIR_STORAGE_FILE_QCOW2, chain = testStorageFileGetMetadata(abswrap, VIR_STORAGE_FILE_QCOW2, -1, -1);
-1, -1, false);
if (!chain) { if (!chain) {
ret = -1; ret = -1;
goto cleanup; goto cleanup;
...@@ -1214,7 +1211,7 @@ mymain(void) ...@@ -1214,7 +1211,7 @@ mymain(void)
/* Test behavior of chain lookups, relative backing */ /* Test behavior of chain lookups, relative backing */
virStorageSourceFree(chain); virStorageSourceFree(chain);
chain = testStorageFileGetMetadata("sub/link2", VIR_STORAGE_FILE_QCOW2, chain = testStorageFileGetMetadata("sub/link2", VIR_STORAGE_FILE_QCOW2,
-1, -1, false); -1, -1);
if (!chain) { if (!chain) {
ret = -1; ret = -1;
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册