summaryrefslogtreecommitdiff
path: root/tests/pack_dir_root.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pack_dir_root.sh.in')
-rwxr-xr-xtests/pack_dir_root.sh.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/pack_dir_root.sh.in b/tests/pack_dir_root.sh.in
new file mode 100755
index 0000000..ad0a085
--- /dev/null
+++ b/tests/pack_dir_root.sh.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+LICDIR="@abs_top_srcdir@/licenses"
+REFFILE="@abs_top_srcdir@/tests/pack_dir_root.txt.ref"
+GENSQFS="@abs_top_builddir@/gensquashfs"
+RDSQFS="@abs_top_builddir@/rdsquashfs"
+IMAGE="pack_dir_root.sqfs"
+SED="@SED@"
+
+if [ ! -f "$GENSQFS" -a -f "${GENSQFS}.exe" ]; then
+ GENSQFS="${GENSQFS}.exe"
+ RDSQFS="${RDSQFS}.exe"
+fi
+
+"$GENSQFS" --all-root --pack-dir "$LICDIR" --defaults mtime=0 \
+ -c gzip -q "$IMAGE"
+
+"$RDSQFS" -l / "$IMAGE" | "$SED" 's/^-[rwx-]* //g' > "${IMAGE}.txt"
+
+diff "$REFFILE" "${IMAGE}.txt"
+rm "$IMAGE" "${IMAGE}.txt"