tests/test-kvm.sh \
tests/test-kvm-explicit-cpu.sh \
tests/test-linux-vserver.sh \
+ tests/test-lxc.sh \
tests/test-lx86.sh \
tests/test-parallels-desktop.sh \
tests/test-qemu.sh \
tests/linux-vserver/sbin/id \
tests/linux-vserver/sbin/uname \
tests/linux-vserver/sbin/virt-what-cpuid-helper \
+ tests/lxc/proc/1/environ \
+ tests/lxc/proc/cpuinfo \
+ tests/lxc/proc/self/status \
+ tests/lxc/sbin/dmidecode \
+ tests/lxc/sbin/id \
+ tests/lxc/sbin/uname \
+ tests/lxc/sbin/virt-what-cpuid-helper \
tests/lx86/proc/cpuinfo \
tests/lx86/proc/self/status \
tests/lx86/sbin/dmidecode \
--- /dev/null
+processor : 0
+vendor_id : GenuineIntel
+cpu family : 15
+model : 4
+model name : Intel(R) Xeon(TM) CPU 3.80GHz
+stepping : 3
+microcode : 0x5
+cpu MHz : 3790.823
+cache size : 2048 KB
+physical id : 0
+siblings : 2
+core id : 0
+cpu cores : 1
+apicid : 0
+initial apicid : 0
+fpu : yes
+fpu_exception : yes
+cpuid level : 5
+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 lm constant_tsc pebs bts nopl pni dtes64 monitor ds_cpl est tm2 cid cx16 xtpr
+bogomips : 7581.64
+clflush size : 64
+cache_alignment : 128
+address sizes : 36 bits physical, 48 bits virtual
+power management:
+
--- /dev/null
+Name: cat
+State: R (running)
+Tgid: 7424
+Pid: 7424
+PPid: 7216
+TracerPid: 0
+Uid: 0 0 0 0
+Gid: 0 0 0 0
+FDSize: 256
+Groups: 0
+VmPeak: 4112 kB
+VmSize: 4112 kB
+VmLck: 0 kB
+VmPin: 0 kB
+VmHWM: 320 kB
+VmRSS: 320 kB
+VmData: 180 kB
+VmStk: 136 kB
+VmExe: 48 kB
+VmLib: 1664 kB
+VmPTE: 32 kB
+VmSwap: 0 kB
+Threads: 1
+SigQ: 4/63942
+SigPnd: 0000000000000000
+ShdPnd: 0000000000000000
+SigBlk: 0000000000000000
+SigIgn: 0000000000000000
+SigCgt: 0000000000000000
+CapInh: 0000000000000000
+CapPrm: fffffffcff9effff
+CapEff: fffffffcff9effff
+CapBnd: fffffffcff9effff
+Cpus_allowed: 0f
+Cpus_allowed_list: 0-3
+Mems_allowed: 00000000,00000001
+Mems_allowed_list: 0
+voluntary_ctxt_switches: 1
+nonvoluntary_ctxt_switches: 1
--- /dev/null
+#!/bin/sh -
+cat <<'EOF'
+# dmidecode 2.11
+/dev/mem: Operation not permitted
+EOF
+exit 1
--- /dev/null
+#!/bin/sh -
+echo x86_64
--- /dev/null
+#!/bin/sh -
+echo @
--- /dev/null
+# Test for lxc
+# 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/lxc
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="lxc"
+
+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
echo openvz
fi
+# Check for LXC containers
+# http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface
+# Added by Marc Fournier
+
+if [ -e $root/proc/1/environ ] &&
+ cat $root/proc/1/environ | tr '\000' '\n' | grep -Eiq '^container='; then
+ echo lxc
+fi
+
# Check for Linux-VServer
if cat $root/proc/self/status | grep -q "VxID: [0-9]*"; then
echo linux_vserver