summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gensquashfs/Makemodule.am3
-rw-r--r--tests/gensquashfs/fstree_from_dir.c221
-rw-r--r--tests/gensquashfs/testdir/dira/file_a00
-rw-r--r--tests/gensquashfs/testdir/dira/file_a10
-rw-r--r--tests/gensquashfs/testdir/dira/file_a20
-rw-r--r--tests/gensquashfs/testdir/dirb/file_b00
-rw-r--r--tests/gensquashfs/testdir/dirb/file_b10
-rw-r--r--tests/gensquashfs/testdir/dirb/file_b20
-rw-r--r--tests/gensquashfs/testdir/dirc/file_c00
-rw-r--r--tests/gensquashfs/testdir/dirc/file_c10
-rw-r--r--tests/gensquashfs/testdir/dirc/file_c20
11 files changed, 14 insertions, 210 deletions
diff --git a/tests/gensquashfs/Makemodule.am b/tests/gensquashfs/Makemodule.am
index c1ab164..70dc375 100644
--- a/tests/gensquashfs/Makemodule.am
+++ b/tests/gensquashfs/Makemodule.am
@@ -28,7 +28,7 @@ test_fstree_from_dir_SOURCES = tests/gensquashfs/fstree_from_dir.c \
bin/gensquashfs/fstree_from_dir.c \
bin/gensquashfs/mkfs.h
test_fstree_from_dir_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/bin/gensquashfs
-test_fstree_from_dir_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/libtar/data
+test_fstree_from_dir_CPPFLAGS += -DTESTPATH=$(GENDATADIR)/testdir
test_fstree_from_dir_LDADD = libfstree.a libutil.a libcompat.a
test_sort_file_SOURCES = tests/gensquashfs/sort_file.c \
@@ -60,3 +60,4 @@ endif
EXTRA_DIST += $(GENDATADIR)/xattr1.txt $(GENDATADIR)/fstree1.txt
EXTRA_DIST += $(GENDATADIR)/fstree_glob1.txt $(GENDATADIR)/fstree_glob2.txt
EXTRA_DIST += $(GENDATADIR)/fstree_glob3.txt
+EXTRA_DIST += $(GENDATADIR)/testdir
diff --git a/tests/gensquashfs/fstree_from_dir.c b/tests/gensquashfs/fstree_from_dir.c
index 3aad1c6..5e73fa4 100644
--- a/tests/gensquashfs/fstree_from_dir.c
+++ b/tests/gensquashfs/fstree_from_dir.c
@@ -15,32 +15,26 @@ static void check_hierarchy(tree_node_t *root, bool recursive)
n = root->data.dir.children;
TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "CREDITS");
- TEST_ASSERT(S_ISREG(n->mode));
- TEST_ASSERT(n->parent == root);
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "file-size");
+ TEST_STR_EQUAL(n->name, "dira");
TEST_ASSERT(S_ISDIR(n->mode));
TEST_ASSERT(n->parent == root);
if (recursive) {
m = n->data.dir.children;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "12-digit.tar");
+ TEST_STR_EQUAL(m->name, "file_a0");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
+ TEST_STR_EQUAL(m->name, "file_a1");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
+ TEST_STR_EQUAL(m->name, "file_a2");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
@@ -52,50 +46,26 @@ static void check_hierarchy(tree_node_t *root, bool recursive)
n = n->next;
TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "format-acceptance");
+ TEST_STR_EQUAL(n->name, "dirb");
TEST_ASSERT(S_ISDIR(n->mode));
TEST_ASSERT(n->parent == root);
if (recursive) {
m = n->data.dir.children;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu-g.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "link_filled.tar");
+ TEST_STR_EQUAL(m->name, "file_b0");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
+ TEST_STR_EQUAL(m->name, "file_b1");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "ustar-pre-posix.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "ustar.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "v7.tar");
+ TEST_STR_EQUAL(m->name, "file_b2");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
@@ -107,193 +77,26 @@ static void check_hierarchy(tree_node_t *root, bool recursive)
n = n->next;
TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "large-mtime");
+ TEST_STR_EQUAL(n->name, "dirc");
TEST_ASSERT(S_ISDIR(n->mode));
TEST_ASSERT(n->parent == root);
if (recursive) {
m = n->data.dir.children;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "12-digit.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NULL(m);
- } else {
- TEST_NULL(n->data.dir.children);
- }
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "long-paths");
- TEST_ASSERT(S_ISDIR(n->mode));
- TEST_ASSERT(n->parent == root);
-
- if (recursive) {
- m = n->data.dir.children;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "ustar.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NULL(m);
- } else {
- TEST_NULL(n->data.dir.children);
- }
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "negative-mtime");
- TEST_ASSERT(S_ISDIR(n->mode));
- TEST_ASSERT(n->parent == root);
-
- if (recursive) {
- m = n->data.dir.children;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NULL(m);
- } else {
- TEST_NULL(n->data.dir.children);
- }
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "sparse-files");
- TEST_ASSERT(S_ISDIR(n->mode));
- TEST_ASSERT(n->parent == root);
-
- if (recursive) {
- m = n->data.dir.children;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu-small.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax-gnu0-0.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax-gnu0-1.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax-gnu1-0.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NULL(m);
- } else {
- TEST_NULL(n->data.dir.children);
- }
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "user-group-largenum");
- TEST_ASSERT(S_ISDIR(n->mode));
- TEST_ASSERT(n->parent == root);
-
- if (recursive) {
- m = n->data.dir.children;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "8-digit.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "gnu.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "pax.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NULL(m);
- } else {
- TEST_NULL(n->data.dir.children);
- }
-
- n = n->next;
- TEST_NOT_NULL(n);
- TEST_STR_EQUAL(n->name, "xattr");
- TEST_ASSERT(S_ISDIR(n->mode));
- TEST_ASSERT(n->parent == root);
-
- if (recursive) {
- m = n->data.dir.children;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "acl.tar");
- TEST_ASSERT(S_ISREG(m->mode));
- TEST_ASSERT(m->parent == n);
-
- m = m->next;
- TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "xattr-libarchive.tar");
+ TEST_STR_EQUAL(m->name, "file_c0");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "xattr-schily-binary.tar");
+ TEST_STR_EQUAL(m->name, "file_c1");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
m = m->next;
TEST_NOT_NULL(m);
- TEST_STR_EQUAL(m->name, "xattr-schily.tar");
+ TEST_STR_EQUAL(m->name, "file_c2");
TEST_ASSERT(S_ISREG(m->mode));
TEST_ASSERT(m->parent == n);
diff --git a/tests/gensquashfs/testdir/dira/file_a0 b/tests/gensquashfs/testdir/dira/file_a0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dira/file_a0
diff --git a/tests/gensquashfs/testdir/dira/file_a1 b/tests/gensquashfs/testdir/dira/file_a1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dira/file_a1
diff --git a/tests/gensquashfs/testdir/dira/file_a2 b/tests/gensquashfs/testdir/dira/file_a2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dira/file_a2
diff --git a/tests/gensquashfs/testdir/dirb/file_b0 b/tests/gensquashfs/testdir/dirb/file_b0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirb/file_b0
diff --git a/tests/gensquashfs/testdir/dirb/file_b1 b/tests/gensquashfs/testdir/dirb/file_b1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirb/file_b1
diff --git a/tests/gensquashfs/testdir/dirb/file_b2 b/tests/gensquashfs/testdir/dirb/file_b2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirb/file_b2
diff --git a/tests/gensquashfs/testdir/dirc/file_c0 b/tests/gensquashfs/testdir/dirc/file_c0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirc/file_c0
diff --git a/tests/gensquashfs/testdir/dirc/file_c1 b/tests/gensquashfs/testdir/dirc/file_c1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirc/file_c1
diff --git a/tests/gensquashfs/testdir/dirc/file_c2 b/tests/gensquashfs/testdir/dirc/file_c2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/gensquashfs/testdir/dirc/file_c2