Rewrite virt-cat in C.
[libguestfs.git] / cat / test-virt-cat.sh
diff --git a/cat/test-virt-cat.sh b/cat/test-virt-cat.sh
new file mode 100755 (executable)
index 0000000..19b8d87
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash -
+
+export LANG=C
+set -e
+
+# Read out the test files from the image using virt-cat.
+if [ "$(./virt-cat ../images/fedora.img /etc/test1)" != "abcdefg" ]; then
+    echo "$0: error: mismatch in file test1"
+    exit 1
+fi
+if [ "$(./virt-cat ../images/fedora.img /etc/test2)" != "" ]; then
+    echo "$0: error: mismatch in file test2"
+    exit 1
+fi