virt-v2v/0002-tests-test-v2v-o-kubevirt-windows.sh-Set-fake-virtio.patch
Richard W.M. Jones 1d87979efe Fix RHV JSON transfer bug
resolves: RHEL-32105
2024-04-08 16:00:57 +01:00

71 lines
2.5 KiB
Diff

From a659b334f5b72b8a9843b1813a97114adc62a543 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 15 Mar 2024 11:34:26 +0000
Subject: [PATCH] tests/test-v2v-o-kubevirt-windows.sh: Set fake virtio-win
When converting this phony Windows guest we didn't set the VIRTIO_WIN
environment variable. As a result the test output could change (and
break) depending on if the virtio-win package was installed or not.
Point VIRTIO_WIN to the fake virtio-win directory (as we do with other
Windows tests). We also need to modify the test output since the fake
virtio-win does contain enough for virt-v2v to think that virtio
driver installation was successful.
Fixes: commit af1f7b571fb21fdbfa2974ee54a22b4fdcbc886a
---
tests/test-v2v-o-kubevirt-windows.sh | 6 +++++-
tests/test-v2v-o-kubevirt-windows.yaml.expected | 10 ++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/test-v2v-o-kubevirt-windows.sh b/tests/test-v2v-o-kubevirt-windows.sh
index 93e4d5e9..d672b9ab 100755
--- a/tests/test-v2v-o-kubevirt-windows.sh
+++ b/tests/test-v2v-o-kubevirt-windows.sh
@@ -32,6 +32,7 @@ libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml"
windows=../test-data/phony-guests/windows.img
export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
+export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
d=test-v2v-o-kubevirt-windows.d
rm -rf $d
@@ -49,7 +50,10 @@ cat $d/test.yaml
test -f $d/test-sda
# Remove some parts of the yaml which change between runs.
-sed -i -e 's/^\(# generated by virt-v2v\).*/\1/' $d/test.yaml
+sed -i \
+ -e 's/^\(# generated by virt-v2v\).*/\1/' \
+ -e 's,\(path: \).*/\(test-sda\),\1\2,' \
+ $d/test.yaml
# Compare yaml to the expected output.
diff -u test-v2v-o-kubevirt-windows.yaml.expected $d/test.yaml
diff --git a/tests/test-v2v-o-kubevirt-windows.yaml.expected b/tests/test-v2v-o-kubevirt-windows.yaml.expected
index 88f25cf1..0b12eaa9 100644
--- a/tests/test-v2v-o-kubevirt-windows.yaml.expected
+++ b/tests/test-v2v-o-kubevirt-windows.yaml.expected
@@ -25,11 +25,21 @@ spec:
cpu:
cores: 1
devices:
+ rng: {}
+ disks:
+ - disk:
+ bus: virtio
+ name: disk-0
interfaces:
- name: net_default
masquerade: {}
macAddress: 00:11:22:33:44:55
model: virtio
+ volumes:
+ - hostDisk:
+ path: test-sda
+ type: Disk
+ name: disk-0
networks:
- networkName: default
name: net_default