diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml index 5ac4abfdb26f3bd0e112a22ef4a27a3c98d7ff59..35b3abc5073448f51eca3afd779da26cb75ec07f 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml @@ -17,7 +17,7 @@ - + diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-rbd-auth.xml b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-rbd-auth.xml index ac2e942090c64769b328dc4159bd645bb21838a6..4db031b70bac2950872c508d3fc9d8471bbfb9df 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-rbd-auth.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-rbd-auth.xml @@ -23,7 +23,7 @@ - + diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 6650cf0344d5cd6d4be6244674b5f9e8f46ba650..8e0e71100d014f4aa74747e7ebd80e3ab8d72e96 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -24,7 +24,6 @@ static virQEMUDriver driver; static int blankProblemElements(char *data) { if (virtTestClearLineRegex("[[:digit:]]+", data) < 0 || - virtTestClearLineRegex("", data) < 0 || virtTestClearLineRegex("[[:digit:]]+", data) < 0) return -1; @@ -33,12 +32,26 @@ static int blankProblemElements(char *data) static int testSanitizeDef(virDomainDefPtr vmdef) { + size_t i = 0; int ret = -1; /* Remove UUID randomness */ if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", vmdef->uuid) < 0) goto fail; + /* qemuargv2xml doesn't know what to set for a secret usage/uuid, + * so hardcode usage='qemuargv2xml_usage' to appead the schema checker */ + for (i = 0; i < vmdef->ndisks; i++) { + virDomainDiskDefPtr disk = vmdef->disks[i]; + + if (disk->src->auth) { + disk->src->auth->secretType = VIR_STORAGE_SECRET_TYPE_USAGE; + if (VIR_STRDUP(disk->src->auth->secret.usage, + "qemuargv2xml_usage") < 0) + goto fail; + } + } + ret = 0; fail: return ret;