tests: Add test for hotplug_size and hotplug_method

Add test for hotplug_size and hotplug_method.

Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
Hui Zhu 2020-03-04 14:39:26 +08:00 committed by Sebastien Boeuf
parent e63f98182a
commit 4a7a2cff8c

View File

@ -593,6 +593,20 @@ mod unit_tests {
}"#,
false,
),
(
vec!["cloud-hypervisor", "--memory", "size=1G,hotplug_size=1G"],
r#"{
"memory": {"size": 1073741824, "hotplug_method": "Acpi", "hotplug_size": 1073741824}
}"#,
true,
),
(
vec!["cloud-hypervisor", "--memory", "size=1G,hotplug_method=virtio-mem,hotplug_size=1G"],
r#"{
"memory": {"size": 1073741824, "hotplug_method": "VirtioMem", "hotplug_size": 1073741824}
}"#,
true,
),
]
.iter()
.for_each(|(cli, openapi, equal)| {