Roman Kagan
2015-Oct-08 13:50 UTC
[Libguestfs] [PATCH v2 4/5] v2v:tests: use fake virtio-win drivers
In order to test the copying of virtio-win drivers into the guest during v2v, create a set of fake virtio-win drivers and make use of them in the corresponding v2v tests. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- changes since v1: - moved fake-virtio-win under v2v - referred to fake-virtio-win stuff via $PWD in test scripts - updated Makefile to package the newly added files (unreliable since make dist is still broken) v2v/Makefile.am | 4 ++++ v2v/fake-virtio-win/drivers/i386/Win7/netkvm.cat | 1 + v2v/fake-virtio-win/drivers/i386/Win7/netkvm.inf | 1 + v2v/fake-virtio-win/drivers/i386/Win7/netkvm.sys | 1 + v2v/fake-virtio-win/drivers/i386/Win7/qxl.cat | 1 + v2v/fake-virtio-win/drivers/i386/Win7/qxl.inf | 1 + v2v/fake-virtio-win/drivers/i386/Win7/qxl.sys | 1 + v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.cat | 1 + v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.inf | 1 + v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.sys | 1 + v2v/fake-virtio-win/drivers/i386/Win7/viostor.cat | 1 + v2v/fake-virtio-win/drivers/i386/Win7/viostor.inf | 1 + v2v/fake-virtio-win/drivers/i386/Win7/viostor.sys | 1 + v2v/test-v2v-cdrom.sh | 1 + v2v/test-v2v-i-ova-two-disks.sh | 1 + v2v/test-v2v-i-ova.sh | 1 + v2v/test-v2v-windows-conversion.sh | 16 ++++++++++++---- 17 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/netkvm.cat create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/netkvm.inf create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/netkvm.sys create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/qxl.cat create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/qxl.inf create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/qxl.sys create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.cat create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.inf create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.sys create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/viostor.cat create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/viostor.inf create mode 100644 v2v/fake-virtio-win/drivers/i386/Win7/viostor.sys diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 9af5d2c..159141f 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -22,6 +22,7 @@ EXTRA_DIST = \ v2v_unit_tests.ml \ $(TESTS) $(SLOW_TESTS) \ $(FAKE_VIRT_TOOLS) \ + $(FAKE_VIRTIO_WIN) \ HACKING \ test-v2v-cdrom.expected \ test-v2v-cdrom.xml \ @@ -112,6 +113,9 @@ FAKE_VIRT_TOOLS = \ $(fake_virt_tools_dir)/rhsrvany.exe \ $(fake_virt_tools_dir)/rhev-apt.exe +fake_virtio_win_dir = fake-virtio-win +FAKE_VIRTIO_WIN = $(wildcard $(fake_virtio_win_dir)/*/*/*/*) + if HAVE_OCAML bin_PROGRAMS = virt-v2v diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.cat b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.cat new file mode 100644 index 0000000..be81e94 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.cat @@ -0,0 +1 @@ +This is a fake netkvm.cat, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.inf b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.inf new file mode 100644 index 0000000..ab4a68f --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.inf @@ -0,0 +1 @@ +This is a fake netkvm.inf, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.sys b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.sys new file mode 100644 index 0000000..3a2afae --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/netkvm.sys @@ -0,0 +1 @@ +This is a fake netkvm.sys, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/qxl.cat b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.cat new file mode 100644 index 0000000..0af6a9a --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.cat @@ -0,0 +1 @@ +This is a fake qxl.cat, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/qxl.inf b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.inf new file mode 100644 index 0000000..3fb759d --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.inf @@ -0,0 +1 @@ +This is a fake qxl.inf, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/qxl.sys b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.sys new file mode 100644 index 0000000..118ede0 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/qxl.sys @@ -0,0 +1 @@ +This is a fake qxl.sys, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.cat b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.cat new file mode 100644 index 0000000..056535f --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.cat @@ -0,0 +1 @@ +This is a fake vioscsi.cat, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.inf b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.inf new file mode 100644 index 0000000..97b3884 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.inf @@ -0,0 +1 @@ +This is a fake vioscsi.inf, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.sys b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.sys new file mode 100644 index 0000000..102a797 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/vioscsi.sys @@ -0,0 +1 @@ +This is a fake vioscsi.sys, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/viostor.cat b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.cat new file mode 100644 index 0000000..6c32f85 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.cat @@ -0,0 +1 @@ +This is a fake viostor.cat, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/viostor.inf b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.inf new file mode 100644 index 0000000..18f416d --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.inf @@ -0,0 +1 @@ +This is a fake viostor.inf, used for testing only diff --git a/v2v/fake-virtio-win/drivers/i386/Win7/viostor.sys b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.sys new file mode 100644 index 0000000..3f9c147 --- /dev/null +++ b/v2v/fake-virtio-win/drivers/i386/Win7/viostor.sys @@ -0,0 +1 @@ +This is a fake viostor.sys, used for testing only diff --git a/v2v/test-v2v-cdrom.sh b/v2v/test-v2v-cdrom.sh index 1b03b13..42c8347 100755 --- a/v2v/test-v2v-cdrom.sh +++ b/v2v/test-v2v-cdrom.sh @@ -49,6 +49,7 @@ if ! test -f $f || ! test -s $f; then fi export VIRT_TOOLS_DATA_DIR="$PWD/fake-virt-tools" +export VIRTIO_WIN="$PWD/fake-virtio-win" d=test-v2v-cdrom.d rm -rf $d diff --git a/v2v/test-v2v-i-ova-two-disks.sh b/v2v/test-v2v-i-ova-two-disks.sh index ea50f16..fc7ace7 100755 --- a/v2v/test-v2v-i-ova-two-disks.sh +++ b/v2v/test-v2v-i-ova-two-disks.sh @@ -33,6 +33,7 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi export VIRT_TOOLS_DATA_DIR="$PWD/fake-virt-tools" +export VIRTIO_WIN="$PWD/fake-virtio-win" d=test-v2v-i-ova-two-disks.d rm -rf $d diff --git a/v2v/test-v2v-i-ova.sh b/v2v/test-v2v-i-ova.sh index 1ec6cce..266382e 100755 --- a/v2v/test-v2v-i-ova.sh +++ b/v2v/test-v2v-i-ova.sh @@ -39,6 +39,7 @@ if ! test -f $f || ! test -s $f; then fi export VIRT_TOOLS_DATA_DIR="$PWD/fake-virt-tools" +export VIRTIO_WIN="$PWD/fake-virtio-win" d=test-v2v-i-ova.d rm -rf $d diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh index 3e3d645..d086bc4 100755 --- a/v2v/test-v2v-windows-conversion.sh +++ b/v2v/test-v2v-windows-conversion.sh @@ -42,6 +42,7 @@ if ! test -f $f || ! test -s $f; then fi export VIRT_TOOLS_DATA_DIR="$PWD/fake-virt-tools" +export VIRTIO_WIN="$PWD/fake-virtio-win" # Return a random element from the array 'choices'. function random_choice @@ -85,10 +86,17 @@ mktest () :> "$script" :> "$expected" -mktest "is-dir \"/Program Files/Red Hat/Firstboot\"" true -mktest "is-file \"/Program Files/Red Hat/Firstboot/firstboot.bat\"" true -mktest "is-dir \"/Program Files/Red Hat/Firstboot/scripts\"" true -mktest "is-dir \"/Windows/Drivers/VirtIO\"" true +firstboot_dir="/Program Files/Red Hat/Firstboot" +mktest "is-dir \"$firstboot_dir\"" true +mktest "is-file \"$firstboot_dir/firstboot.bat\"" true +mktest "is-dir \"$firstboot_dir/scripts\"" true +virtio_dir="/Windows/Drivers/VirtIO" +mktest "is-dir \"$virtio_dir\"" true +for drv in netkvm qxl vioscsi viostor; do + for sfx in cat inf sys; do + mktest "is-file \"$virtio_dir/$drv.$sfx\"" true + done +done guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response" diff -u "$expected" "$response" -- 2.4.3
Richard W.M. Jones
2015-Oct-08 14:53 UTC
Re: [Libguestfs] [PATCH v2 4/5] v2v:tests: use fake virtio-win drivers
I'm just testing patches 1-3, and if they pass I will push them. On Thu, Oct 08, 2015 at 04:50:35PM +0300, Roman Kagan wrote:> +fake_virtio_win_dir = fake-virtio-win > +FAKE_VIRTIO_WIN = $(wildcard $(fake_virtio_win_dir)/*/*/*/*)Why the fake_virtio_win_dir variable? Unfortunately automake treats variables that have '*dir' in the name specially, but in this case I don't think you intended that. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Roman Kagan
2015-Oct-08 15:16 UTC
Re: [Libguestfs] [PATCH v2 4/5] v2v:tests: use fake virtio-win drivers
On Thu, Oct 08, 2015 at 03:53:24PM +0100, Richard W.M. Jones wrote:> I'm just testing patches 1-3, and if they pass I will push them. > > On Thu, Oct 08, 2015 at 04:50:35PM +0300, Roman Kagan wrote: > > +fake_virtio_win_dir = fake-virtio-win > > +FAKE_VIRTIO_WIN = $(wildcard $(fake_virtio_win_dir)/*/*/*/*) > > Why the fake_virtio_win_dir variable? Unfortunately automake treats > variables that have '*dir' in the name specially, but in this case I > don't think you intended that.Absolutely not. I'm basically uninitiated in auto-foo and had no idea this could mean anything special to automake; I just needed a simple make variable. I've checked that it propagated as I expected into Makefile.in and then into Makefile, and that looked like enough to me. BTW patch 1 introduces fake_virt_tools_dir which probably has the same concern, doesn't it? Roman.
Reasonably Related Threads
- Re: [PATCH v2 4/5] v2v:tests: use fake virtio-win drivers
- [PATCH v2 4/5] v2v:tests: use fake virtio-win drivers
- [PATCH v2 5/5] v2v: add test for v2v with virtio-win drivers on iso
- Re: [PATCH 1/6] tests: use fake rhsrvany.exe
- Re: [PATCH 0/4] v2v: simplify driver copying from virtio-win iso