tests: Split images -> tests/data + tests/guests
[libguestfs.git] / clone / test-virt-sysprep.sh
index 897afb7..3217389 100755 (executable)
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 #
 # 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
 
 
 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
 
 rm -f test.img guestfish
 
-qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img
+qemu-img create -f qcow2 -o backing_file=../tests/guests/fedora.img test.img
+
+# Provide alternate 'virt-inspector' and 'guestmount' binaries
+# that run the just-built programs.
 
 
-cat <<'EOF' > guestfish
+cat <<'EOF' > virt-inspector
+#!/bin/sh -
+../run ../inspector/virt-inspector "$@"
+EOF
+chmod +x virt-inspector
+cat <<'EOF' > guestmount
 #!/bin/sh -
 #!/bin/sh -
-../run ../fish/guestfish "$@"
+../run ../fuse/guestmount "$@"
 EOF
 EOF
-chmod +x guestfish
+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