Add regression test for RHEL 5 Xen DomU HVM (aka full virtualization).
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 19 Jan 2011 18:28:33 +0000 (18:28 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 19 Jan 2011 18:28:33 +0000 (18:28 +0000)
Makefile.am
tests/rhel5-xen-domU-hvm/proc/cpuinfo [new file with mode: 0644]
tests/rhel5-xen-domU-hvm/proc/self/status [new file with mode: 0644]
tests/rhel5-xen-domU-hvm/sbin/dmidecode [new file with mode: 0755]
tests/rhel5-xen-domU-hvm/sbin/id [new file with mode: 0755]
tests/rhel5-xen-domU-hvm/sbin/virt-what-cpuid-helper [new file with mode: 0755]
tests/test-rhel5-xen-domU-hvm.sh [new file with mode: 0755]

index 0d59e37..08336d7 100644 (file)
@@ -48,6 +48,11 @@ EXTRA_DIST = \
        tests/rhel5-xen-dom0/sbin/dmidecode \
        tests/rhel5-xen-dom0/sbin/id \
        tests/rhel5-xen-dom0/sbin/virt-what-cpuid-helper \
+       tests/rhel5-xen-domU-hvm/proc/cpuinfo \
+       tests/rhel5-xen-domU-hvm/proc/self/status \
+       tests/rhel5-xen-domU-hvm/sbin/dmidecode \
+       tests/rhel5-xen-domU-hvm/sbin/id \
+       tests/rhel5-xen-domU-hvm/sbin/virt-what-cpuid-helper \
        tests/rhel5-xen-domU-pv/proc/cpuinfo \
        tests/rhel5-xen-domU-pv/proc/self/status \
        tests/rhel5-xen-domU-pv/sbin/dmidecode \
@@ -59,6 +64,7 @@ EXTRA_DIST = \
        tests/test-linux-vserver.sh \
        tests/test-qemu.sh \
        tests/test-rhel5-xen-dom0.sh \
+       tests/test-rhel5-xen-domU-hvm.sh \
        tests/test-rhel5-xen-domU-pv.sh
 
 CLEANFILES = virt-what.1 virt-what.txt
@@ -84,4 +90,5 @@ TESTS = \
        tests/test-linux-vserver.sh \
        tests/test-qemu.sh \
        tests/test-rhel5-xen-dom0.sh \
+       tests/test-rhel5-xen-domU-hvm.sh \
        tests/test-rhel5-xen-domU-pv.sh
diff --git a/tests/rhel5-xen-domU-hvm/proc/cpuinfo b/tests/rhel5-xen-domU-hvm/proc/cpuinfo
new file mode 100644 (file)
index 0000000..f531e5e
--- /dev/null
@@ -0,0 +1,19 @@
+processor      : 0
+vendor_id      : GenuineIntel
+cpu family     : 6
+model          : 15
+model name     : Intel(R) Core(TM)2 CPU         T7600  @ 2.33GHz
+stepping       : 6
+cpu MHz                : 2327.526
+cache size     : 4096 KB
+fpu            : yes
+fpu_exception  : yes
+cpuid level    : 10
+wp             : yes
+flags          : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts mmx fxsr sse sse2 ss syscall nx lm constant_tsc up pni ds_cpl ssse3 cx16 xtpr lahf_lm
+bogomips       : 4655.05
+clflush size   : 64
+cache_alignment        : 64
+address sizes  : 36 bits physical, 48 bits virtual
+power management:
+
diff --git a/tests/rhel5-xen-domU-hvm/proc/self/status b/tests/rhel5-xen-domU-hvm/proc/self/status
new file mode 100644 (file)
index 0000000..aaaf444
--- /dev/null
@@ -0,0 +1,36 @@
+Name:  cat
+State: R (running)
+SleepAVG:      88%
+Tgid:  3628
+Pid:   3628
+PPid:  3605
+TracerPid:     0
+Uid:   0       0       0       0
+Gid:   0       0       0       0
+FDSize:        256
+Groups:        0 1 2 3 4 6 10 
+VmPeak:           58952 kB
+VmSize:           58952 kB
+VmLck:        0 kB
+VmHWM:      528 kB
+VmRSS:      528 kB
+VmData:             180 kB
+VmStk:       88 kB
+VmExe:       20 kB
+VmLib:     1448 kB
+VmPTE:       36 kB
+StaBrk:        0af9e000 kB
+Brk:   0afbf000 kB
+StaStk:        7fff203f25f0 kB
+Threads:       1
+SigQ:  1/6143
+SigPnd:        0000000000000000
+ShdPnd:        0000000000000000
+SigBlk:        0000000000000000
+SigIgn:        0000000000000000
+SigCgt:        0000000000000000
+CapInh:        0000000000000000
+CapPrm:        00000000fffffeff
+CapEff:        00000000fffffeff
+Cpus_allowed:  00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
+Mems_allowed:  00000000,00000001
diff --git a/tests/rhel5-xen-domU-hvm/sbin/dmidecode b/tests/rhel5-xen-domU-hvm/sbin/dmidecode
new file mode 100755 (executable)
index 0000000..09be807
--- /dev/null
@@ -0,0 +1,107 @@
+#!/bin/sh -
+# See https://bugzilla.redhat.com/show_bug.cgi?id=210295
+cat <<'EOF'
+# dmidecode 2.10
+SMBIOS 2.4 present.
+10 structures occupying 339 bytes.
+Table at 0x000E901F.
+
+Handle 0x0000, DMI type 0, 24 bytes
+BIOS Information
+       Vendor: Xen
+       Version: 3.1.2-238.el5
+       Release Date: 11/24/2010
+       Address: 0xE8000
+       Runtime Size: 96 kB
+       ROM Size: 64 kB
+       Characteristics:
+               Targeted content distribution is supported
+       BIOS Revision: 3.1
+
+Handle 0x0100, DMI type 1, 27 bytes
+System Information
+       Manufacturer: Red Hat
+       Product Name: HVM domU
+       Version: 3.1.2-238.el5
+       Serial Number: 5ad07c4a-6de5-e601-46f2-afc24984a3c0
+       UUID: 5AD07C4A-6DE5-E601-46F2-AFC24984A3C0
+       Wake-up Type: Power Switch
+       SKU Number: Not Specified
+       Family: Red Hat Enterprise Linux
+
+Handle 0x0300, DMI type 3, 13 bytes
+Chassis Information
+       Manufacturer: Red Hat
+       Type: Other
+       Lock: Not Present
+       Version: Not Specified
+       Serial Number: Not Specified
+       Asset Tag: Not Specified
+       Boot-up State: Safe
+       Power Supply State: Safe
+       Thermal State: Safe
+       Security Status: Unknown
+
+Handle 0x0401, DMI type 4, 26 bytes
+Processor Information
+       Socket Designation: CPU 1
+       Type: Central Processor
+       Family: Other
+       Manufacturer: Intel
+       ID: F6 06 00 00 FF FB A9 8F
+       Version: Not Specified
+       Voltage: Unknown
+       External Clock: Unknown
+       Max Speed: 2000 MHz
+       Current Speed: 2000 MHz
+       Status: Populated, Enabled
+       Upgrade: Other
+
+Handle 0x1000, DMI type 16, 15 bytes
+Physical Memory Array
+       Location: Other
+       Use: System Memory
+       Error Correction Type: Multi-bit ECC
+       Maximum Capacity: 768 MB
+       Error Information Handle: Not Provided
+       Number Of Devices: 1
+
+Handle 0x1100, DMI type 17, 21 bytes
+Memory Device
+       Array Handle: 0x1000
+       Error Information Handle: 0x0000
+       Total Width: 64 bits
+       Data Width: 64 bits
+       Size: 768 MB
+       Form Factor: DIMM
+       Set: None
+       Locator: DIMM 1
+       Bank Locator: Not Specified
+       Type: RAM
+       Type Detail: None
+
+Handle 0x1300, DMI type 19, 15 bytes
+Memory Array Mapped Address
+       Starting Address: 0x00000000000
+       Ending Address: 0x0002FF003FF
+       Range Size: 785409 kB
+       Physical Array Handle: 0x1000
+       Partition Width: 0
+
+Handle 0x1400, DMI type 20, 19 bytes
+Memory Device Mapped Address
+       Starting Address: 0x00000000000
+       Ending Address: 0x0002FF003FF
+       Range Size: 785409 kB
+       Physical Device Handle: 0x1100
+       Memory Array Mapped Address Handle: 0x1300
+       Partition Row Position: 1
+
+Handle 0x2000, DMI type 32, 11 bytes
+System Boot Information
+       Status: No errors detected
+
+Handle 0x7F00, DMI type 127, 4 bytes
+End Of Table
+
+EOF
diff --git a/tests/rhel5-xen-domU-hvm/sbin/id b/tests/rhel5-xen-domU-hvm/sbin/id
new file mode 100755 (executable)
index 0000000..6c704ac
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh -
+echo 0
diff --git a/tests/rhel5-xen-domU-hvm/sbin/virt-what-cpuid-helper b/tests/rhel5-xen-domU-hvm/sbin/virt-what-cpuid-helper
new file mode 100755 (executable)
index 0000000..8d8df4a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh -
+echo XenVMMXenVMM
diff --git a/tests/test-rhel5-xen-domU-hvm.sh b/tests/test-rhel5-xen-domU-hvm.sh
new file mode 100755 (executable)
index 0000000..593fdb7
--- /dev/null
@@ -0,0 +1,35 @@
+# Test for RHEL 5 Xen DomU HVM (aka full virtualization).
+# Copyright (C) 2008-2011 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+root=tests/rhel5-xen-domU-hvm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="xen
+xen-hvm"
+
+if [ "$output" != "$expected" ]; then
+    echo "$0: test failed because output did not match expected"
+    echo "Expected output was:"
+    echo "----------------------------------------"
+    echo "$expected"
+    echo "----------------------------------------"
+    echo "But the actual output of the program was:"
+    echo "----------------------------------------"
+    echo "$output"
+    echo "----------------------------------------"
+    exit 1
+fi