File tree Expand file tree Collapse file tree 19 files changed +117
-46
lines changed
tests/integration_tests/functional Expand file tree Collapse file tree 19 files changed +117
-46
lines changed Original file line number Diff line number Diff line change @@ -547,7 +547,9 @@ mod tests {
547
547
let mut buf = vec ! [ 0 ; 10000 ] ;
548
548
549
549
Snapshot :: new ( & v) . save ( & mut buf. as_mut_slice ( ) ) . unwrap ( ) ;
550
- let restored: Aarch64RegisterVec = Snapshot :: load ( & mut buf. as_slice ( ) ) . unwrap ( ) . data ;
550
+ let restored: Aarch64RegisterVec = Snapshot :: load_without_crc_check ( buf. as_slice ( ) )
551
+ . unwrap ( )
552
+ . data ;
551
553
552
554
for ( old, new) in v. iter ( ) . zip ( restored. iter ( ) ) {
553
555
assert_eq ! ( old, new) ;
@@ -576,7 +578,7 @@ mod tests {
576
578
577
579
// Total size of registers according IDs are 16 + 16 = 32,
578
580
// but actual data size is 8 + 16 = 24.
579
- Snapshot :: < Aarch64RegisterVec > :: load ( & mut buf. as_slice ( ) ) . unwrap_err ( ) ;
581
+ Snapshot :: < Aarch64RegisterVec > :: load_without_crc_check ( buf. as_slice ( ) ) . unwrap_err ( ) ;
580
582
}
581
583
582
584
#[ test]
@@ -598,7 +600,7 @@ mod tests {
598
600
Snapshot :: new ( v) . save ( & mut buf. as_mut_slice ( ) ) . unwrap ( ) ;
599
601
600
602
// 4096 bit wide registers are not supported.
601
- Snapshot :: < Aarch64RegisterVec > :: load ( & mut buf. as_slice ( ) ) . unwrap_err ( ) ;
603
+ Snapshot :: < Aarch64RegisterVec > :: load_without_crc_check ( buf. as_slice ( ) ) . unwrap_err ( ) ;
602
604
}
603
605
604
606
#[ test]
Original file line number Diff line number Diff line change @@ -321,7 +321,9 @@ mod tests {
321
321
Snapshot :: new ( state)
322
322
. save ( & mut snapshot_data. as_mut_slice ( ) )
323
323
. unwrap ( ) ;
324
- let restored_state: VmState = Snapshot :: load ( & mut snapshot_data. as_slice ( ) ) . unwrap ( ) . data ;
324
+ let restored_state: VmState = Snapshot :: load_without_crc_check ( snapshot_data. as_slice ( ) )
325
+ . unwrap ( )
326
+ . data ;
325
327
326
328
vm. restore_state ( & restored_state) . unwrap ( ) ;
327
329
}
Original file line number Diff line number Diff line change @@ -659,7 +659,9 @@ mod tests {
659
659
// object and calling default_vmm() is the easiest way to create one.
660
660
let vmm = default_vmm ( ) ;
661
661
let device_manager_state: device_manager:: DevicesState =
662
- Snapshot :: load ( & mut buf. as_slice ( ) ) . unwrap ( ) . data ;
662
+ Snapshot :: load_without_crc_check ( buf. as_slice ( ) )
663
+ . unwrap ( )
664
+ . data ;
663
665
let vm_resources = & mut VmResources :: default ( ) ;
664
666
let restore_args = PciDevicesConstructorArgs {
665
667
vm : vmm. vm . clone ( ) ,
Original file line number Diff line number Diff line change @@ -680,7 +680,9 @@ mod tests {
680
680
let mut event_manager = EventManager :: new ( ) . expect ( "Unable to create EventManager" ) ;
681
681
let vmm = default_vmm ( ) ;
682
682
let device_manager_state: device_manager:: DevicesState =
683
- Snapshot :: load ( & mut buf. as_slice ( ) ) . unwrap ( ) . data ;
683
+ Snapshot :: load_without_crc_check ( buf. as_slice ( ) )
684
+ . unwrap ( )
685
+ . data ;
684
686
let vm_resources = & mut VmResources :: default ( ) ;
685
687
let restore_args = MMIODevManagerConstructorArgs {
686
688
mem : vmm. vm . guest_memory ( ) ,
Original file line number Diff line number Diff line change @@ -196,7 +196,9 @@ mod tests {
196
196
mem : guest_mem,
197
197
restored_from_file : true ,
198
198
} ,
199
- & Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ,
199
+ & Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
200
+ . unwrap ( )
201
+ . data ,
200
202
)
201
203
. unwrap ( ) ;
202
204
Original file line number Diff line number Diff line change @@ -223,7 +223,9 @@ mod tests {
223
223
// Restore the block device.
224
224
let restored_block = VirtioBlock :: restore (
225
225
BlockConstructorArgs { mem : guest_mem } ,
226
- & Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ,
226
+ & Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
227
+ . unwrap ( )
228
+ . data ,
227
229
)
228
230
. unwrap ( ) ;
229
231
Original file line number Diff line number Diff line change @@ -175,7 +175,9 @@ mod tests {
175
175
mem : guest_mem,
176
176
mmds : mmds_ds,
177
177
} ,
178
- & Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ,
178
+ & Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
179
+ . unwrap ( )
180
+ . data ,
179
181
) {
180
182
Ok ( restored_net) => {
181
183
// Test that virtio specific fields are the same.
Original file line number Diff line number Diff line change @@ -366,8 +366,13 @@ mod tests {
366
366
mem,
367
367
is_activated : true ,
368
368
} ;
369
- let restored_queue =
370
- Queue :: restore ( ca, & Snapshot :: load ( & mut bytes. as_slice ( ) ) . unwrap ( ) . data ) . unwrap ( ) ;
369
+ let restored_queue = Queue :: restore (
370
+ ca,
371
+ & Snapshot :: load_without_crc_check ( bytes. as_slice ( ) )
372
+ . unwrap ( )
373
+ . data ,
374
+ )
375
+ . unwrap ( ) ;
371
376
372
377
assert_eq ! ( restored_queue, queue) ;
373
378
}
@@ -380,7 +385,9 @@ mod tests {
380
385
let state = VirtioDeviceState :: from_device ( & dummy) ;
381
386
Snapshot :: new ( & state) . save ( & mut mem. as_mut_slice ( ) ) . unwrap ( ) ;
382
387
383
- let restored_state: VirtioDeviceState = Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ;
388
+ let restored_state: VirtioDeviceState = Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
389
+ . unwrap ( )
390
+ . data ;
384
391
assert_eq ! ( restored_state, state) ;
385
392
}
386
393
@@ -419,7 +426,9 @@ mod tests {
419
426
} ;
420
427
let restored_mmio_transport = MmioTransport :: restore (
421
428
restore_args,
422
- & Snapshot :: load ( & mut buf. as_slice ( ) ) . unwrap ( ) . data ,
429
+ & Snapshot :: load_without_crc_check ( buf. as_slice ( ) )
430
+ . unwrap ( )
431
+ . data ,
423
432
)
424
433
. unwrap ( ) ;
425
434
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ mod tests {
92
92
let guest_mem = create_virtio_mem ( ) ;
93
93
let restored = Entropy :: restore (
94
94
EntropyConstructorArgs { mem : guest_mem } ,
95
- & Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ,
95
+ & Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
96
+ . unwrap ( )
97
+ . data ,
96
98
)
97
99
. unwrap ( ) ;
98
100
Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ pub(crate) mod tests {
180
180
181
181
Snapshot :: new ( & state) . save ( & mut mem. as_mut_slice ( ) ) . unwrap ( ) ;
182
182
183
- let restored_state: VsockState = Snapshot :: load ( & mut mem. as_slice ( ) ) . unwrap ( ) . data ;
183
+ let restored_state: VsockState = Snapshot :: load_without_crc_check ( mem. as_slice ( ) )
184
+ . unwrap ( )
185
+ . data ;
184
186
let mut restored_device = Vsock :: restore (
185
187
VsockConstructorArgs {
186
188
mem : ctx. mem . clone ( ) ,
You can’t perform that action at this time.
0 commit comments