X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=clone%2Ftest-virt-sysprep.sh;h=1ebbde7dbc0fee97cd30bfed7c2c4b4c32edba1b;hb=a7740cb19a6991d21dc9395dffb87d69ee5986b5;hp=897afb709b36db8b0e47f69dab2dc0651aa06630;hpb=1e35941f62bddafd6b88270b22b3afe4a5d37baa;p=libguestfs.git diff --git a/clone/test-virt-sysprep.sh b/clone/test-virt-sysprep.sh index 897afb7..1ebbde7 100755 --- a/clone/test-virt-sysprep.sh +++ b/clone/test-virt-sysprep.sh @@ -14,22 +14,36 @@ # # 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. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. export LANG=C set -e +if [ ! -w /dev/fuse ]; then + echo "SKIPPING virt-sysprep test, because there is no /dev/fuse." + exit 0 +fi + rm -f test.img guestfish qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img -cat <<'EOF' > guestfish +# Provide alternate 'virt-inspector' and 'guestmount' binaries +# that run the just-built programs. + +cat <<'EOF' > virt-inspector +#!/bin/sh - +../run ../inspector/virt-inspector "$@" +EOF +chmod +x virt-inspector +cat <<'EOF' > guestmount #!/bin/sh - -../run ../fish/guestfish "$@" +../run ../fuse/guestmount "$@" EOF -chmod +x guestfish +chmod +x guestmount + PATH=.:$PATH ./virt-sysprep -a test.img -rm -f test.img guestfish +rm -f test.img virt-inspector guestmount