summaryrefslogtreecommitdiff
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
parenta8ae870667efc4051acdc323dc2a27293c82f600 (diff)
Add a test script that turns all test tarballs into SquashFS images
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--configure.ac1
-rw-r--r--tests/Makemodule.am4
-rw-r--r--tests/tar/sqfs.sha51228
-rwxr-xr-xtests/test_tar_sqfs.sh.in25
4 files changed, 56 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index b1fa2f2..04594c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -216,6 +216,7 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([lib/sqfs/libsquashfs0.pc])
AC_CONFIG_FILES([Doxyfile])
AC_CONFIG_FILES([tests/cantrbry.sh], [chmod +x tests/cantrbry.sh])
+AC_CONFIG_FILES([tests/test_tar_sqfs.sh], [chmod +x tests/test_tar_sqfs.sh])
AC_OUTPUT([Makefile])
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index ce91ad3..fc27de0 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -99,7 +99,7 @@ check_PROGRAMS += test_fstree_init test_tar_ustar test_tar_pax test_tar_gnu
check_PROGRAMS += test_tar_sparse_gnu test_tar_sparse_gnu1 test_tar_sparse_gnu2
check_PROGRAMS += test_tar_xattr_bsd test_tar_xattr_schily
check_PROGRAMS += test_tar_xattr_schily_bin
-check_SCRIPTS += tests/cantrbry.sh
+check_SCRIPTS += tests/cantrbry.sh tests/test_tar_sqfs.sh
noinst_PROGRAMS += fstree_fuzz tar_fuzz
@@ -109,7 +109,7 @@ TESTS += test_add_by_path test_get_path test_fstree_sort test_fstree_from_file
TESTS += test_fstree_init test_tar_ustar test_tar_pax
TESTS += test_tar_gnu test_tar_sparse_gnu test_tar_sparse_gnu1
TESTS += test_tar_sparse_gnu2 test_tar_xattr_bsd test_tar_xattr_schily
-TESTS += test_tar_xattr_schily_bin tests/cantrbry.sh
+TESTS += test_tar_xattr_schily_bin tests/cantrbry.sh tests/test_tar_sqfs.sh
endif
EXTRA_DIST += $(top_srcdir)/tests/tar $(top_srcdir)/tests/words.txt
diff --git a/tests/tar/sqfs.sha512 b/tests/tar/sqfs.sha512
new file mode 100644
index 0000000..34a0ecb
--- /dev/null
+++ b/tests/tar/sqfs.sha512
@@ -0,0 +1,28 @@
+bbccea0583c1085d3c9ab2e415c52a33c7cf02413ddb964b31021380144865aef3bb611896f0577a2e6a00c7cea0539120e4cfca572c24de0bb325fca81648bd tests/tar/user-group-largenum/gnu.sqfs
+bbccea0583c1085d3c9ab2e415c52a33c7cf02413ddb964b31021380144865aef3bb611896f0577a2e6a00c7cea0539120e4cfca572c24de0bb325fca81648bd tests/tar/user-group-largenum/pax.sqfs
+60d72f8fe23acdea7c9328c198d7a28da7f5985f1c1f523c1aad947358d57c789a559c26424b79890839aad5480065fcf68ca0a237e894869e8b995c2926d26a tests/tar/user-group-largenum/8-digit.sqfs
+e707c3059f678f04d911e706d35c111e7c3d5f7bdfdf49b9893cf952c6f8414a5e4a0fd49ea8d57b7f9c9518bd9be60d8ef3366e2a8efc70d378ac9b637c1c22 tests/tar/negative-mtime/gnu.sqfs
+e707c3059f678f04d911e706d35c111e7c3d5f7bdfdf49b9893cf952c6f8414a5e4a0fd49ea8d57b7f9c9518bd9be60d8ef3366e2a8efc70d378ac9b637c1c22 tests/tar/negative-mtime/pax.sqfs
+bff8a33471bd1eff37236f5e9f4260854ea9227544c4d4ff5723dee09b87b12da38bc7b76b45fc7653a3b40f3b557a280feb2996a9dde26ac36484625d5a90b1 tests/tar/large-mtime/gnu.sqfs
+bff8a33471bd1eff37236f5e9f4260854ea9227544c4d4ff5723dee09b87b12da38bc7b76b45fc7653a3b40f3b557a280feb2996a9dde26ac36484625d5a90b1 tests/tar/large-mtime/pax.sqfs
+bff8a33471bd1eff37236f5e9f4260854ea9227544c4d4ff5723dee09b87b12da38bc7b76b45fc7653a3b40f3b557a280feb2996a9dde26ac36484625d5a90b1 tests/tar/large-mtime/12-digit.sqfs
+dd97f85260511b3f10570b427b941e790d999a92cf74cc2a314fd8632860e87ff7089717ea149de56d51a22080245f79cb1752fb96f695d1baadd20d3c33070d tests/tar/xattr/xattr-schily-binary.sqfs
+ed643a9e1ab27ecec909c7dba1c6d3a4be3f3ef7fb5eb76ecee5ea8d5458b51aea3357ab939985c7ca8da23c9cab68e2ee07628ba30baf1fca74599bc97c088f tests/tar/xattr/xattr-schily.sqfs
+6bcefa03a9aff2e7b269fd9b0517f5ba2f0fdc1688391d76c4d52ea41d8efb4ba73e8e46dca90d07e32ea0d687cbe2fa3c0fac7950d5f6555f65db93f423c623 tests/tar/xattr/acl.sqfs
+2ec7efd2670ce095219f4362d8c5e856e04724a9b129168792c5a19110643dd396bbb0ff2f0bb4663d63b859ebe85313f3ac8314f7a2cb7a353621b3ed5b3003 tests/tar/xattr/fflags-schily.sqfs
+2ec7efd2670ce095219f4362d8c5e856e04724a9b129168792c5a19110643dd396bbb0ff2f0bb4663d63b859ebe85313f3ac8314f7a2cb7a353621b3ed5b3003 tests/tar/xattr/fflags-libarchive.sqfs
+ed643a9e1ab27ecec909c7dba1c6d3a4be3f3ef7fb5eb76ecee5ea8d5458b51aea3357ab939985c7ca8da23c9cab68e2ee07628ba30baf1fca74599bc97c088f tests/tar/xattr/xattr-libarchive.sqfs
+4acd111192eb00c251b4c336872f36e58da64622385c3da438572f97185dfda17d66be5af53a335b00fdb2d40aada61d9f44e5c01285b7f3e46c13222fe27a5d tests/tar/sparse-files/gnu.sqfs
+4acd111192eb00c251b4c336872f36e58da64622385c3da438572f97185dfda17d66be5af53a335b00fdb2d40aada61d9f44e5c01285b7f3e46c13222fe27a5d tests/tar/sparse-files/pax-gnu0-1.sqfs
+4acd111192eb00c251b4c336872f36e58da64622385c3da438572f97185dfda17d66be5af53a335b00fdb2d40aada61d9f44e5c01285b7f3e46c13222fe27a5d tests/tar/sparse-files/pax-gnu0-0.sqfs
+f841b2bc9ef6a950dadff8dcd36c8d8fc4beb99605bb85e733c477cfa301de31be48b9dd9e974619a08577aaae002fdb02944f30296381702dca3748a21bbc62 tests/tar/sparse-files/pax-gnu1-0.sqfs
+a314f577dd10b3f84cea322d52e53ae3c9cf696f3a6dc47be845e57f05776e58c3ba852ff3fe53eea1e94a785b35415f8b70866ff5c1237e26dce8a4ab6a8e05 tests/tar/sparse-files/gnu-small.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/gnu.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/ustar.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/pax.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/gnu-g.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/ustar-pre-posix.sqfs
+4cf4ad348a141728669b414cb0e0111f6d533caf8f144bba7558ff952c392ac51fc5247658c2224a3f523a5504eec05d6a7462dedcfdb53d1b08bacfac4d6999 tests/tar/format-acceptance/v7.sqfs
+e34bc4d700a232e20aa5cf69dae04dc765b3b477b5dedd7d814822f0f353a75ec6749625c7ba5aaf80cf62f08f08bf3951c6f655392e739fae39a173588d6bcf tests/tar/long-paths/gnu.sqfs
+e34bc4d700a232e20aa5cf69dae04dc765b3b477b5dedd7d814822f0f353a75ec6749625c7ba5aaf80cf62f08f08bf3951c6f655392e739fae39a173588d6bcf tests/tar/long-paths/ustar.sqfs
+e34bc4d700a232e20aa5cf69dae04dc765b3b477b5dedd7d814822f0f353a75ec6749625c7ba5aaf80cf62f08f08bf3951c6f655392e739fae39a173588d6bcf tests/tar/long-paths/pax.sqfs
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