aboutsummaryrefslogtreecommitdiff
path: root/bin/tar2sqfs/test
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 11:30:46 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 18:04:25 +0100
commit72c8155d9fc0eaeac72c053f46ebb7b231d4596a (patch)
tree5758865289c52fa93f56e3fe743bb40c283c5233 /bin/tar2sqfs/test
parentcdccc69c62579b0c13b35fad0728079652b8f3c9 (diff)
Reintegrate test code with library code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/tar2sqfs/test')
-rw-r--r--bin/tar2sqfs/test/simple.tarbin0 -> 20480 bytes
-rw-r--r--bin/tar2sqfs/test/sqfs.sha51228
-rwxr-xr-xbin/tar2sqfs/test/test_tar_sqfs.sh.in34
3 files changed, 62 insertions, 0 deletions
diff --git a/bin/tar2sqfs/test/simple.tar b/bin/tar2sqfs/test/simple.tar
new file mode 100644
index 0000000..ba1020b
--- /dev/null
+++ b/bin/tar2sqfs/test/simple.tar
Binary files differ
diff --git a/bin/tar2sqfs/test/sqfs.sha512 b/bin/tar2sqfs/test/sqfs.sha512
new file mode 100644
index 0000000..609e154
--- /dev/null
+++ b/bin/tar2sqfs/test/sqfs.sha512
@@ -0,0 +1,28 @@
+6217c207d51e38bd819ff70047a070d0172c2e1cc97ba5feb578a2429d1c911bd7990ea845b28389a956754e52e5693beba38c124bf6d7452522361a81c2da09 test_tar/data/long-paths/gnu.sqfs
+6217c207d51e38bd819ff70047a070d0172c2e1cc97ba5feb578a2429d1c911bd7990ea845b28389a956754e52e5693beba38c124bf6d7452522361a81c2da09 test_tar/data/long-paths/pax.sqfs
+6217c207d51e38bd819ff70047a070d0172c2e1cc97ba5feb578a2429d1c911bd7990ea845b28389a956754e52e5693beba38c124bf6d7452522361a81c2da09 test_tar/data/long-paths/ustar.sqfs
+2e2cd5fa04304c5765d7bb54c30273be6cd7414150ae95d217efcec1fbaa7486b4e752adb95e0dddd5329355132baaa7260dc958eb4418158a249929e89b0581 test_tar/data/sparse-files/gnu-small.sqfs
+f48a79c58db4d3553ffde5bd3780bb34c12fd0ee703aba95a40588c1cf7b5a679ea16d2a842a11e262bd14c2f0b4dd256436dcfc72a177a455427f93b504eae6 test_tar/data/sparse-files/gnu.sqfs
+f48a79c58db4d3553ffde5bd3780bb34c12fd0ee703aba95a40588c1cf7b5a679ea16d2a842a11e262bd14c2f0b4dd256436dcfc72a177a455427f93b504eae6 test_tar/data/sparse-files/pax-gnu0-1.sqfs
+f48a79c58db4d3553ffde5bd3780bb34c12fd0ee703aba95a40588c1cf7b5a679ea16d2a842a11e262bd14c2f0b4dd256436dcfc72a177a455427f93b504eae6 test_tar/data/sparse-files/pax-gnu0-0.sqfs
+f48a79c58db4d3553ffde5bd3780bb34c12fd0ee703aba95a40588c1cf7b5a679ea16d2a842a11e262bd14c2f0b4dd256436dcfc72a177a455427f93b504eae6 test_tar/data/sparse-files/pax-gnu1-0.sqfs
+194384a9a3683ef751f45ca9f380790b3bd9c234a839ff72b09c778f96fe521be9d816c7d3179edf936ec35cd66fad2485b03482468629baa3290a1475c72147 test_tar/data/large-mtime/12-digit.sqfs
+194384a9a3683ef751f45ca9f380790b3bd9c234a839ff72b09c778f96fe521be9d816c7d3179edf936ec35cd66fad2485b03482468629baa3290a1475c72147 test_tar/data/large-mtime/gnu.sqfs
+194384a9a3683ef751f45ca9f380790b3bd9c234a839ff72b09c778f96fe521be9d816c7d3179edf936ec35cd66fad2485b03482468629baa3290a1475c72147 test_tar/data/large-mtime/pax.sqfs
+c40037ae4a4b4224a919cf18c238d5a6b13f17fcca2602810e870e7606435f61426417cda32dd9bca85e74ec6c0fc75c996f60ec8b4560e79c83631937b6cdfa test_tar/data/negative-mtime/gnu.sqfs
+c40037ae4a4b4224a919cf18c238d5a6b13f17fcca2602810e870e7606435f61426417cda32dd9bca85e74ec6c0fc75c996f60ec8b4560e79c83631937b6cdfa test_tar/data/negative-mtime/pax.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/gnu-g.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/gnu.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/ustar-pre-posix.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/v7.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/pax.sqfs
+d3d112eab3537f6784a207d0bfd8f2826908fbddb3cf20e379a646c6c587c8bbaa67a1753a4ee0246c110dc10bd0ce821fa58368936efac3a1bbf8fd3f782e2b test_tar/data/format-acceptance/ustar.sqfs
+20eb111e2019eca4f26535e52823593ebf6a6b2c35d7a8779d6e4f92b90cba8e41edaf1f92425b5084adc680a7c0dac758a2f5170e0b4f19db3ea3357fb3080a test_tar/data/format-acceptance/link_filled.sqfs
+a5e95c464f41249da9a4156db3a23d30e01652881e839912f632f2614f1775e62a3fed184efbec1a25148f43edf7ba2a92e1136416aca4bf8f3e73a3b137162b test_tar/data/user-group-largenum/gnu.sqfs
+428728b2ca26543a9b0e698d1ae4f54463a7912b51248f2bd34627eb20f3abd8469379a5cd71ab6903aedd198ef48c97e66385c22f128e8aa08571f669c4c6c6 test_tar/data/user-group-largenum/8-digit.sqfs
+a5e95c464f41249da9a4156db3a23d30e01652881e839912f632f2614f1775e62a3fed184efbec1a25148f43edf7ba2a92e1136416aca4bf8f3e73a3b137162b test_tar/data/user-group-largenum/pax.sqfs
+6ff3ae611d295fc597db088f82ccd0218220ffb51ed901f0d1027c68d687f917b1601bf096421281fb95df48fb2aa6e5f1dc81caccbaa914cb971e17a2c4d5cd test_tar/data/xattr/xattr-schily-binary.sqfs
+627a69ed25f9b5380d269fbe12603818d73b29d6a1155fcf7bebca2ba30ec1cce7b8405394498333f9847f10f0768b80b94b723551dbff10c633d2887e62b804 test_tar/data/xattr/xattr-schily.sqfs
+627a69ed25f9b5380d269fbe12603818d73b29d6a1155fcf7bebca2ba30ec1cce7b8405394498333f9847f10f0768b80b94b723551dbff10c633d2887e62b804 test_tar/data/xattr/xattr-libarchive.sqfs
+b8e0e1cb41663c3d6278bf214234ac00ae8b86b9bc16d086bd0a7bfa9b0d28d626f70c6a1bd6f05dbbfa46431ce3f4518a4be38caf87b1f071d57edae24c5b10 test_tar/data/xattr/acl.sqfs
+bae693082a771c500c2d6b52a8eeb91decd98e90eaae379951bcc80589533ff43b58375f8a7f3de77c35456ee7fb269a6b17e4c29b291475578ba8453f152d0e test_tar/root-becomes.sqfs
diff --git a/bin/tar2sqfs/test/test_tar_sqfs.sh.in b/bin/tar2sqfs/test/test_tar_sqfs.sh.in
new file mode 100755
index 0000000..eb25fd9
--- /dev/null
+++ b/bin/tar2sqfs/test/test_tar_sqfs.sh.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+TARDIR="@abs_top_srcdir@/lib/tar/test/data"
+TARDIR2="@abs_top_srcdir@/bin/tar2sqfs/test"
+SHA512FILE="$TARDIR2/sqfs.sha512"
+TAR2SQFS="@abs_top_builddir@/tar2sqfs"
+
+if [ ! -f "$TAR2SQFS" -a -f "${TAR2SQFS}.exe" ]; then
+ TAR2SQFS="${TAR2SQFS}.exe"
+fi
+
+# process tar files used for conformance tests
+for filename in $(find "$TARDIR" -name "*.tar" | grep -v ".*/file-size/.*"); do
+ dir="$(dirname $filename | sed -n -e 's;.*/test/;test_tar/;p')"
+ imgname="$dir/$(basename $filename .tar).sqfs"
+
+ mkdir -p "$dir"
+ "$TAR2SQFS" --defaults mtime=0 -c gzip -q "$imgname" < "$filename"
+done
+
+# edge case test
+filename="$TARDIR2/simple.tar"
+imgname="./test_tar/root-becomes.sqfs"
+
+"$TAR2SQFS" --root-becomes foo --defaults mtime=0 \
+ -c gzip -q "$imgname" < "$filename"
+
+# verify
+sha512sum -c "$SHA512FILE"
+
+# cleanup
+rm -rf "./test_tar"