代码拉取完成,页面将自动刷新
From 798600dd1fd6d0d96661f9c2b5cbd6e8ae96a229 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 26 Nov 2020 18:35:55 +0100
Subject: [PATCH 15/16] tests: qemuxml2argv: Validate generation of JSON props
for object-add
Similarly to the validation for blockdev-add and netdev_add, use the
qemuxml2argv test repository to drive validation of props for
object-add.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
---
tests/qemuxml2argvtest.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 47fce1c3bf..e07d6cf398 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -546,6 +546,24 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
return -1;
}
+ i++;
+ } else if (STREQ(args[i], "-object")) {
+
+ if (*args[i + 1] != '{') {
+ i++;
+ continue;
+ }
+
+ if (!(jsonargs = virJSONValueFromString(args[i + 1])))
+ return -1;
+
+ if (testQEMUSchemaValidateCommand("object-add", jsonargs,
+ schema, &debug) < 0) {
+ VIR_TEST_VERBOSE("failed to validate -object '%s' against QAPI schema: %s",
+ args[i + 1], virBufferCurrentContent(&debug));
+ return -1;
+ }
+
i++;
}
}
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。