tools: Add basic tests for the virt-* tools.
[libguestfs.git] / tools / test-virt-list-filesystems.sh
diff --git a/tools/test-virt-list-filesystems.sh b/tools/test-virt-list-filesystems.sh
new file mode 100755 (executable)
index 0000000..5fd4b08
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash -
+
+export LANG=C
+set -e
+
+# Run virt-list-filesystems.
+# Only columns 1 & 2 are guaranteed, we may add more in future.
+if [ "$(./virt-list-filesystems -l test.img | sort | awk '{print $1 $2}')" \
+    != \
+"/dev/VG/LV1ext2
+/dev/VG/LV2ext2
+/dev/VG/LV3ext2
+/dev/VG/Rootext2
+/dev/sda1ext2" ]; then
+    echo "$0: error: unexpected output from virt-list-filesystems"
+    exit 1
+fi