diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-11-29 13:55:27 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-11-29 13:55:27 +0100 |
commit | e14d43e58f26960c90bd4a644f103a26186f7b04 (patch) | |
tree | c8eb7bfc848f05adc0f9fbfdb69de61ddbfd6199 /tests/gensquashfs/fstree_from_dir.c | |
parent | a487eec3e3e7c1c5552d17acd0db8cd5dcc59fc7 (diff) |
Add dummy hierarchy for fstree_from_dir test
Instead of abusing the directory tree of another test case, add a
proper dummy hierarchy. This also fixes issues with parallel tests,
where another test generates squashfs images in the target path.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/gensquashfs/fstree_from_dir.c')
-rw-r--r-- | tests/gensquashfs/fstree_from_dir.c | 221 |
1 files changed, 12 insertions, 209 deletions
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); |