summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapb <apb@NetBSD.org>2009-04-08 19:06:30 +0000
committerapb <apb@NetBSD.org>2009-04-08 19:06:30 +0000
commit7291fc32b20331e194cc157bb702f2becbf09d32 (patch)
tree1161ca46654a980e11927de36bb6884b25281053
parentef658dd50e85f4d25392b5f0ce22c9bc9ec2d585 (diff)
Add tests for "mtree -C -S" and "mtree -D -S"; convert previous tests
for "mtree -C" and "mtree -D" to expect the output to be in the same order as the input.
-rw-r--r--tests/util/mtree/Makefile4
-rw-r--r--tests/util/mtree/d_convert.in5
-rw-r--r--tests/util/mtree/d_convert_C.out4
-rw-r--r--tests/util/mtree/d_convert_C_S.out14
-rw-r--r--tests/util/mtree/d_convert_D.out4
-rw-r--r--tests/util/mtree/d_convert_D_S.out14
-rw-r--r--tests/util/mtree/t_mtree.sh30
7 files changed, 65 insertions, 10 deletions
diff --git a/tests/util/mtree/Makefile b/tests/util/mtree/Makefile
index 4683967c193..a9e9c0fdd34 100644
--- a/tests/util/mtree/Makefile
+++ b/tests/util/mtree/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2009/04/07 19:28:40 apb Exp $
+# $NetBSD: Makefile,v 1.3 2009/04/08 19:06:30 apb Exp $
NOMAN= # defined
@@ -11,7 +11,9 @@ TESTS_SH= t_mtree
FILESDIR= ${TESTSDIR}
FILES+= d_convert.in
FILES+= d_convert_C.out
+FILES+= d_convert_C_S.out
FILES+= d_convert_D.out
+FILES+= d_convert_D_S.out
FILES+= d_create.out
.include <bsd.test.mk>
diff --git a/tests/util/mtree/d_convert.in b/tests/util/mtree/d_convert.in
index 5a97e7d2de1..6a1abb07e1b 100644
--- a/tests/util/mtree/d_convert.in
+++ b/tests/util/mtree/d_convert.in
@@ -6,17 +6,18 @@
. type=dir
a.symlink.1 type=link link=a.file.1
top.dangling type=link link=nonexistent
- top.file.1 type=file
top.symlink.b \
type=link link=b
# ./b
b type=dir
- b.file.1 type=file
b.file.2 type=file
+ b.file.1 type=file
# end ./b, up to "."
..
+ top.file.1 type=file
+
# ./a
a type=dir
a.file.2 type=file
diff --git a/tests/util/mtree/d_convert_C.out b/tests/util/mtree/d_convert_C.out
index 037bf569c87..4a96f559598 100644
--- a/tests/util/mtree/d_convert_C.out
+++ b/tests/util/mtree/d_convert_C.out
@@ -1,11 +1,11 @@
. type=dir
./a.symlink.1 type=link link=a.file.1
./top.dangling type=link link=nonexistent
-./top.file.1 type=file
./top.symlink.b type=link link=b
./b type=dir
-./b/b.file.1 type=file
./b/b.file.2 type=file
+./b/b.file.1 type=file
+./top.file.1 type=file
./a type=dir
./a/a.file.2 type=file
./a/1 type=dir
diff --git a/tests/util/mtree/d_convert_C_S.out b/tests/util/mtree/d_convert_C_S.out
new file mode 100644
index 00000000000..af1668b01db
--- /dev/null
+++ b/tests/util/mtree/d_convert_C_S.out
@@ -0,0 +1,14 @@
+. type=dir
+./a.symlink.1 type=link link=a.file.1
+./top.dangling type=link link=nonexistent
+./top.file.1 type=file
+./top.symlink.b type=link link=b
+./a type=dir
+./a/a.file.1 type=file
+./a/a.file.2 type=file
+./a/1 type=dir
+./a/1/a1.file.1 type=file
+./a/2 type=dir
+./b type=dir
+./b/b.file.1 type=file
+./b/b.file.2 type=file
diff --git a/tests/util/mtree/d_convert_D.out b/tests/util/mtree/d_convert_D.out
index 6c3db802241..c059478131a 100644
--- a/tests/util/mtree/d_convert_D.out
+++ b/tests/util/mtree/d_convert_D.out
@@ -1,11 +1,11 @@
type=dir .
type=link link=a.file.1 ./a.symlink.1
type=link link=nonexistent ./top.dangling
-type=file ./top.file.1
type=link link=b ./top.symlink.b
type=dir ./b
-type=file ./b/b.file.1
type=file ./b/b.file.2
+type=file ./b/b.file.1
+type=file ./top.file.1
type=dir ./a
type=file ./a/a.file.2
type=dir ./a/1
diff --git a/tests/util/mtree/d_convert_D_S.out b/tests/util/mtree/d_convert_D_S.out
new file mode 100644
index 00000000000..a777a0b0112
--- /dev/null
+++ b/tests/util/mtree/d_convert_D_S.out
@@ -0,0 +1,14 @@
+type=dir .
+type=link link=a.file.1 ./a.symlink.1
+type=link link=nonexistent ./top.dangling
+type=file ./top.file.1
+type=link link=b ./top.symlink.b
+type=dir ./a
+type=file ./a/a.file.1
+type=file ./a/a.file.2
+type=dir ./a/1
+type=file ./a/1/a1.file.1
+type=dir ./a/2
+type=dir ./b
+type=file ./b/b.file.1
+type=file ./b/b.file.2
diff --git a/tests/util/mtree/t_mtree.sh b/tests/util/mtree/t_mtree.sh
index c9b0e002db1..7bb9709064b 100644
--- a/tests/util/mtree/t_mtree.sh
+++ b/tests/util/mtree/t_mtree.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.2 2009/04/07 19:28:40 apb Exp $
+# $NetBSD: t_mtree.sh,v 1.3 2009/04/08 19:06:30 apb Exp $
#
# Copyright (c) 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -102,7 +102,7 @@ check_body()
atf_test_case convert_C
convert_C_head()
{
- atf_set "descr" "Convert a specfile to mtree -C format"
+ atf_set "descr" "Convert a specfile to mtree -C format, unsorted"
}
convert_C_body()
{
@@ -110,10 +110,21 @@ convert_C_body()
h_check "$(atf_get_srcdir)/d_convert_C.out" output
}
+atf_test_case convert_C_S
+convert_C_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -C format, sorted"
+}
+convert_C_S_body()
+{
+ mtree -C -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_C_S.out" output
+}
+
atf_test_case convert_D
convert_D_head()
{
- atf_set "descr" "Convert a specfile to mtree -D format"
+ atf_set "descr" "Convert a specfile to mtree -D format, unsorted"
}
convert_D_body()
{
@@ -121,10 +132,23 @@ convert_D_body()
h_check "$(atf_get_srcdir)/d_convert_D.out" output
}
+atf_test_case convert_D_S
+convert_D_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -D format, sorted"
+}
+convert_D_S_body()
+{
+ mtree -D -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_D_S.out" output
+}
+
atf_init_test_cases()
{
atf_add_test_case create
atf_add_test_case check
atf_add_test_case convert_C
+ atf_add_test_case convert_C_S
atf_add_test_case convert_D
+ atf_add_test_case convert_D_S
}