mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
inspector: Add some real virt-inspector tests.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -198,6 +198,7 @@ Makefile.in
|
||||
/html/virt-tar-out.1.html
|
||||
/html/virt-win-reg.1.html
|
||||
/inspector/stamp-virt-inspector.pod
|
||||
/inspector/test-xmllint.sh
|
||||
/inspector/virt-inspector
|
||||
/inspector/virt-inspector.1
|
||||
/install-sh
|
||||
|
||||
@@ -1328,6 +1328,8 @@ AC_CONFIG_HEADERS([config.h])
|
||||
dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
|
||||
AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
|
||||
[chmod +x,-w appliance/libguestfs-make-fixed-appliance])
|
||||
AC_CONFIG_FILES([inspector/test-xmllint.sh],
|
||||
[chmod +x,-w inspector/test-xmllint.sh])
|
||||
AC_CONFIG_FILES([podwrapper.pl],
|
||||
[chmod +x,-w podwrapper.pl])
|
||||
AC_CONFIG_FILES([run],
|
||||
|
||||
@@ -20,7 +20,7 @@ builddir ?= .
|
||||
|
||||
include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
EXAMPLE_XML = \
|
||||
export EXAMPLE_XML = \
|
||||
example-debian.xml \
|
||||
example-fedora.xml \
|
||||
example-ubuntu.xml \
|
||||
@@ -36,6 +36,8 @@ EXAMPLE_XML = \
|
||||
example-windows-xp-cd.xml
|
||||
|
||||
EXTRA_DIST = \
|
||||
test-virt-inspector.sh \
|
||||
test-xmllint.sh.in \
|
||||
virt-inspector.pod
|
||||
|
||||
CLEANFILES = stamp-virt-inspector.pod
|
||||
@@ -91,11 +93,10 @@ stamp-virt-inspector.pod: virt-inspector.pod
|
||||
$<
|
||||
touch $@
|
||||
|
||||
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
||||
TESTS = test-virt-inspector.sh
|
||||
if HAVE_XMLLINT
|
||||
|
||||
TESTS = $(EXAMPLE_XML)
|
||||
TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng $(srcdir)/virt-inspector.rng
|
||||
|
||||
TESTS += test-xmllint.sh
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
30
inspector/test-virt-inspector.sh
Executable file
30
inspector/test-virt-inspector.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash -
|
||||
# libguestfs virt-inspector test script
|
||||
# Copyright (C) 2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
export LANG=C
|
||||
set -e
|
||||
|
||||
for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do
|
||||
./virt-inspector -a $f
|
||||
done
|
||||
|
||||
# We could also test this image, but mdadm is problematic for
|
||||
# many users.
|
||||
# ./virt-inspector \
|
||||
# -a ../tests/guests/fedora-md1.img \
|
||||
# -a ../tests/guests/fedora-md2.img
|
||||
29
inspector/test-xmllint.sh.in
Executable file
29
inspector/test-xmllint.sh.in
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash -
|
||||
# @configure_input@
|
||||
# Copyright (C) 2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
export LANG=C
|
||||
set -e
|
||||
|
||||
if [ -z "$EXAMPLE_XML" ]; then
|
||||
echo "$0: \$EXAMPLE_XML is not defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for f in $EXAMPLE_XML; do
|
||||
@XMLLINT@ --noout --relaxng $srcdir/virt-inspector.rng $f
|
||||
done
|
||||
Reference in New Issue
Block a user