summaryrefslogtreecommitdiff
path: root/tests/test_tar_sqfs.sh.in
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-15 02:17:08 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-15 02:31:54 +0100
commit026381843e1e17b00a68c57734117cb459853d5c (patch)
treec5b19c1bb99746a06cad852f080182625e334fc6 /tests/test_tar_sqfs.sh.in
parenta8ae870667efc4051acdc323dc2a27293c82f600 (diff)
Add a test script that turns all test tarballs into SquashFS images
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/test_tar_sqfs.sh.in')
-rwxr-xr-xtests/test_tar_sqfs.sh.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_tar_sqfs.sh.in b/tests/test_tar_sqfs.sh.in
new file mode 100755
index 0000000..7dc396b
--- /dev/null
+++ b/tests/test_tar_sqfs.sh.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+TARDIR="@abs_top_srcdir@/tests/tar"
+SHA512FILE="@abs_top_srcdir@/tests/tar/sqfs.sha512"
+TAR2SQFS="@abs_top_builddir@/tar2sqfs"
+
+for filename in $(find "$TARDIR" -name "*.tar" | grep -v ".*/file-size/.*"); do
+ dir="$(dirname $filename | sed -n -e 's;.*/tests/;tests/;p')"
+ imgname="$dir/$(basename $filename .tar).sqfs"
+
+ mkdir -p "$dir"
+ "$TAR2SQFS" -c gzip -q "$imgname" < "$filename"
+done
+
+sha512sum -c "$SHA512FILE"
+
+for filename in $(find "$TARDIR" -name "*.tar" | grep -v ".*/file-size/.*"); do
+ dir="$(dirname $filename | sed -n -e 's;.*/tests/;tests/;p')"
+ imgname="$dir/$(basename $filename .tar).sqfs"
+
+ rm "$imgname"
+ rmdir -p "$dir" || true
+done