From b635c78530d5d7f27f9805790c1f7ca227959177 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 12 Feb 2023 12:28:40 +0100 Subject: libtar: Add a test for the tar writing code Generate a simple tarball and compare it with a reference. Signed-off-by: David Oberhollenzer --- bin/gensquashfs/test/fstree_glob1.c | 7 +++++++ bin/tar2sqfs/test/sqfs.sha512 | 1 + 2 files changed, 8 insertions(+) (limited to 'bin') diff --git a/bin/gensquashfs/test/fstree_glob1.c b/bin/gensquashfs/test/fstree_glob1.c index 5f4fdfe..2d3cb80 100644 --- a/bin/gensquashfs/test/fstree_glob1.c +++ b/bin/gensquashfs/test/fstree_glob1.c @@ -200,6 +200,13 @@ static void check_hierarchy(tree_node_t *root, bool subdir, bool recursive) TEST_NULL(n->data.dir.children); } + n = n->next; + TEST_NOT_NULL(n); + TEST_STR_EQUAL(n->name, "write"); + TEST_ASSERT(S_ISDIR(n->mode)); + TEST_ASSERT(n->parent == parentdir); + TEST_NULL(n->data.dir.children); + n = n->next; TEST_NOT_NULL(n); TEST_STR_EQUAL(n->name, "xattr"); diff --git a/bin/tar2sqfs/test/sqfs.sha512 b/bin/tar2sqfs/test/sqfs.sha512 index 609e154..a915b02 100644 --- a/bin/tar2sqfs/test/sqfs.sha512 +++ b/bin/tar2sqfs/test/sqfs.sha512 @@ -25,4 +25,5 @@ a5e95c464f41249da9a4156db3a23d30e01652881e839912f632f2614f1775e62a3fed184efbec1a 627a69ed25f9b5380d269fbe12603818d73b29d6a1155fcf7bebca2ba30ec1cce7b8405394498333f9847f10f0768b80b94b723551dbff10c633d2887e62b804 test_tar/data/xattr/xattr-schily.sqfs 627a69ed25f9b5380d269fbe12603818d73b29d6a1155fcf7bebca2ba30ec1cce7b8405394498333f9847f10f0768b80b94b723551dbff10c633d2887e62b804 test_tar/data/xattr/xattr-libarchive.sqfs b8e0e1cb41663c3d6278bf214234ac00ae8b86b9bc16d086bd0a7bfa9b0d28d626f70c6a1bd6f05dbbfa46431ce3f4518a4be38caf87b1f071d57edae24c5b10 test_tar/data/xattr/acl.sqfs +6b201a275180d93459f6e9d94900a9bbb14da1c4f68cc7ca5850eb8cab982617ec6ae5695ca3c23c6cbbfa93cc3957367d4f3ae636706ef176059090b3d92c3f test_tar/data/write/simple.sqfs bae693082a771c500c2d6b52a8eeb91decd98e90eaae379951bcc80589533ff43b58375f8a7f3de77c35456ee7fb269a6b17e4c29b291475578ba8453f152d0e test_tar/root-becomes.sqfs -- cgit v1.2.3