mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuhotplugtest: Generate better output
Each test case label now contains more data useful to identify the test.
This commit is contained in:
parent
4e6b05f5b6
commit
8d4189d504
@ -96,7 +96,7 @@ testQemuHotplugAttach(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (virTestGetVerbose())
|
if (virTestGetVerbose())
|
||||||
fprintf(stderr, "device type '%s' cannot be attached",
|
fprintf(stderr, "device type '%s' cannot be attached\n",
|
||||||
virDomainDeviceTypeToString(dev->type));
|
virDomainDeviceTypeToString(dev->type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ testQemuHotplugDetach(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (virTestGetVerbose())
|
if (virTestGetVerbose())
|
||||||
fprintf(stderr, "device type '%s' cannot be attached",
|
fprintf(stderr, "device type '%s' cannot be detached\n",
|
||||||
virDomainDeviceTypeToString(dev->type));
|
virDomainDeviceTypeToString(dev->type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (virTestGetVerbose())
|
if (virTestGetVerbose())
|
||||||
fprintf(stderr, "device type '%s' cannot be updated",
|
fprintf(stderr, "device type '%s' cannot be updated\n",
|
||||||
virDomainDeviceTypeToString(dev->type));
|
virDomainDeviceTypeToString(dev->type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -276,33 +276,28 @@ mymain(void)
|
|||||||
if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
|
if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
#define DO_TEST(file, dev, fial, kep, ...) \
|
#define DO_TEST(file, ACTION, dev, fial, kep, ...) \
|
||||||
|
do { \
|
||||||
const char *my_mon[] = { __VA_ARGS__, NULL}; \
|
const char *my_mon[] = { __VA_ARGS__, NULL}; \
|
||||||
|
const char *name = file " " #ACTION " " dev; \
|
||||||
|
data.action = ACTION; \
|
||||||
data.domain_filename = file; \
|
data.domain_filename = file; \
|
||||||
data.device_filename = dev; \
|
data.device_filename = dev; \
|
||||||
data.fail = fial; \
|
data.fail = fial; \
|
||||||
data.mon = my_mon; \
|
data.mon = my_mon; \
|
||||||
data.keep = kep; \
|
data.keep = kep; \
|
||||||
if (virtTestRun(#file, 1, testQemuHotplug, &data) < 0) \
|
if (virtTestRun(name, 1, testQemuHotplug, &data) < 0) \
|
||||||
ret = -1; \
|
ret = -1; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define DO_TEST_ATTACH(file, dev, fial, kep, ...) \
|
#define DO_TEST_ATTACH(file, dev, fial, kep, ...) \
|
||||||
do { \
|
DO_TEST(file, ATTACH, dev, fial, kep, __VA_ARGS__)
|
||||||
data.action = ATTACH; \
|
|
||||||
DO_TEST(file, dev, fial, kep, __VA_ARGS__) \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define DO_TEST_DETACH(file, dev, fial, kep, ...) \
|
#define DO_TEST_DETACH(file, dev, fial, kep, ...) \
|
||||||
do { \
|
DO_TEST(file, DETACH, dev, fial, kep, __VA_ARGS__)
|
||||||
data.action = DETACH; \
|
|
||||||
DO_TEST(file, dev, fial, kep, __VA_ARGS__) \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define DO_TEST_UPDATE(file, dev, fial, kep, ...) \
|
#define DO_TEST_UPDATE(file, dev, fial, kep, ...) \
|
||||||
do { \
|
DO_TEST(file, UPDATE, dev, fial, kep, __VA_ARGS__)
|
||||||
data.action = UPDATE; \
|
|
||||||
DO_TEST(file, dev, fial, kep, __VA_ARGS__) \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, false, NULL);
|
DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, false, NULL);
|
||||||
DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nochange", false, false,
|
DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nochange", false, false,
|
||||||
|
Loading…
Reference in New Issue
Block a user