@@ -24,14 +24,14 @@ fn test_run() {
24
24
name: "uefi image boots with uefi flag" . to_string( ) ,
25
25
image: Some ( asset( "image-uefi.raw-efi" ) ) ,
26
26
uefi: true ,
27
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
27
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
28
28
..Default :: default ( )
29
29
} ,
30
30
Target {
31
31
name: "not uefi image boots without uefi flag" . to_string( ) ,
32
32
image: Some ( asset( "image-not-uefi.raw" ) ) ,
33
33
uefi: false ,
34
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
34
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
35
35
..Default :: default ( )
36
36
} ,
37
37
] ,
@@ -51,21 +51,21 @@ fn test_run_multiple_return_number_failures() {
51
51
name: "uefi image boots with uefi flag" . to_string( ) ,
52
52
image: Some ( asset( "image-uefi.raw-efi" ) ) ,
53
53
uefi: true ,
54
- command: "exit 1" . to_string( ) ,
54
+ command: Some ( "exit 1" . to_string( ) ) ,
55
55
..Default :: default ( )
56
56
} ,
57
57
Target {
58
58
name: "uefi image boots with uefi flag 2" . to_string( ) ,
59
59
image: Some ( asset( "image-uefi.raw-efi" ) ) ,
60
60
uefi: true ,
61
- command: "exit 1" . to_string( ) ,
61
+ command: Some ( "exit 1" . to_string( ) ) ,
62
62
..Default :: default ( )
63
63
} ,
64
64
Target {
65
65
name: "not uefi image boots without uefi flag" . to_string( ) ,
66
66
image: Some ( asset( "image-not-uefi.raw" ) ) ,
67
67
uefi: false ,
68
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
68
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
69
69
..Default :: default ( )
70
70
} ,
71
71
] ,
@@ -84,7 +84,7 @@ fn test_run_single_return_number_return_code() {
84
84
name: "not uefi image boots without uefi flag" . to_string( ) ,
85
85
image: Some ( asset( "image-not-uefi.raw" ) ) ,
86
86
uefi: false ,
87
- command: "exit 12" . to_string( ) ,
87
+ command: Some ( "exit 12" . to_string( ) ) ,
88
88
..Default :: default ( )
89
89
} ] ,
90
90
} ;
@@ -102,7 +102,7 @@ fn test_vmtest_infra_error() {
102
102
name: "not an actual image, should return EX_UNAVAILABLE" . to_string( ) ,
103
103
image: Some ( asset( "not_an_actual_image" ) ) ,
104
104
uefi: false ,
105
- command: "exit 12" . to_string( ) ,
105
+ command: Some ( "exit 12" . to_string( ) ) ,
106
106
..Default :: default ( )
107
107
} ] ,
108
108
} ;
@@ -124,14 +124,14 @@ fn test_run_one() {
124
124
name: "uefi image boots with uefi flag" . to_string( ) ,
125
125
image: Some ( uefi_image. as_pathbuf( ) ) ,
126
126
uefi: true ,
127
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
127
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
128
128
..Default :: default ( )
129
129
} ,
130
130
Target {
131
131
name: "not uefi image boots without uefi flag" . to_string( ) ,
132
132
image: Some ( non_uefi_image. as_pathbuf( ) ) ,
133
133
uefi: false ,
134
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
134
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
135
135
..Default :: default ( )
136
136
} ,
137
137
] ,
@@ -156,14 +156,14 @@ fn test_run_out_of_bounds() {
156
156
name: "uefi image boots with uefi flag" . to_string( ) ,
157
157
image: Some ( uefi_image. as_pathbuf( ) ) ,
158
158
uefi: true ,
159
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
159
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
160
160
..Default :: default ( )
161
161
} ,
162
162
Target {
163
163
name: "not uefi image boots without uefi flag" . to_string( ) ,
164
164
image: Some ( non_uefi_image. as_pathbuf( ) ) ,
165
165
uefi: false ,
166
- command: "/mnt/vmtest/main.sh nixos" . to_string( ) ,
166
+ command: Some ( "/mnt/vmtest/main.sh nixos" . to_string( ) ) ,
167
167
..Default :: default ( )
168
168
} ,
169
169
] ,
@@ -184,7 +184,7 @@ fn test_not_uefi() {
184
184
name: "uefi image does not boot without uefi flag" . to_string( ) ,
185
185
image: Some ( uefi_image. as_pathbuf( ) ) ,
186
186
uefi: false ,
187
- command: "echo unreachable" . to_string( ) ,
187
+ command: Some ( "echo unreachable" . to_string( ) ) ,
188
188
..Default :: default ( )
189
189
} ] ,
190
190
} ;
@@ -202,7 +202,7 @@ fn test_command_runs_in_shell() {
202
202
kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
203
203
// `$0` is a portable way of getting the name of the shell without relying
204
204
// 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( ) ) ,
206
206
..Default :: default ( )
207
207
} ] ,
208
208
} ;
@@ -260,7 +260,7 @@ fn test_kernel_target_env_var_propagation() {
260
260
target : vec ! [ Target {
261
261
name: "host env vars are propagated into guest" . to_string( ) ,
262
262
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( ) ) ,
264
264
..Default :: default ( )
265
265
} ] ,
266
266
} ;
@@ -286,7 +286,7 @@ fn test_kernel_target_cwd_preserved() {
286
286
target : vec ! [ Target {
287
287
name: "host cwd preserved in guest" . to_string( ) ,
288
288
kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
289
- command: "cat text_file.txt" . to_string( ) ,
289
+ command: Some ( "cat text_file.txt" . to_string( ) ) ,
290
290
..Default :: default ( )
291
291
} ] ,
292
292
} ;
@@ -314,7 +314,7 @@ fn test_command_process_substitution() {
314
314
kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
315
315
// `$0` is a portable way of getting the name of the shell without relying
316
316
// 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( ) ) ,
318
318
..Default :: default ( )
319
319
} ] ,
320
320
} ;
@@ -335,7 +335,7 @@ fn test_qemu_error_shown() {
335
335
target : vec ! [ Target {
336
336
name: "invalid kernel path" . to_string( ) ,
337
337
kernel: Some ( asset( "doesn't exist" ) ) ,
338
- command: "true" . to_string( ) ,
338
+ command: Some ( "true" . to_string( ) ) ,
339
339
..Default :: default ( )
340
340
} ] ,
341
341
} ;
@@ -360,7 +360,7 @@ fn test_kernel_ro_flag() {
360
360
name: "cannot touch host rootfs with ro" . to_string( ) ,
361
361
kernel: Some ( asset( "bzImage-v5.15-default" ) ) ,
362
362
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( ) ) ) ,
364
364
..Default :: default ( )
365
365
} ] ,
366
366
} ;
@@ -381,7 +381,7 @@ fn test_run_custom_resources() {
381
381
name: "Custom number of CPUs" . to_string( ) ,
382
382
image: Some ( uefi_image_t1. as_pathbuf( ) ) ,
383
383
uefi: true ,
384
- command: r#"bash -xc "[[ "$(nproc)" == "1" ]]""# . into( ) ,
384
+ command: Some ( r#"bash -xc "[[ "$(nproc)" == "1" ]]""# . into( ) ) ,
385
385
vm: VMConfig {
386
386
num_cpus: 1 ,
387
387
..Default :: default ( )
@@ -393,8 +393,9 @@ fn test_run_custom_resources() {
393
393
image: Some ( uefi_image_t2. as_pathbuf( ) ) ,
394
394
uefi: true ,
395
395
// 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 (
397
+ r#"bash -xc "cat /proc/meminfo | grep 'MemTotal: 2..... kB'""# . into( ) ,
398
+ ) ,
398
399
vm: VMConfig {
399
400
memory: "256M" . into( ) ,
400
401
..Default :: default ( )
@@ -421,7 +422,7 @@ fn test_run_custom_mounts() {
421
422
name: "mount" . to_string( ) ,
422
423
image: Some ( uefi_image. as_pathbuf( ) ) ,
423
424
uefi: true ,
424
- command: r#"bash -xc "[[ -e /tmp/mount/README.md ]]""# . into( ) ,
425
+ command: Some ( r#"bash -xc "[[ -e /tmp/mount/README.md ]]""# . into( ) ) ,
425
426
vm: VMConfig {
426
427
mounts: HashMap :: from( [ (
427
428
"/tmp/mount" . into( ) ,
@@ -438,7 +439,7 @@ fn test_run_custom_mounts() {
438
439
name: "RO mount" . to_string( ) ,
439
440
image: Some ( uefi_image. as_pathbuf( ) ) ,
440
441
uefi: true ,
441
- command: r#"bash -xc "(touch /tmp/ro/hi && exit -1) || true""# . into( ) ,
442
+ command: Some ( r#"bash -xc "(touch /tmp/ro/hi && exit -1) || true""# . into( ) ) ,
442
443
vm: VMConfig {
443
444
mounts: HashMap :: from( [ (
444
445
"/tmp/ro" . into( ) ,
0 commit comments