Add test for z/VM on IBM SystemZ mainframes (thanks Dan Horák).
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 20 Jan 2011 13:49:31 +0000 (08:49 -0500)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 20 Jan 2011 13:51:04 +0000 (13:51 +0000)
Makefile.am
tests/test-zvm.sh [new file with mode: 0755]
tests/zvm/proc/cpuinfo [new file with mode: 0644]
tests/zvm/proc/self/status [new file with mode: 0644]
tests/zvm/sbin/dmidecode [new file with mode: 0755]
tests/zvm/sbin/id [new file with mode: 0755]
tests/zvm/sbin/virt-what-cpuid-helper [new file with mode: 0755]
virt-what.in
virt-what.pod

index 4b54b50..e64f4e6 100644 (file)
@@ -68,6 +68,11 @@ EXTRA_DIST = \
        tests/rhel5-xen-domU-pv/sbin/dmidecode \
        tests/rhel5-xen-domU-pv/sbin/id \
        tests/rhel5-xen-domU-pv/sbin/virt-what-cpuid-helper \
+       tests/zvm/proc/cpuinfo \
+       tests/zvm/proc/self/status \
+       tests/zvm/sbin/dmidecode \
+       tests/zvm/sbin/id \
+       tests/zvm/sbin/virt-what-cpuid-helper \
        tests/test-baremetal.sh \
        tests/test-esx4.1.sh \
        tests/test-kvm.sh \
@@ -75,7 +80,8 @@ EXTRA_DIST = \
        tests/test-qemu.sh \
        tests/test-rhel5-xen-dom0.sh \
        tests/test-rhel5-xen-domU-hvm.sh \
-       tests/test-rhel5-xen-domU-pv.sh
+       tests/test-rhel5-xen-domU-pv.sh \
+       tests/test-zvm.sh
 
 CLEANFILES = virt-what.1 virt-what.txt
 
@@ -101,4 +107,5 @@ TESTS = \
        tests/test-qemu.sh \
        tests/test-rhel5-xen-dom0.sh \
        tests/test-rhel5-xen-domU-hvm.sh \
-       tests/test-rhel5-xen-domU-pv.sh
+       tests/test-rhel5-xen-domU-pv.sh \
+       tests/test-zvm.sh
diff --git a/tests/test-zvm.sh b/tests/test-zvm.sh
new file mode 100755 (executable)
index 0000000..f2f3565
--- /dev/null
@@ -0,0 +1,35 @@
+# Test for z/VM on IBM SystemZ mainframe.
+# (Thanks Dan Horák for supplying access).
+# 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/zvm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="zvm"
+
+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
diff --git a/tests/zvm/proc/cpuinfo b/tests/zvm/proc/cpuinfo
new file mode 100644 (file)
index 0000000..e252daf
--- /dev/null
@@ -0,0 +1,5 @@
+vendor_id       : IBM/S390
+# processors    : 1
+bogomips per cpu: 11061.00
+features       : esan3 zarch stfle msa ldisp eimm dfp etf3eh highgprs 
+processor 0: version = FF,  identification = 15C5C2,  machine = 2097
diff --git a/tests/zvm/proc/self/status b/tests/zvm/proc/self/status
new file mode 100644 (file)
index 0000000..de400c0
--- /dev/null
@@ -0,0 +1,49 @@
+Name:  cat
+State: R (running)
+Tgid:  8722
+Pid:   8722
+PPid:  569
+TracerPid:     0
+Uid:   0       0       0       0
+Gid:   0       0       0       0
+Utrace:        0
+FDSize:        256
+Groups:        0 1 2 3 4 6 10 
+VmPeak:           99096 kB
+VmSize:           99096 kB
+VmLck:        0 kB
+VmHWM:      564 kB
+VmRSS:      564 kB
+VmData:             176 kB
+VmStk:      136 kB
+VmExe:       48 kB
+VmLib:    98720 kB
+VmPTE:       14 kB
+VmSwap:               0 kB
+Threads:       1
+SigQ:  0/7958
+SigPnd:        0000000000000000
+ShdPnd:        0000000000000000
+SigBlk:        0000000000000000
+SigIgn:        0000000000000000
+SigCgt:        0000000000000000
+CapInh:        0000000000000000
+CapPrm:        ffffffffffffffff
+CapEff:        ffffffffffffffff
+CapBnd:        ffffffffffffffff
+Cpus_allowed:  ffffffff,ffffffff
+Cpus_allowed_list:     0-63
+Mems_allowed:  1
+Mems_allowed_list:     0
+task: 000000007c0fae50, ksp: 000000007c3d3eb8
+User PSW : 0705c00180000000 00000200001336b8
+User GPRS: 000003ff00000000 00000200001f3748 0000000000000003 000000008000f000
+           0000000000008000 000000008000e020 0000000000000000 000003ffffaa75e0
+           0000000000008000 0000000000000001 000000008000f000 0000000000000003
+           000000008000c348 0000000000008000 0000000080006746 000003ffffaa70b8
+User ACRS: 00000200 00223f10 00000000 00000000
+           00000000 00000000 00000000 00000000
+           00000000 00000000 00000000 00000000
+           00000000 00000000 00000000 00000000
+voluntary_ctxt_switches:       0
+nonvoluntary_ctxt_switches:    0
diff --git a/tests/zvm/sbin/dmidecode b/tests/zvm/sbin/dmidecode
new file mode 100755 (executable)
index 0000000..f005a9b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh -
+# dmidecode is not available on Fedora on s/390
+exit 1
diff --git a/tests/zvm/sbin/id b/tests/zvm/sbin/id
new file mode 100755 (executable)
index 0000000..6c704ac
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh -
+echo 0
diff --git a/tests/zvm/sbin/virt-what-cpuid-helper b/tests/zvm/sbin/virt-what-cpuid-helper
new file mode 100755 (executable)
index 0000000..b446009
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh -
+echo
index 22cbca1..0979c50 100644 (file)
@@ -143,6 +143,12 @@ if echo "$dmi" | grep -q 'Manufacturer.*HITACHI' &&
     echo virtage
 fi
 
+# Check for IBM SystemZ (z/VM, not tested whether this applies to Linux
+# installed directly into an LPAR, we may need a separate test).
+if grep -q '^vendor_id.*IBM/S390' $root/proc/cpuinfo; then
+    echo zvm
+fi
+
 # Check for Xen.
 
 if [ "$cpuid" = "XenVMMXenVMM" ]; then
index 288d5c6..f2f1a3f 100644 (file)
@@ -119,6 +119,14 @@ This is a Xen guest fully virtualized (HVM).
 
 Status: confirmed by RWMJ
 
+=item B<zvm>
+
+This is a z/VM guest running on an IBM SystemZ mainframe.
+
+Status: confirmed by RWMJ using a Fedora guest running in z/VM.  Not
+tested whether this also works for Linux installed directly in an
+LPAR.
+
 =back
 
 =head1 IMPORTANT NOTE