Blame SOURCES/0017-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch

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