2 # Copyright (C) 2009-2011 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 # - some local libvirt guests are available
22 # - the disks of these guests are accessible by the current user
23 # (tip: add yourself to the 'disk' group)
26 # These tests may fail for reasons which aren't necessarily real problems.
28 EXTRA_DIST = suppressions
32 --log-file=valgrind.log \
34 --error-exitcode=119 \
35 --suppressions=suppressions
37 export LIBVIRT_DEFAULT_URI = \
38 qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro
40 GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \
45 extra-tests: test-tools-null test-tools-internal test-tools-real
47 # Null invocations of the basic tools shouldn't leak memory.
49 $(VG) ../fish/guestfish -N part exit
50 $(VG) ../align/virt-alignment-scan -a test1.img >/dev/null
52 $(VG) ../cat/virt-filesystems -a /dev/null >/dev/null
53 $(VG) ../cat/virt-filesystems -a /dev/null --all --long -h --uuid >/dev/null
54 $(VG) ../df/virt-df -a /dev/null >/dev/null
55 $(VG) ../fish/guestfish -a /dev/null run
56 $(VG) ../inspector/virt-inspector -a /dev/null >/dev/null
57 $(VG) ../test-tool/libguestfs-test-tool >/dev/null 2>&1
59 # Invocations of tools on internal images shouldn't leak memory.
61 $(VG) ../cat/virt-cat -a ../images/fedora.img /etc/fstab >/dev/null
62 $(VG) ../cat/virt-filesystems -a ../images/fedora.img >/dev/null
63 $(VG) ../cat/virt-filesystems -a ../images/fedora.img --all --long -h --uuid >/dev/null
64 $(VG) ../cat/virt-ls -a ../images/fedora.img / >/dev/null
65 $(VG) ../cat/virt-ls -a ../images/fedora.img -l / >/dev/null
66 $(VG) ../cat/virt-ls -a ../images/fedora.img -R / >/dev/null
67 $(VG) ../cat/virt-ls -a ../images/fedora.img -lR / >/dev/null
68 $(VG) ../df/virt-df -a ../images/fedora.img >/dev/null
69 $(VG) ../df/virt-df -a ../images/fedora.img -h >/dev/null
70 $(VG) ../fish/guestfish -a ../images/fedora.img run
71 $(VG) ../fish/guestfish -a ../images/fedora.img -i exit
72 $(VG) ../inspector/virt-inspector -a ../images/debian.img >/dev/null
73 $(VG) ../inspector/virt-inspector -a ../images/fedora.img >/dev/null
74 $(VG) ../inspector/virt-inspector -a ../images/ubuntu.img >/dev/null
75 $(VG) ../inspector/virt-inspector -a ../images/windows.img >/dev/null
77 # Invocations of tools on real images shouldn't leak memory.
79 $(VG) virt-df >/dev/null
80 $(VG) virt-df -h >/dev/null
81 @for g in $(GUESTS); do \
82 echo $(VG) ../inspector/virt-inspector -d $$g; \
83 $(VG) ../inspector/virt-inspector -d $$g > /dev/null; \
85 if [ $$r -ne 0 ]; then exit $$r; fi; \
87 @for g in $(GUESTS); do \
88 echo $(VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid; \
89 $(VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid > /dev/null; \
91 if [ $$r -ne 0 ]; then exit $$r; fi; \
96 # ../clone/virt-sysprep
98 # ../edit/virt-edit -e
100 # ../resize/virt-resize (OCaml)
101 # ../sparsify/virt-sparsify (OCaml)
102 # ../tools/virt-win-reg (Perl)
103 # ../tools/virt-make-fs (Perl)