tests/test-kvm.sh \
tests/test-kvm-explicit-cpu.sh \
tests/test-linux-vserver.sh \
+ tests/test-ldoms.sh \
tests/test-lkvm.sh \
tests/test-lkvm-arm.sh \
tests/test-lxc.sh \
tests/kvm-explicit-cpu/sbin/dmidecode \
tests/kvm-explicit-cpu/sbin/uname \
tests/kvm-explicit-cpu/sbin/virt-what-cpuid-helper \
+ tests/ldoms/dev/mdesc \
+ tests/ldoms/proc/cpuinfo \
tests/linux-vserver/proc/cpuinfo \
tests/linux-vserver/proc/self/status \
tests/linux-vserver/sbin/dmidecode \
--- /dev/null
+# Test for LDoms
+# Copyright (C) 2017 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/ldoms
+
+# Include src dir in PATH
+export PATH=.:${PATH}
+
+arch=$(uname -p | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/')
+
+output="$(./virt-what --test-root=$root 2>&1)"
+if [[ "${arch}" == sparc* ]]; then
+ expected="ldoms
+ldoms-guest"
+else
+ expected=""
+fi
+
+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
if [ "$cpuid" = "OpenBSDVMM58" ]; then
echo vmm
fi
+
+# Check for LDoms
+if [[ "$arch" == sparc* && -e ${root}/dev/mdesc ]]; then
+ echo ldoms
+ if [[ -d ${root}/sys/class/vlds/ctrl && \
+ -d ${root}/sys/class/vlds/sp ]]; then
+ echo ldoms-control
+ else
+ echo ldoms-guest
+ fi
+ MDPROP="${root}/usr/lib/ldoms/mdprop.py"
+ if [[ -x ${MDPROP} ]]; then
+ if [[ -n $($MDPROP -v iodevice device-type=pciex) ]]; then
+ echo ldoms-root
+ echo ldoms-io
+ elif [[ -n $($MDPROP -v iov-device vf-id=0) ]]; then
+ echo ldoms-io
+ fi
+ fi
+fi
Status: contributed by Thomas Huth
+=item B<ldoms>
+
+The guest appears to be running on an Linux SPARC system with
+Oracle VM Server for SPARC (Logical Domains) support.
+
+Status: contributed by Darren Kenny
+
+=item B<ldoms-control>
+
+The is the Oracle VM Server for SPARC (Logical Domains) control domain.
+
+Status: contributed by Darren Kenny
+
+=item B<ldoms-guest>
+
+The is the Oracle VM Server for SPARC (Logical Domains) guest domain.
+
+Status: contributed by Darren Kenny
+
+=item B<ldoms-io>
+
+The is the Oracle VM Server for SPARC (Logical Domains) I/O domain.
+
+Status: contributed by Darren Kenny
+
+=item B<ldoms-root>
+
+The is the Oracle VM Server for SPARC (Logical Domains) Root domain.
+
+Status: contributed by Darren Kenny
+
=item B<linux_vserver>
This is printed for backwards compatibility with older virt-what which