@@ -69,35 +69,35 @@ mod tests {
6969
7070 // PATCH with invalid fields.
7171 let body = r#"{
72- "amount_mb ": "bar",
72+ "amount_mib ": "bar",
7373 "foo": "bar"
7474 }"# ;
7575 assert ! ( parse_patch_balloon( & Body :: new( body) , None ) . is_err( ) ) ;
7676
7777 // PATCH with invalid types on fields. Adding a polling interval as string instead of bool.
7878 let body = r#"{
79- "amount_mb ": 1000,
79+ "amount_mib ": 1000,
8080 "stats_polling_interval_s": "false"
8181 }"# ;
8282 let res = parse_patch_balloon ( & Body :: new ( body) , None ) ;
8383 assert ! ( res. is_err( ) ) ;
8484
85- // PATCH with invalid types on fields. Adding a amount_mb as a negative number.
85+ // PATCH with invalid types on fields. Adding a amount_mib as a negative number.
8686 let body = r#"{
87- "amount_mb ": -1000,
87+ "amount_mib ": -1000,
8888 "stats_polling_interval_s": true
8989 }"# ;
9090 let res = parse_patch_balloon ( & Body :: new ( body) , None ) ;
9191 assert ! ( res. is_err( ) ) ;
9292
9393 // PATCH on statistics with missing ppolling interval field.
9494 let body = r#"{
95- "amount_mb ": 100
95+ "amount_mib ": 100
9696 }"# ;
9797 let res = parse_patch_balloon ( & Body :: new ( body) , Some ( & "statistics" ) ) ;
9898 assert ! ( res. is_err( ) ) ;
9999
100- // PATCH with missing amount_mb field.
100+ // PATCH with missing amount_mib field.
101101 let body = r#"{
102102 "stats_polling_interval_s": 0
103103 }"# ;
@@ -106,7 +106,7 @@ mod tests {
106106
107107 // PATCH that tries to update something else other than allowed fields.
108108 let body = r#"{
109- "amount_mb ": "dummy_id",
109+ "amount_mib ": "dummy_id",
110110 "stats_polling_interval_s": "dummy_host"
111111 }"# ;
112112 let res = parse_patch_balloon ( & Body :: new ( body) , None ) ;
@@ -125,11 +125,11 @@ mod tests {
125125 assert ! ( parse_patch_balloon( & Body :: new( body) , Some ( & "config" ) ) . is_err( ) ) ;
126126
127127 let body = r#"{
128- "amount_mb ": 1
128+ "amount_mib ": 1
129129 }"# ;
130130 #[ allow( clippy:: match_wild_err_arm) ]
131131 match vmm_action_from_request ( parse_patch_balloon ( & Body :: new ( body) , None ) . unwrap ( ) ) {
132- VmmAction :: UpdateBalloon ( balloon_cfg) => assert_eq ! ( balloon_cfg. amount_mb , 1 ) ,
132+ VmmAction :: UpdateBalloon ( balloon_cfg) => assert_eq ! ( balloon_cfg. amount_mib , 1 ) ,
133133 _ => panic ! ( "Test failed: Invalid parameters" ) ,
134134 } ;
135135
@@ -153,14 +153,14 @@ mod tests {
153153
154154 // PUT with invalid fields.
155155 let body = r#"{
156- "amount_mb ": "bar",
156+ "amount_mib ": "bar",
157157 "is_read_only": false
158158 }"# ;
159159 assert ! ( parse_put_balloon( & Body :: new( body) ) . is_err( ) ) ;
160160
161161 // PUT with valid input fields.
162162 let body = r#"{
163- "amount_mb ": 1000,
163+ "amount_mib ": 1000,
164164 "deflate_on_oom": true,
165165 "stats_polling_interval_s": 0
166166 }"# ;
0 commit comments