From: Richard W.M. Jones Date: Wed, 19 Jan 2011 17:53:24 +0000 (+0000) Subject: Add regression test for Linux-VServer (thanks Barış Metin). X-Git-Tag: 1.6~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6997576c5b426b394a306376aa59a9b07db4df66;p=virt-what.git Add regression test for Linux-VServer (thanks Barış Metin). --- diff --git a/Makefile.am b/Makefile.am index 85dd8a3..0d59e37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,6 +33,11 @@ EXTRA_DIST = \ tests/kvm/sbin/dmidecode \ tests/kvm/sbin/id \ tests/kvm/sbin/virt-what-cpuid-helper \ + tests/linux-vserver/proc/cpuinfo \ + tests/linux-vserver/proc/self/status \ + tests/linux-vserver/sbin/dmidecode \ + tests/linux-vserver/sbin/id \ + tests/linux-vserver/sbin/virt-what-cpuid-helper \ tests/qemu/proc/cpuinfo \ tests/qemu/proc/self/status \ tests/qemu/sbin/dmidecode \ @@ -51,6 +56,7 @@ EXTRA_DIST = \ tests/test-baremetal.sh \ tests/test-esx4.1.sh \ tests/test-kvm.sh \ + tests/test-linux-vserver.sh \ tests/test-qemu.sh \ tests/test-rhel5-xen-dom0.sh \ tests/test-rhel5-xen-domU-pv.sh @@ -75,6 +81,7 @@ TESTS = \ tests/test-baremetal.sh \ tests/test-esx4.1.sh \ tests/test-kvm.sh \ + tests/test-linux-vserver.sh \ tests/test-qemu.sh \ tests/test-rhel5-xen-dom0.sh \ tests/test-rhel5-xen-domU-pv.sh diff --git a/tests/linux-vserver/proc/cpuinfo b/tests/linux-vserver/proc/cpuinfo new file mode 100644 index 0000000..3cba79a --- /dev/null +++ b/tests/linux-vserver/proc/cpuinfo @@ -0,0 +1,200 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 1 +siblings : 4 +core id : 0 +cpu cores : 4 +apicid : 16 +initial apicid : 16 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.70 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 1 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 0 +siblings : 4 +core id : 0 +cpu cores : 4 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.34 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 2 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 1 +siblings : 4 +core id : 1 +cpu cores : 4 +apicid : 18 +initial apicid : 18 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.33 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 3 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 0 +siblings : 4 +core id : 1 +cpu cores : 4 +apicid : 2 +initial apicid : 2 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.34 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 4 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 1 +siblings : 4 +core id : 2 +cpu cores : 4 +apicid : 20 +initial apicid : 20 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.32 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 5 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 0 +siblings : 4 +core id : 2 +cpu cores : 4 +apicid : 4 +initial apicid : 4 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.35 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 6 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 1 +siblings : 4 +core id : 3 +cpu cores : 4 +apicid : 22 +initial apicid : 22 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.32 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + +processor : 7 +vendor_id : GenuineIntel +cpu family : 6 +model : 26 +model name : Intel(R) Xeon(R) CPU E5506 @ 2.13GHz +stepping : 5 +cpu MHz : 2127.851 +cache size : 4096 KB +physical id : 0 +siblings : 4 +core id : 3 +cpu cores : 4 +apicid : 6 +initial apicid : 6 +fpu : yes +fpu_exception : yes +cpuid level : 11 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid +bogomips : 4255.35 +clflush size : 64 +cache_alignment : 64 +address sizes : 40 bits physical, 48 bits virtual +power management: + diff --git a/tests/linux-vserver/proc/self/status b/tests/linux-vserver/proc/self/status new file mode 100644 index 0000000..1865e9c --- /dev/null +++ b/tests/linux-vserver/proc/self/status @@ -0,0 +1,41 @@ +Name: cat +State: R (running) +Tgid: 10495 +Pid: 10495 +PPid: 10111 +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: 1912 kB +VmSize: 1912 kB +VmLck: 0 kB +VmHWM: 400 kB +VmRSS: 400 kB +VmData: 156 kB +VmStk: 84 kB +VmExe: 44 kB +VmLib: 1600 kB +VmPTE: 20 kB +Threads: 1 +SigQ: 0/387028 +SigPnd: 0000000000000000 +ShdPnd: 0000000000000000 +SigBlk: 0000000000000000 +SigIgn: 0000000000000000 +SigCgt: 0000000000000000 +CapInh: 0000000000000000 +CapPrm: ffffffffffffffff +CapEff: ffffffffffffffff +CapBnd: ffffffffffffffff +Cpus_allowed: 000000ff +Cpus_allowed_list: 0-7 +Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003 +Mems_allowed_list: 0-1 +VxID: 41639 +NxID: 41639 +voluntary_ctxt_switches: 0 +nonvoluntary_ctxt_switches: 1 +Stack usage: 4 kB diff --git a/tests/linux-vserver/sbin/dmidecode b/tests/linux-vserver/sbin/dmidecode new file mode 100755 index 0000000..7873cb9 --- /dev/null +++ b/tests/linux-vserver/sbin/dmidecode @@ -0,0 +1,5 @@ +#!/bin/sh - +cat <<'EOF' +# dmidecode 2.10 +/dev/mem: mmap: Bad address +EOF diff --git a/tests/linux-vserver/sbin/id b/tests/linux-vserver/sbin/id new file mode 100755 index 0000000..6c704ac --- /dev/null +++ b/tests/linux-vserver/sbin/id @@ -0,0 +1,2 @@ +#!/bin/sh - +echo 0 diff --git a/tests/linux-vserver/sbin/virt-what-cpuid-helper b/tests/linux-vserver/sbin/virt-what-cpuid-helper new file mode 100755 index 0000000..b446009 --- /dev/null +++ b/tests/linux-vserver/sbin/virt-what-cpuid-helper @@ -0,0 +1,2 @@ +#!/bin/sh - +echo diff --git a/tests/test-linux-vserver.sh b/tests/test-linux-vserver.sh new file mode 100755 index 0000000..40d75a5 --- /dev/null +++ b/tests/test-linux-vserver.sh @@ -0,0 +1,35 @@ +# Test for linux vserver. +# Data supplied by Barış Metin. +# 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/linux-vserver + +output="$(./virt-what --test-root=$root 2>&1)" +expected="linux_vserver" + +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