2021-08-06 12:11:05 +00:00
|
|
|
From db2150a5d790c35fb23c6d9d6b29e602482ce555 Mon Sep 17 00:00:00 2001
|
2021-05-07 12:41:15 +00:00
|
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
|
Date: Sun, 30 Aug 2015 03:21:57 -0400
|
2021-08-06 12:11:05 +00:00
|
|
|
Subject: [PATCH 06/11] RHEL: Fix tests for libguestfs-winsupport.
|
2021-05-07 12:41:15 +00:00
|
|
|
|
|
|
|
It doesn't let us use guestfish for arbitrary Windows edits.
|
|
|
|
---
|
|
|
|
test-data/phony-guests/make-windows-img.sh | 1 +
|
|
|
|
tests/test-v2v-virtio-win-iso.sh | 8 +++++++-
|
|
|
|
tests/test-v2v-windows-conversion.sh | 8 +++++++-
|
|
|
|
3 files changed, 15 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
|
|
|
|
index 30908a91..73cf5144 100755
|
|
|
|
--- a/test-data/phony-guests/make-windows-img.sh
|
|
|
|
+++ b/test-data/phony-guests/make-windows-img.sh
|
|
|
|
@@ -37,6 +37,7 @@ fi
|
|
|
|
|
|
|
|
# Create a disk image.
|
|
|
|
guestfish <<EOF
|
|
|
|
+set-program virt-testing
|
|
|
|
sparse windows.img-t 512M
|
|
|
|
run
|
|
|
|
|
|
|
|
diff --git a/tests/test-v2v-virtio-win-iso.sh b/tests/test-v2v-virtio-win-iso.sh
|
2021-08-06 12:11:05 +00:00
|
|
|
index 69f6f414..b9b806fb 100755
|
2021-05-07 12:41:15 +00:00
|
|
|
--- a/tests/test-v2v-virtio-win-iso.sh
|
|
|
|
+++ b/tests/test-v2v-virtio-win-iso.sh
|
2021-08-06 12:11:05 +00:00
|
|
|
@@ -82,6 +82,12 @@ mktest ()
|
2021-05-07 12:41:15 +00:00
|
|
|
:> "$script"
|
|
|
|
:> "$expected"
|
|
|
|
|
|
|
|
+cat >> "$script" <<EOF
|
|
|
|
+ set-program virt-testing
|
|
|
|
+ run
|
|
|
|
+ mount /dev/sda2 /
|
|
|
|
+EOF
|
|
|
|
+
|
|
|
|
firstboot_dir="/Program Files/Guestfs/Firstboot"
|
|
|
|
mktest "is-dir \"$firstboot_dir\"" true
|
|
|
|
mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
2021-08-06 12:11:05 +00:00
|
|
|
@@ -94,5 +100,5 @@ for drv in netkvm vioscsi viostor; do
|
2021-05-07 12:41:15 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
|
|
|
|
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
|
|
|
|
diff -u "$expected" "$response"
|
|
|
|
diff --git a/tests/test-v2v-windows-conversion.sh b/tests/test-v2v-windows-conversion.sh
|
2021-08-06 12:11:05 +00:00
|
|
|
index aeab9a48..4b422c5b 100755
|
2021-05-07 12:41:15 +00:00
|
|
|
--- a/tests/test-v2v-windows-conversion.sh
|
|
|
|
+++ b/tests/test-v2v-windows-conversion.sh
|
2021-08-06 12:11:05 +00:00
|
|
|
@@ -76,6 +76,12 @@ mktest ()
|
2021-05-07 12:41:15 +00:00
|
|
|
:> "$script"
|
|
|
|
:> "$expected"
|
|
|
|
|
|
|
|
+cat >> "$script" <<EOF
|
|
|
|
+ set-program virt-testing
|
|
|
|
+ run
|
|
|
|
+ mount /dev/sda2 /
|
|
|
|
+EOF
|
|
|
|
+
|
|
|
|
firstboot_dir="/Program Files/Guestfs/Firstboot"
|
|
|
|
mktest "is-dir \"$firstboot_dir\"" true
|
|
|
|
mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
2021-08-06 12:11:05 +00:00
|
|
|
@@ -88,7 +94,7 @@ for drv in netkvm qxl vioscsi viostor; do
|
2021-05-07 12:41:15 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
|
|
|
|
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
|
|
|
|
diff -u "$expected" "$response"
|
|
|
|
|
|
|
|
# We also update the Registry several times, for firstboot, and (ONLY
|
|
|
|
--
|
2021-06-30 11:00:38 +00:00
|
|
|
2.31.1
|
2021-05-07 12:41:15 +00:00
|
|
|
|