mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0028-RHEL-7-Fix-tests-for-libguestfs-winsupport-7.2.patch

491457
From 67bce5071792f8199b9a32cb8cc158b4c5b9aec8 Mon Sep 17 00:00:00 2001
4ebc84
From: "Richard W.M. Jones" <rjones@redhat.com>
4ebc84
Date: Sun, 30 Aug 2015 03:21:57 -0400
4ebc84
Subject: [PATCH] RHEL 7: Fix tests for libguestfs-winsupport 7.2.
4ebc84
4ebc84
It doesn't let us use guestfish for arbitrary Windows edits.
4ebc84
---
4ebc84
 test-data/phony-guests/make-windows-img.sh | 1 +
4ebc84
 tests/charsets/test-charset-fidelity.c     | 2 ++
4ebc84
 v2v/test-v2v-virtio-win-iso.sh             | 8 +++++++-
4ebc84
 v2v/test-v2v-windows-conversion.sh         | 8 +++++++-
4ebc84
 4 files changed, 17 insertions(+), 2 deletions(-)
4ebc84
4ebc84
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
4ebc84
index 8676b5ac0..1a88d9fc9 100755
4ebc84
--- a/test-data/phony-guests/make-windows-img.sh
4ebc84
+++ b/test-data/phony-guests/make-windows-img.sh
4ebc84
@@ -37,6 +37,7 @@ fi
4ebc84
 
4ebc84
 # Create a disk image.
4ebc84
 guestfish <
4ebc84
+set-program virt-testing
4ebc84
 sparse windows.img-t 512M
4ebc84
 run
4ebc84
 
4ebc84
diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
4ebc84
index 967afbc88..eb0491b13 100644
4ebc84
--- a/tests/charsets/test-charset-fidelity.c
4ebc84
+++ b/tests/charsets/test-charset-fidelity.c
4ebc84
@@ -93,6 +93,8 @@ main (int argc, char *argv[])
4ebc84
   if (g == NULL)
4ebc84
     error (EXIT_FAILURE, 0, "failed to create handle");
4ebc84
 
4ebc84
+  guestfs_set_program (g, "virt-testing");
4ebc84
+
4ebc84
   if (guestfs_add_drive_scratch (g, 1024*1024*1024, -1) == -1)
4ebc84
     exit (EXIT_FAILURE);
4ebc84
 
4ebc84
diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh
4ebc84
index 6e99f0f1d..a8e572c5f 100755
4ebc84
--- a/v2v/test-v2v-virtio-win-iso.sh
4ebc84
+++ b/v2v/test-v2v-virtio-win-iso.sh
4ebc84
@@ -79,6 +79,12 @@ mktest ()
4ebc84
 :> "$script"
4ebc84
 :> "$expected"
4ebc84
 
4ebc84
+cat >> "$script" <
4ebc84
+  set-program virt-testing
4ebc84
+  run
4ebc84
+  mount /dev/sda2 /
4ebc84
+EOF
4ebc84
+
4ebc84
 firstboot_dir="/Program Files/Guestfs/Firstboot"
4ebc84
 mktest "is-dir \"$firstboot_dir\"" true
4ebc84
 mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
4ebc84
@@ -91,7 +97,7 @@ for drv in netkvm vioscsi viostor; do
4ebc84
     done
4ebc84
 done
4ebc84
 
4ebc84
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
4ebc84
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
4ebc84
 diff -u "$expected" "$response"
4ebc84
 
4ebc84
 rm -r $d
4ebc84
diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh
4ebc84
index f1da222a9..ff94fe39b 100755
4ebc84
--- a/v2v/test-v2v-windows-conversion.sh
4ebc84
+++ b/v2v/test-v2v-windows-conversion.sh
4ebc84
@@ -73,6 +73,12 @@ mktest ()
4ebc84
 :> "$script"
4ebc84
 :> "$expected"
4ebc84
 
4ebc84
+cat >> "$script" <
4ebc84
+  set-program virt-testing
4ebc84
+  run
4ebc84
+  mount /dev/sda2 /
4ebc84
+EOF
4ebc84
+
4ebc84
 firstboot_dir="/Program Files/Guestfs/Firstboot"
4ebc84
 mktest "is-dir \"$firstboot_dir\"" true
4ebc84
 mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
4ebc84
@@ -85,7 +91,7 @@ for drv in netkvm qxl vioscsi viostor; do
4ebc84
     done
4ebc84
 done
4ebc84
 
4ebc84
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
4ebc84
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
4ebc84
 diff -u "$expected" "$response"
4ebc84
 
4ebc84
 # We also update the Registry several times, for firstboot, and (ONLY
4ebc84
-- 
4ebc84
2.21.0
4ebc84