mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +00:00
tests: Add CLI <-> API validation test for --disk changes
Check that the CLI generates the JSON data as expected. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
3c8cf0988d
commit
b4d04bdff6
30
src/main.rs
30
src/main.rs
@ -681,6 +681,36 @@ mod unit_tests {
|
|||||||
}"#,
|
}"#,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
vec![
|
||||||
|
"cloud-hypervisor",
|
||||||
|
"--disk",
|
||||||
|
"path=/path/to/disk/1,vhost_user=true,socket=/tmp/socket1",
|
||||||
|
"path=/path/to/disk/2",
|
||||||
|
],
|
||||||
|
r#"{
|
||||||
|
"disks": [
|
||||||
|
{"path": "/path/to/disk/1", "vhost_user":true, "vhost_socket":"/tmp/socket1"},
|
||||||
|
{"path": "/path/to/disk/2"}
|
||||||
|
]
|
||||||
|
}"#,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vec![
|
||||||
|
"cloud-hypervisor",
|
||||||
|
"--disk",
|
||||||
|
"path=/path/to/disk/1,vhost_user=true,socket=/tmp/socket1,wce=true",
|
||||||
|
"path=/path/to/disk/2",
|
||||||
|
],
|
||||||
|
r#"{
|
||||||
|
"disks": [
|
||||||
|
{"path": "/path/to/disk/1", "vhost_user":true, "vhost_socket":"/tmp/socket1", "wce":true},
|
||||||
|
{"path": "/path/to/disk/2"}
|
||||||
|
]
|
||||||
|
}"#,
|
||||||
|
true,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|(cli, openapi, equal)| {
|
.for_each(|(cli, openapi, equal)| {
|
||||||
|
Loading…
Reference in New Issue
Block a user