summaryrefslogtreecommitdiff
path: root/tests/pack_dir_root.sh.in
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-03 14:36:16 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-03 14:36:16 +0200
commitd43b31df6b84e54d0d657fd27b2f2b5734d8f162 (patch)
tree72ab62a643abacbf302a92280800af9bd9f58213 /tests/pack_dir_root.sh.in
parent5380c605440db063f8b80a2a48b326a8ce9b0d93 (diff)
Add a simple test script for the gensquashfs packdir + allroot use case
Since this is a fairly common use case, it deserves a simple test case to check out that e.g. option processing hasn't been botched up (again). As input directory, the licenses directory is used as it contains no intermediate build output and should change fairly infrequently. The test is enabled irregardless of the corpora-test option. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
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"