@@ -24,14 +24,14 @@ fn test_run() {
2424 name: "uefi image boots with uefi flag" . to_string( ) ,
2525 image: Some ( asset( "image-uefi.raw-efi" ) ) ,
2626 uefi: true ,
27- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
27+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
2828 ..Default :: default ( )
2929 } ,
3030 Target {
3131 name: "not uefi image boots without uefi flag" . to_string( ) ,
3232 image: Some ( asset( "image-not-uefi.raw" ) ) ,
3333 uefi: false ,
34- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
34+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
3535 ..Default :: default ( )
3636 } ,
3737 ] ,
@@ -51,21 +51,21 @@ fn test_run_multiple_return_number_failures() {
5151 name: "uefi image boots with uefi flag" . to_string( ) ,
5252 image: Some ( asset( "image-uefi.raw-efi" ) ) ,
5353 uefi: true ,
54- command: "exit 1" . to_string( ) ,
54+ command: Some ( "exit 1" . to_string( ) ) ,
5555 ..Default :: default ( )
5656 } ,
5757 Target {
5858 name: "uefi image boots with uefi flag 2" . to_string( ) ,
5959 image: Some ( asset( "image-uefi.raw-efi" ) ) ,
6060 uefi: true ,
61- command: "exit 1" . to_string( ) ,
61+ command: Some ( "exit 1" . to_string( ) ) ,
6262 ..Default :: default ( )
6363 } ,
6464 Target {
6565 name: "not uefi image boots without uefi flag" . to_string( ) ,
6666 image: Some ( asset( "image-not-uefi.raw" ) ) ,
6767 uefi: false ,
68- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
68+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
6969 ..Default :: default ( )
7070 } ,
7171 ] ,
@@ -84,7 +84,7 @@ fn test_run_single_return_number_return_code() {
8484 name: "not uefi image boots without uefi flag" . to_string( ) ,
8585 image: Some ( asset( "image-not-uefi.raw" ) ) ,
8686 uefi: false ,
87- command: "exit 12" . to_string( ) ,
87+ command: Some ( "exit 12" . to_string( ) ) ,
8888 ..Default :: default ( )
8989 } ] ,
9090 } ;
@@ -102,7 +102,7 @@ fn test_vmtest_infra_error() {
102102 name: "not an actual image, should return EX_UNAVAILABLE" . to_string( ) ,
103103 image: Some ( asset( "not_an_actual_image" ) ) ,
104104 uefi: false ,
105- command: "exit 12" . to_string( ) ,
105+ command: Some ( "exit 12" . to_string( ) ) ,
106106 ..Default :: default ( )
107107 } ] ,
108108 } ;
@@ -124,14 +124,14 @@ fn test_run_one() {
124124 name: "uefi image boots with uefi flag" . to_string( ) ,
125125 image: Some ( uefi_image. as_pathbuf( ) ) ,
126126 uefi: true ,
127- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
127+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
128128 ..Default :: default ( )
129129 } ,
130130 Target {
131131 name: "not uefi image boots without uefi flag" . to_string( ) ,
132132 image: Some ( non_uefi_image. as_pathbuf( ) ) ,
133133 uefi: false ,
134- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
134+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
135135 ..Default :: default ( )
136136 } ,
137137 ] ,
@@ -156,14 +156,14 @@ fn test_run_out_of_bounds() {
156156 name: "uefi image boots with uefi flag" . to_string( ) ,
157157 image: Some ( uefi_image. as_pathbuf( ) ) ,
158158 uefi: true ,
159- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
159+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
160160 ..Default :: default ( )
161161 } ,
162162 Target {
163163 name: "not uefi image boots without uefi flag" . to_string( ) ,
164164 image: Some ( non_uefi_image. as_pathbuf( ) ) ,
165165 uefi: false ,
166- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
166+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
167167 ..Default :: default ( )
168168 } ,
169169 ] ,
@@ -184,7 +184,7 @@ fn test_not_uefi() {
184184 name: "uefi image does not boot without uefi flag" . to_string( ) ,
185185 image: Some ( uefi_image. as_pathbuf( ) ) ,
186186 uefi: false ,
187- command: "echo unreachable" . to_string( ) ,
187+ command: Some ( "echo unreachable" . to_string( ) ) ,
188188 ..Default :: default ( )
189189 } ] ,
190190 } ;
@@ -202,7 +202,7 @@ fn test_command_runs_in_shell() {
202202 kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
203203 // `$0` is a portable way of getting the name of the shell without relying
204204 // on env vars which may be propagated from the host into the guest.
205- command: "if true; then echo -n $0 > /mnt/vmtest/result; fi" . to_string( ) ,
205+ command: Some ( "if true; then echo -n $0 > /mnt/vmtest/result; fi" . to_string( ) ) ,
206206 ..Default :: default ( )
207207 } ] ,
208208 } ;
@@ -260,7 +260,7 @@ fn test_kernel_target_env_var_propagation() {
260260 target : vec ! [ Target {
261261 name: "host env vars are propagated into guest" . to_string( ) ,
262262 kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
263- command: "echo -n $TEST_ENV_VAR > /mnt/vmtest/result" . to_string( ) ,
263+ command: Some ( "echo -n $TEST_ENV_VAR > /mnt/vmtest/result" . to_string( ) ) ,
264264 ..Default :: default ( )
265265 } ] ,
266266 } ;
@@ -286,7 +286,7 @@ fn test_kernel_target_cwd_preserved() {
286286 target : vec ! [ Target {
287287 name: "host cwd preserved in guest" . to_string( ) ,
288288 kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
289- command: "cat text_file.txt" . to_string( ) ,
289+ command: Some ( "cat text_file.txt" . to_string( ) ) ,
290290 ..Default :: default ( )
291291 } ] ,
292292 } ;
@@ -314,7 +314,7 @@ fn test_command_process_substitution() {
314314 kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
315315 // `$0` is a portable way of getting the name of the shell without relying
316316 // on env vars which may be propagated from the host into the guest.
317- command: "cat <(echo -n $0) > /mnt/vmtest/result" . to_string( ) ,
317+ command: Some ( "cat <(echo -n $0) > /mnt/vmtest/result" . to_string( ) ) ,
318318 ..Default :: default ( )
319319 } ] ,
320320 } ;
@@ -335,7 +335,7 @@ fn test_qemu_error_shown() {
335335 target : vec ! [ Target {
336336 name: "invalid kernel path" . to_string( ) ,
337337 kernel: Some ( asset( "doesn't exist" ) ) ,
338- command: "true" . to_string( ) ,
338+ command: Some ( "true" . to_string( ) ) ,
339339 ..Default :: default ( )
340340 } ] ,
341341 } ;
@@ -360,7 +360,7 @@ fn test_kernel_ro_flag() {
360360 name: "cannot touch host rootfs with ro" . to_string( ) ,
361361 kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
362362 kernel_args: Some ( "ro" . to_string( ) ) ,
363- command: format!( "touch {}/file" , touch_dir. path( ) . display( ) ) ,
363+ command: Some ( format!( "touch {}/file" , touch_dir. path( ) . display( ) ) ) ,
364364 ..Default :: default ( )
365365 } ] ,
366366 } ;
@@ -381,7 +381,7 @@ fn test_run_custom_resources() {
381381 name: "Custom number of CPUs" . to_string( ) ,
382382 image: Some ( uefi_image_t1. as_pathbuf( ) ) ,
383383 uefi: true ,
384- command: r#"bash -xc "[[ "$(nproc)" == "1" ]]""# . into( ) ,
384+ command: Some ( r#"bash -xc "[[ "$(nproc)" == "1" ]]""# . into( ) ) ,
385385 vm: VMConfig {
386386 num_cpus: 1 ,
387387 ..Default :: default ( )
@@ -393,8 +393,8 @@ fn test_run_custom_resources() {
393393 image: Some ( uefi_image_t2. as_pathbuf( ) ) ,
394394 uefi: true ,
395395 // Should be in the 200 thousands, but it's variable.
396- command: r#"bash -xc "cat /proc/meminfo | grep 'MemTotal: 2..... kB'""#
397- . into( ) ,
396+ command: Some ( r#"bash -xc "cat /proc/meminfo | grep 'MemTotal: 2..... kB'""#
397+ . into( ) ) ,
398398 vm: VMConfig {
399399 memory: "256M" . into( ) ,
400400 ..Default :: default ( )
@@ -421,7 +421,7 @@ fn test_run_custom_mounts() {
421421 name: "mount" . to_string( ) ,
422422 image: Some ( uefi_image. as_pathbuf( ) ) ,
423423 uefi: true ,
424- command: r#"bash -xc "[[ -e /tmp/mount/README.md ]]""# . into( ) ,
424+ command: Some ( r#"bash -xc "[[ -e /tmp/mount/README.md ]]""# . into( ) ) ,
425425 vm: VMConfig {
426426 mounts: HashMap :: from( [ (
427427 "/tmp/mount" . into( ) ,
@@ -438,7 +438,7 @@ fn test_run_custom_mounts() {
438438 name: "RO mount" . to_string( ) ,
439439 image: Some ( uefi_image. as_pathbuf( ) ) ,
440440 uefi: true ,
441- command: r#"bash -xc "(touch /tmp/ro/hi && exit -1) || true""# . into( ) ,
441+ command: Some ( r#"bash -xc "(touch /tmp/ro/hi && exit -1) || true""# . into( ) ) ,
442442 vm: VMConfig {
443443 mounts: HashMap :: from( [ (
444444 "/tmp/ro" . into( ) ,
0 commit comments