From 4a7a2cff8cdb75645ae169b54b02d2981d399220 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Wed, 4 Mar 2020 14:39:26 +0800 Subject: [PATCH] tests: Add test for hotplug_size and hotplug_method Add test for hotplug_size and hotplug_method. Signed-off-by: Hui Zhu --- src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5665aceaa..1e7ab0faa 100755 --- a/src/main.rs +++ b/src/main.rs @@ -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)| {