mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0142-v2v-generalize-test-v2v-i-ova-zip.sh.patch

ffd6ed
From 3e5c4536c1845f249d3cb1754195144b7aee3ba3 Mon Sep 17 00:00:00 2001
ffd6ed
From: Pino Toscano <ptoscano@redhat.com>
ffd6ed
Date: Wed, 15 Apr 2015 15:24:12 +0200
ffd6ed
Subject: [PATCH] v2v: generalize test-v2v-i-ova-zip.sh
ffd6ed
ffd6ed
Rename test-v2v-i-ova-zip.sh (and associated data) to
ffd6ed
test-v2v-i-ova-formats, and generalize it a bit so it can test different
ffd6ed
compression types for the ova "envelope".
ffd6ed
ffd6ed
(cherry picked from commit 454220ab43403ad97f02edcb2b5f71c5d21c0c25)
ffd6ed
---
ffd6ed
 v2v/Makefile.am                     |   8 +--
ffd6ed
 v2v/test-v2v-i-ova-formats.expected |  15 ++++
ffd6ed
 v2v/test-v2v-i-ova-formats.ovf      | 138 ++++++++++++++++++++++++++++++++++++
ffd6ed
 v2v/test-v2v-i-ova-formats.sh       |  94 ++++++++++++++++++++++++
ffd6ed
 v2v/test-v2v-i-ova-zip.expected     |  15 ----
ffd6ed
 v2v/test-v2v-i-ova-zip.ovf          | 138 ------------------------------------
ffd6ed
 v2v/test-v2v-i-ova-zip.sh           |  77 --------------------
ffd6ed
 7 files changed, 251 insertions(+), 234 deletions(-)
ffd6ed
 create mode 100644 v2v/test-v2v-i-ova-formats.expected
ffd6ed
 create mode 100644 v2v/test-v2v-i-ova-formats.ovf
ffd6ed
 create mode 100755 v2v/test-v2v-i-ova-formats.sh
ffd6ed
 delete mode 100644 v2v/test-v2v-i-ova-zip.expected
ffd6ed
 delete mode 100644 v2v/test-v2v-i-ova-zip.ovf
ffd6ed
 delete mode 100755 v2v/test-v2v-i-ova-zip.sh
ffd6ed
ffd6ed
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
ffd6ed
index 921fb93..731e51b 100644
ffd6ed
--- a/v2v/Makefile.am
ffd6ed
+++ b/v2v/Makefile.am
ffd6ed
@@ -23,12 +23,12 @@ EXTRA_DIST = \
ffd6ed
 	HACKING README.RHEV-M \
ffd6ed
 	test-v2v-i-ova.ovf \
ffd6ed
 	test-v2v-i-ova.xml \
ffd6ed
+	test-v2v-i-ova-formats.expected \
ffd6ed
+	test-v2v-i-ova-formats.ovf \
ffd6ed
 	test-v2v-i-ova-gz.expected \
ffd6ed
 	test-v2v-i-ova-gz.ovf \
ffd6ed
 	test-v2v-i-ova-two-disks.expected \
ffd6ed
 	test-v2v-i-ova-two-disks.ovf \
ffd6ed
-	test-v2v-i-ova-zip.expected \
ffd6ed
-	test-v2v-i-ova-zip.ovf \
ffd6ed
 	test-v2v-networks-and-bridges-expected.xml \
ffd6ed
 	test-v2v-networks-and-bridges.xml.in \
ffd6ed
 	virt-v2v.pod
ffd6ed
@@ -224,9 +224,9 @@ CLEANFILES += stamp-virt-v2v.pod
ffd6ed
 TESTS_ENVIRONMENT = $(top_builddir)/run --test
ffd6ed
 
ffd6ed
 TESTS = \
ffd6ed
+	test-v2v-i-ova-formats.sh \
ffd6ed
 	test-v2v-i-ova-gz.sh \
ffd6ed
-	test-v2v-i-ova-two-disks.sh \
ffd6ed
-	test-v2v-i-ova-zip.sh
ffd6ed
+	test-v2v-i-ova-two-disks.sh
ffd6ed
 
ffd6ed
 if ENABLE_APPLIANCE
ffd6ed
 TESTS += \
ffd6ed
diff --git a/v2v/test-v2v-i-ova-formats.expected b/v2v/test-v2v-i-ova-formats.expected
ffd6ed
new file mode 100644
ffd6ed
index 0000000..8b3d62c
ffd6ed
--- /dev/null
ffd6ed
+++ b/v2v/test-v2v-i-ova-formats.expected
ffd6ed
@@ -0,0 +1,15 @@
ffd6ed
+Source guest information (--print-source option):
ffd6ed
+
ffd6ed
+    source name: 2K8R2EESP1_2_Medium
ffd6ed
+hypervisor type: vmware
ffd6ed
+         memory: 1073741824 (bytes)
ffd6ed
+       nr vCPUs: 1
ffd6ed
+   CPU features: 
ffd6ed
+        display: 
ffd6ed
+disks:
ffd6ed
+	disk1.vmdk (vmdk) [scsi]
ffd6ed
+removable media:
ffd6ed
+	CD-ROM [ide]
ffd6ed
+NICs:
ffd6ed
+	Network "Network adapter 1"
ffd6ed
+
ffd6ed
diff --git a/v2v/test-v2v-i-ova-formats.ovf b/v2v/test-v2v-i-ova-formats.ovf
ffd6ed
new file mode 100644
ffd6ed
index 0000000..3c685f4
ffd6ed
--- /dev/null
ffd6ed
+++ b/v2v/test-v2v-i-ova-formats.ovf
ffd6ed
@@ -0,0 +1,138 @@
ffd6ed
+
ffd6ed
+<Envelope vmw:buildId="build-1750787" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
ffd6ed
+  <References>
ffd6ed
+    <File ovf:href="disk1.vmdk" ovf:id="file1" ovf:size="7804077568"/>
ffd6ed
+  </References>
ffd6ed
+  <DiskSection>
ffd6ed
+    <Info>Virtual disk information</Info>
ffd6ed
+    <Disk ovf:capacity="50" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="18975752192"/>
ffd6ed
+  </DiskSection>
ffd6ed
+  <NetworkSection>
ffd6ed
+    <Info>The list of logical networks</Info>
ffd6ed
+    <Network ovf:name="PG-VLAN60">
ffd6ed
+      <Description>The PG-VLAN60 network</Description>
ffd6ed
+    </Network>
ffd6ed
+  </NetworkSection>
ffd6ed
+  <VirtualSystem ovf:id="2K8R2EESP1_2_Medium">
ffd6ed
+    <Info>A virtual machine</Info>
ffd6ed
+    <Name>2K8R2EESP1_2_Medium</Name>
ffd6ed
+    <OperatingSystemSection ovf:id="103" vmw:osType="windows7Server64Guest">
ffd6ed
+      <Info>The kind of installed guest operating system</Info>
ffd6ed
+      <Description>Microsoft Windows Server 2008 R2 (64-bit)</Description>
ffd6ed
+    </OperatingSystemSection>
ffd6ed
+    <VirtualHardwareSection>
ffd6ed
+      <Info>Virtual hardware requirements</Info>
ffd6ed
+      <System>
ffd6ed
+        <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
ffd6ed
+        <vssd:InstanceID>0</vssd:InstanceID>
ffd6ed
+        <vssd:VirtualSystemIdentifier>2K8R2EESP1_2_Medium</vssd:VirtualSystemIdentifier>
ffd6ed
+        <vssd:VirtualSystemType>vmx-10</vssd:VirtualSystemType>
ffd6ed
+      </System>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
ffd6ed
+        <rasd:Description>Number of Virtual CPUs</rasd:Description>
ffd6ed
+        <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>1</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceType>3</rasd:ResourceType>
ffd6ed
+        <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
ffd6ed
+        <rasd:Description>Memory Size</rasd:Description>
ffd6ed
+        <rasd:ElementName>1024MB of memory</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>2</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceType>4</rasd:ResourceType>
ffd6ed
+        <rasd:VirtualQuantity>1024</rasd:VirtualQuantity>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:Address>0</rasd:Address>
ffd6ed
+        <rasd:Description>SCSI Controller</rasd:Description>
ffd6ed
+        <rasd:ElementName>SCSI controller 0</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>3</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceSubType>lsilogicsas</rasd:ResourceSubType>
ffd6ed
+        <rasd:ResourceType>6</rasd:ResourceType>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="160"/>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:Address>1</rasd:Address>
ffd6ed
+        <rasd:Description>IDE Controller</rasd:Description>
ffd6ed
+        <rasd:ElementName>IDE 1</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>4</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceType>5</rasd:ResourceType>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:Address>0</rasd:Address>
ffd6ed
+        <rasd:Description>IDE Controller</rasd:Description>
ffd6ed
+        <rasd:ElementName>IDE 0</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>5</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceType>5</rasd:ResourceType>
ffd6ed
+      </Item>
ffd6ed
+      <Item ovf:required="false">
ffd6ed
+        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
+        <rasd:ElementName>Video card</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>6</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceType>24</rasd:ResourceType>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="false"/>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="use3dRenderer" vmw:value="automatic"/>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="useAutoDetect" vmw:value="true"/>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="4096"/>
ffd6ed
+      </Item>
ffd6ed
+      <Item ovf:required="false">
ffd6ed
+        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
+        <rasd:ElementName>VMCI device</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>7</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
ffd6ed
+        <rasd:ResourceType>1</rasd:ResourceType>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="allowUnrestrictedCommunication" vmw:value="false"/>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/>
ffd6ed
+      </Item>
ffd6ed
+      <Item ovf:required="false">
ffd6ed
+        <rasd:AddressOnParent>0</rasd:AddressOnParent>
ffd6ed
+        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
+        <rasd:ElementName>CD/DVD drive 1</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>8</rasd:InstanceID>
ffd6ed
+        <rasd:Parent>4</rasd:Parent>
ffd6ed
+        <rasd:ResourceSubType>vmware.cdrom.atapi</rasd:ResourceSubType>
ffd6ed
+        <rasd:ResourceType>15</rasd:ResourceType>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:AddressOnParent>0</rasd:AddressOnParent>
ffd6ed
+        <rasd:ElementName>Hard disk 1</rasd:ElementName>
ffd6ed
+        <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
ffd6ed
+        <rasd:InstanceID>9</rasd:InstanceID>
ffd6ed
+        <rasd:Parent>3</rasd:Parent>
ffd6ed
+        <rasd:ResourceType>17</rasd:ResourceType>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/>
ffd6ed
+      </Item>
ffd6ed
+      <Item>
ffd6ed
+        <rasd:AddressOnParent>7</rasd:AddressOnParent>
ffd6ed
+        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
ffd6ed
+        <rasd:Connection>PG-VLAN60</rasd:Connection>
ffd6ed
+        <rasd:Description>E1000 ethernet adapter on "PG-VLAN60"</rasd:Description>
ffd6ed
+        <rasd:ElementName>Network adapter 1</rasd:ElementName>
ffd6ed
+        <rasd:InstanceID>11</rasd:InstanceID>
ffd6ed
+        <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
ffd6ed
+        <rasd:ResourceType>10</rasd:ResourceType>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="33"/>
ffd6ed
+        <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
ffd6ed
+      </Item>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="cpuHotRemoveEnabled" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="bios"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="virtualICH7MPresent" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="virtualSMCPresent" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="nestedHVEnabled" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="soft"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="soft"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.standbyAction" vmw:value="checkpoint"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="hard"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
ffd6ed
+      <vmw:Config ovf:required="false" vmw:key="tools.toolsUpgradePolicy" vmw:value="upgradeAtPowerCycle"/>
ffd6ed
+    </VirtualHardwareSection>
ffd6ed
+  </VirtualSystem>
ffd6ed
+</Envelope>                                 
ffd6ed
diff --git a/v2v/test-v2v-i-ova-formats.sh b/v2v/test-v2v-i-ova-formats.sh
ffd6ed
new file mode 100755
ffd6ed
index 0000000..a9b2a96
ffd6ed
--- /dev/null
ffd6ed
+++ b/v2v/test-v2v-i-ova-formats.sh
ffd6ed
@@ -0,0 +1,94 @@
ffd6ed
+#!/bin/bash -
ffd6ed
+# libguestfs virt-v2v test script
ffd6ed
+# Copyright (C) 2014-2015 Red Hat Inc.
ffd6ed
+#
ffd6ed
+# This program is free software; you can redistribute it and/or modify
ffd6ed
+# it under the terms of the GNU General Public License as published by
ffd6ed
+# the Free Software Foundation; either version 2 of the License, or
ffd6ed
+# (at your option) any later version.
ffd6ed
+#
ffd6ed
+# This program is distributed in the hope that it will be useful,
ffd6ed
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ffd6ed
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ffd6ed
+# GNU General Public License for more details.
ffd6ed
+#
ffd6ed
+# You should have received a copy of the GNU General Public License
ffd6ed
+# along with this program; if not, write to the Free Software
ffd6ed
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ffd6ed
+
ffd6ed
+# Test -i ova option with ova file compressed in different ways
ffd6ed
+
ffd6ed
+unset CDPATH
ffd6ed
+export LANG=C
ffd6ed
+set -e
ffd6ed
+
ffd6ed
+formats="tar zip"
ffd6ed
+
ffd6ed
+if [ -n "$SKIP_TEST_V2V_I_OVA_FORMATS_SH" ]; then
ffd6ed
+    echo "$0: test skipped because environment variable is set"
ffd6ed
+    exit 77
ffd6ed
+fi
ffd6ed
+
ffd6ed
+if ! zip --version >/dev/null 2>&1; then
ffd6ed
+    echo "$0: test skipped because 'zip' utility is not available"
ffd6ed
+    exit 77
ffd6ed
+fi
ffd6ed
+
ffd6ed
+if ! unzip --help >/dev/null 2>&1; then
ffd6ed
+    echo "$0: test skipped because 'unzip' utility is not available"
ffd6ed
+    exit 77
ffd6ed
+fi
ffd6ed
+
ffd6ed
+if [ "$(guestfish get-backend)" = "uml" ]; then
ffd6ed
+    echo "$0: test skipped because UML backend does not support network"
ffd6ed
+    exit 77
ffd6ed
+fi
ffd6ed
+
ffd6ed
+virt_tools_data_dir=${VIRT_TOOLS_DATA_DIR:-/usr/share/virt-tools}
ffd6ed
+if ! test -r $virt_tools_data_dir/rhsrvany.exe; then
ffd6ed
+    echo "$0: test skipped because rhsrvany.exe is not installed"
ffd6ed
+    exit 77
ffd6ed
+fi
ffd6ed
+
ffd6ed
+d=test-v2v-i-ova-formats.d
ffd6ed
+rm -rf $d
ffd6ed
+mkdir $d
ffd6ed
+
ffd6ed
+pushd $d
ffd6ed
+
ffd6ed
+# Create a phony OVA.  This is only a test of source parsing, not
ffd6ed
+# conversion, so the contents of the disks doesn't matter.
ffd6ed
+truncate -s 10k disk1.vmdk
ffd6ed
+sha=`sha1sum disk1.vmdk | awk '{print $1}'`
ffd6ed
+echo -e "SHA1(disk1.vmdk)=$sha\r" > disk1.mf
ffd6ed
+
ffd6ed
+for format in $formats; do
ffd6ed
+    case "$format" in
ffd6ed
+        tar)
ffd6ed
+            tar -cf test-$format.ova ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
ffd6ed
+            ;;
ffd6ed
+        zip)
ffd6ed
+            zip -r test ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
ffd6ed
+            mv test.zip test-$format.ova
ffd6ed
+            ;;
ffd6ed
+        *)
ffd6ed
+            echo "Unhandled format '$format'"
ffd6ed
+            exit 1
ffd6ed
+    esac
ffd6ed
+done
ffd6ed
+
ffd6ed
+popd
ffd6ed
+
ffd6ed
+for format in $formats; do
ffd6ed
+    # Run virt-v2v but only as far as the --print-source stage, and
ffd6ed
+    # normalize the output.
ffd6ed
+    $VG virt-v2v --debug-gc --quiet \
ffd6ed
+        -i ova $d/test-$format.ova \
ffd6ed
+        --print-source |
ffd6ed
+    sed 's,[^ \t]*\(disk.*.vmdk\),\1,' > $d/source
ffd6ed
+
ffd6ed
+    # Check the parsed source is what we expect.
ffd6ed
+    diff -u test-v2v-i-ova-formats.expected $d/source
ffd6ed
+done
ffd6ed
+
ffd6ed
+rm -rf $d
ffd6ed
diff --git a/v2v/test-v2v-i-ova-zip.expected b/v2v/test-v2v-i-ova-zip.expected
ffd6ed
deleted file mode 100644
ffd6ed
index 8b3d62c..0000000
ffd6ed
--- a/v2v/test-v2v-i-ova-zip.expected
ffd6ed
+++ /dev/null
ffd6ed
@@ -1,15 +0,0 @@
ffd6ed
-Source guest information (--print-source option):
ffd6ed
-
ffd6ed
-    source name: 2K8R2EESP1_2_Medium
ffd6ed
-hypervisor type: vmware
ffd6ed
-         memory: 1073741824 (bytes)
ffd6ed
-       nr vCPUs: 1
ffd6ed
-   CPU features: 
ffd6ed
-        display: 
ffd6ed
-disks:
ffd6ed
-	disk1.vmdk (vmdk) [scsi]
ffd6ed
-removable media:
ffd6ed
-	CD-ROM [ide]
ffd6ed
-NICs:
ffd6ed
-	Network "Network adapter 1"
ffd6ed
-
ffd6ed
diff --git a/v2v/test-v2v-i-ova-zip.ovf b/v2v/test-v2v-i-ova-zip.ovf
ffd6ed
deleted file mode 100644
ffd6ed
index 3c685f4..0000000
ffd6ed
--- a/v2v/test-v2v-i-ova-zip.ovf
ffd6ed
+++ /dev/null
ffd6ed
@@ -1,138 +0,0 @@
ffd6ed
-
ffd6ed
-<Envelope vmw:buildId="build-1750787" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
ffd6ed
-  <References>
ffd6ed
-    <File ovf:href="disk1.vmdk" ovf:id="file1" ovf:size="7804077568"/>
ffd6ed
-  </References>
ffd6ed
-  <DiskSection>
ffd6ed
-    <Info>Virtual disk information</Info>
ffd6ed
-    <Disk ovf:capacity="50" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="18975752192"/>
ffd6ed
-  </DiskSection>
ffd6ed
-  <NetworkSection>
ffd6ed
-    <Info>The list of logical networks</Info>
ffd6ed
-    <Network ovf:name="PG-VLAN60">
ffd6ed
-      <Description>The PG-VLAN60 network</Description>
ffd6ed
-    </Network>
ffd6ed
-  </NetworkSection>
ffd6ed
-  <VirtualSystem ovf:id="2K8R2EESP1_2_Medium">
ffd6ed
-    <Info>A virtual machine</Info>
ffd6ed
-    <Name>2K8R2EESP1_2_Medium</Name>
ffd6ed
-    <OperatingSystemSection ovf:id="103" vmw:osType="windows7Server64Guest">
ffd6ed
-      <Info>The kind of installed guest operating system</Info>
ffd6ed
-      <Description>Microsoft Windows Server 2008 R2 (64-bit)</Description>
ffd6ed
-    </OperatingSystemSection>
ffd6ed
-    <VirtualHardwareSection>
ffd6ed
-      <Info>Virtual hardware requirements</Info>
ffd6ed
-      <System>
ffd6ed
-        <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
ffd6ed
-        <vssd:InstanceID>0</vssd:InstanceID>
ffd6ed
-        <vssd:VirtualSystemIdentifier>2K8R2EESP1_2_Medium</vssd:VirtualSystemIdentifier>
ffd6ed
-        <vssd:VirtualSystemType>vmx-10</vssd:VirtualSystemType>
ffd6ed
-      </System>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
ffd6ed
-        <rasd:Description>Number of Virtual CPUs</rasd:Description>
ffd6ed
-        <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>1</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceType>3</rasd:ResourceType>
ffd6ed
-        <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
ffd6ed
-        <rasd:Description>Memory Size</rasd:Description>
ffd6ed
-        <rasd:ElementName>1024MB of memory</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>2</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceType>4</rasd:ResourceType>
ffd6ed
-        <rasd:VirtualQuantity>1024</rasd:VirtualQuantity>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:Address>0</rasd:Address>
ffd6ed
-        <rasd:Description>SCSI Controller</rasd:Description>
ffd6ed
-        <rasd:ElementName>SCSI controller 0</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>3</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceSubType>lsilogicsas</rasd:ResourceSubType>
ffd6ed
-        <rasd:ResourceType>6</rasd:ResourceType>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="160"/>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:Address>1</rasd:Address>
ffd6ed
-        <rasd:Description>IDE Controller</rasd:Description>
ffd6ed
-        <rasd:ElementName>IDE 1</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>4</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceType>5</rasd:ResourceType>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:Address>0</rasd:Address>
ffd6ed
-        <rasd:Description>IDE Controller</rasd:Description>
ffd6ed
-        <rasd:ElementName>IDE 0</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>5</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceType>5</rasd:ResourceType>
ffd6ed
-      </Item>
ffd6ed
-      <Item ovf:required="false">
ffd6ed
-        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
-        <rasd:ElementName>Video card</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>6</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceType>24</rasd:ResourceType>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="false"/>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="use3dRenderer" vmw:value="automatic"/>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="useAutoDetect" vmw:value="true"/>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="4096"/>
ffd6ed
-      </Item>
ffd6ed
-      <Item ovf:required="false">
ffd6ed
-        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
-        <rasd:ElementName>VMCI device</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>7</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
ffd6ed
-        <rasd:ResourceType>1</rasd:ResourceType>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="allowUnrestrictedCommunication" vmw:value="false"/>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/>
ffd6ed
-      </Item>
ffd6ed
-      <Item ovf:required="false">
ffd6ed
-        <rasd:AddressOnParent>0</rasd:AddressOnParent>
ffd6ed
-        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
ffd6ed
-        <rasd:ElementName>CD/DVD drive 1</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>8</rasd:InstanceID>
ffd6ed
-        <rasd:Parent>4</rasd:Parent>
ffd6ed
-        <rasd:ResourceSubType>vmware.cdrom.atapi</rasd:ResourceSubType>
ffd6ed
-        <rasd:ResourceType>15</rasd:ResourceType>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:AddressOnParent>0</rasd:AddressOnParent>
ffd6ed
-        <rasd:ElementName>Hard disk 1</rasd:ElementName>
ffd6ed
-        <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
ffd6ed
-        <rasd:InstanceID>9</rasd:InstanceID>
ffd6ed
-        <rasd:Parent>3</rasd:Parent>
ffd6ed
-        <rasd:ResourceType>17</rasd:ResourceType>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/>
ffd6ed
-      </Item>
ffd6ed
-      <Item>
ffd6ed
-        <rasd:AddressOnParent>7</rasd:AddressOnParent>
ffd6ed
-        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
ffd6ed
-        <rasd:Connection>PG-VLAN60</rasd:Connection>
ffd6ed
-        <rasd:Description>E1000 ethernet adapter on "PG-VLAN60"</rasd:Description>
ffd6ed
-        <rasd:ElementName>Network adapter 1</rasd:ElementName>
ffd6ed
-        <rasd:InstanceID>11</rasd:InstanceID>
ffd6ed
-        <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
ffd6ed
-        <rasd:ResourceType>10</rasd:ResourceType>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="33"/>
ffd6ed
-        <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
ffd6ed
-      </Item>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="cpuHotRemoveEnabled" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="bios"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="virtualICH7MPresent" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="virtualSMCPresent" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="nestedHVEnabled" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="soft"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="soft"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.standbyAction" vmw:value="checkpoint"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="hard"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
ffd6ed
-      <vmw:Config ovf:required="false" vmw:key="tools.toolsUpgradePolicy" vmw:value="upgradeAtPowerCycle"/>
ffd6ed
-    </VirtualHardwareSection>
ffd6ed
-  </VirtualSystem>
ffd6ed
-</Envelope>                                 
ffd6ed
diff --git a/v2v/test-v2v-i-ova-zip.sh b/v2v/test-v2v-i-ova-zip.sh
ffd6ed
deleted file mode 100755
ffd6ed
index cd1e258..0000000
ffd6ed
--- a/v2v/test-v2v-i-ova-zip.sh
ffd6ed
+++ /dev/null
ffd6ed
@@ -1,77 +0,0 @@
ffd6ed
-#!/bin/bash -
ffd6ed
-# libguestfs virt-v2v test script
ffd6ed
-# Copyright (C) 2014 Red Hat Inc.
ffd6ed
-#
ffd6ed
-# This program is free software; you can redistribute it and/or modify
ffd6ed
-# it under the terms of the GNU General Public License as published by
ffd6ed
-# the Free Software Foundation; either version 2 of the License, or
ffd6ed
-# (at your option) any later version.
ffd6ed
-#
ffd6ed
-# This program is distributed in the hope that it will be useful,
ffd6ed
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
ffd6ed
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ffd6ed
-# GNU General Public License for more details.
ffd6ed
-#
ffd6ed
-# You should have received a copy of the GNU General Public License
ffd6ed
-# along with this program; if not, write to the Free Software
ffd6ed
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ffd6ed
-
ffd6ed
-# Test -i ova option with a zip file.
ffd6ed
-
ffd6ed
-unset CDPATH
ffd6ed
-export LANG=C
ffd6ed
-set -e
ffd6ed
-
ffd6ed
-if [ -n "$SKIP_TEST_V2V_I_OVA_ZIP_SH" ]; then
ffd6ed
-    echo "$0: test skipped because environment variable is set"
ffd6ed
-    exit 77
ffd6ed
-fi
ffd6ed
-
ffd6ed
-if ! zip --version >/dev/null 2>&1; then
ffd6ed
-    echo "$0: test skipped because 'zip' utility is not available"
ffd6ed
-    exit 77
ffd6ed
-fi
ffd6ed
-
ffd6ed
-if ! unzip --help >/dev/null 2>&1; then
ffd6ed
-    echo "$0: test skipped because 'unzip' utility is not available"
ffd6ed
-    exit 77
ffd6ed
-fi
ffd6ed
-
ffd6ed
-if [ "$(guestfish get-backend)" = "uml" ]; then
ffd6ed
-    echo "$0: test skipped because UML backend does not support network"
ffd6ed
-    exit 77
ffd6ed
-fi
ffd6ed
-
ffd6ed
-virt_tools_data_dir=${VIRT_TOOLS_DATA_DIR:-/usr/share/virt-tools}
ffd6ed
-if ! test -r $virt_tools_data_dir/rhsrvany.exe; then
ffd6ed
-    echo "$0: test skipped because rhsrvany.exe is not installed"
ffd6ed
-    exit 77
ffd6ed
-fi
ffd6ed
-
ffd6ed
-d=test-v2v-i-ova-zip.d
ffd6ed
-rm -rf $d
ffd6ed
-mkdir $d
ffd6ed
-
ffd6ed
-pushd $d
ffd6ed
-
ffd6ed
-# Create a phony OVA.  This is only a test of source parsing, not
ffd6ed
-# conversion, so the contents of the disks doesn't matter.
ffd6ed
-truncate -s 10k disk1.vmdk
ffd6ed
-sha=`sha1sum disk1.vmdk | awk '{print $1}'`
ffd6ed
-echo -e "SHA1(disk1.vmdk)=$sha\r" > disk1.mf
ffd6ed
-
ffd6ed
-zip -r test ../test-v2v-i-ova-zip.ovf disk1.vmdk disk1.mf
ffd6ed
-mv test.zip test.ova
ffd6ed
-popd
ffd6ed
-
ffd6ed
-# Run virt-v2v but only as far as the --print-source stage, and
ffd6ed
-# normalize the output.
ffd6ed
-$VG virt-v2v --debug-gc --quiet \
ffd6ed
-    -i ova $d/test.ova \
ffd6ed
-    --print-source |
ffd6ed
-sed 's,[^ \t]*\(disk.*.vmdk\),\1,' > $d/source
ffd6ed
-
ffd6ed
-# Check the parsed source is what we expect.
ffd6ed
-diff -u test-v2v-i-ova-zip.expected $d/source
ffd6ed
-
ffd6ed
-rm -rf $d
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed