File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,25 @@ if [ "$TARGET" == "linux" ]; then
21
21
bash ./fetch_disk_images.sh
22
22
fi
23
23
24
+ WIN_IMAGE_FILE=" ./resources/images/windows-server-2019.raw"
25
+ if [ -e $WIN_IMAGE_FILE ]; then
26
+ export img_blk_size=$( du -b -B 512 $WIN_IMAGE_FILE | awk ' {print $1;}' )
27
+ export loop_device=$( sudo losetup --find --show --read-only $WIN_IMAGE_FILE )
28
+ sudo dmsetup create windows-base --table " 0 $img_blk_size linear $loop_device 0"
29
+ sudo dmsetup mknodes
30
+ sudo dmsetup create windows-snapshot-base --table " 0 $img_blk_size snapshot-origin /dev/mapper/windows-base"
31
+ sudo dmsetup mknodes
32
+ fi
33
+
24
34
# Add the user to the kvm group (if not already in it), so they can run VMs
25
35
id -nGz " $USER " | grep -qzxF kvm || sudo adduser " $USER " kvm
26
36
27
37
newgrp kvm << EOF
28
38
export RUST_BACKTRACE=1
29
39
cargo test --features "integration_tests" "integration::tests::${TARGET} "
30
40
EOF
41
+
42
+ if [ -e $WIN_IMAGE_FILE ]; then
43
+ sudo dmsetup remove_all -f
44
+ sudo losetup -D
45
+ fi
Original file line number Diff line number Diff line change @@ -536,10 +536,20 @@ mod tests {
536
536
}
537
537
}
538
538
539
+ fn prepare_windows_os_disk ( _: & TempDir , image_name : & str ) -> String {
540
+ let src_osdisk = std:: env:: current_dir ( )
541
+ . unwrap ( )
542
+ . join ( "resources" )
543
+ . join ( "images" )
544
+ . join ( image_name) ;
545
+ let dest_osdisk = src_osdisk;
546
+ dest_osdisk. to_str ( ) . unwrap ( ) . to_owned ( )
547
+ }
548
+
539
549
fn test_boot_qemu_windows_common ( fw : & Firmware ) {
540
550
let tmp_dir = TempDir :: new ( ) . expect ( "Expect creating temporary directory to succeed" ) ;
541
551
let net = GuestNetworkConfig :: new ( COUNTER . fetch_add ( 1 , Ordering :: SeqCst ) as u8 ) ;
542
- let os = prepare_os_disk ( & tmp_dir, WINDOWS_IMAGE_NAME ) ;
552
+ let os = prepare_windows_os_disk ( & tmp_dir, WINDOWS_IMAGE_NAME ) ;
543
553
544
554
prepare_tap ( & net) ;
545
555
@@ -622,7 +632,7 @@ mod tests {
622
632
#[ cfg( not( feature = "coreboot" ) ) ]
623
633
fn test_boot_ch_windows ( ) {
624
634
let tmp_dir = TempDir :: new ( ) . expect ( "Expect creating temporary directory to succeed" ) ;
625
- let os = prepare_os_disk ( & tmp_dir, WINDOWS_IMAGE_NAME ) ;
635
+ let os = prepare_windows_os_disk ( & tmp_dir, WINDOWS_IMAGE_NAME ) ;
626
636
627
637
let mut c = Command :: new ( "./resources/cloud-hypervisor" ) ;
628
638
c. args ( & [
You can’t perform that action at this time.
0 commit comments