tools: Add basic tests for the virt-* tools.
[libguestfs.git] / tools / test-virt-ls.sh
diff --git a/tools/test-virt-ls.sh b/tools/test-virt-ls.sh
new file mode 100755 (executable)
index 0000000..d55b764
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash -
+
+export LANG=C
+set -e
+
+# Just a random UUID.
+uuid=868b1447-0ec5-41bf-a2e5-6a77a4c9b66f
+
+# Read out the test directory using virt-ls.
+if [ "$(./virt-ls test.img /bin)" != "test1
+test2
+test3
+test4
+test5
+test6
+test7" ]; then
+    echo "$0: error: unexpected output from virt-ls"
+    exit 1
+fi