git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 1.15.0.
[libguestfs.git]
/
clone
/
test-virt-sysprep.sh
diff --git
a/clone/test-virt-sysprep.sh
b/clone/test-virt-sysprep.sh
index
897afb7
..
81e01f8
100755
(executable)
--- a/
clone/test-virt-sysprep.sh
+++ b/
clone/test-virt-sysprep.sh
@@
-19,17
+19,36
@@
export LANG=C
set -e
export LANG=C
set -e
+if [ ! -w /dev/fuse ]; then
+ echo "SKIPPING virt-sysprep test, because there is no /dev/fuse."
+ exit 0
+fi
+
+if ! xmlstarlet --help >/dev/null 2>&1; then
+ echo "SKIPPING virt-sysprep test, because xmlstarlet is not installed."
+ exit 0
+fi
+
rm -f test.img guestfish
qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img
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 -
#!/bin/sh -
-../run ../
fish/guestfish
"$@"
+../run ../
inspector/virt-inspector
"$@"
EOF
EOF
-chmod +x guestfish
+chmod +x virt-inspector
+cat <<'EOF' > guestmount
+#!/bin/sh -
+../run ../fuse/guestmount "$@"
+EOF
+chmod +x guestmount
+
PATH=.:$PATH
./virt-sysprep -a test.img
PATH=.:$PATH
./virt-sysprep -a test.img
-rm -f test.img
guestfish
+rm -f test.img
virt-inspector guestmount