2 |
# Copyright 2008 by Denys Vlasenko |
# Copyright 2008 by Denys Vlasenko |
3 |
# Licensed under GPL v2, see file LICENSE for details. |
# Licensed under GPL v2, see file LICENSE for details. |
4 |
|
|
5 |
. testing.sh |
. ./testing.sh |
6 |
|
|
7 |
# ls -ln shows date. Need to remove that, it's variable. |
# ls -ln shows date. Need to remove that, it's variable. |
8 |
# sed: coalesce spaces |
# sed: coalesce spaces |
9 |
# cut: remove date |
# cut: remove date |
10 |
FILTER_LS="sed 's/ */ /g' | cut -d' ' -f 1-5,9-" |
# grep: remove "total NNN" lines |
11 |
|
FILTER_LS="sed 's/ */ /g' | cut -d' ' -f 1-5,9- | grep -v '^total '" |
12 |
|
|
13 |
|
|
14 |
# newc cpio archive of directory cpio.testdir with empty x and y hardlinks |
# newc cpio archive of directory cpio.testdir with empty x and y hardlinks |
42 |
" \ |
" \ |
43 |
"" "" |
"" "" |
44 |
|
|
45 |
# Currently fails. Numerous: "1 blocks" versus "1 block", |
|
46 |
|
test x"$SKIP_KNOWN_BUGS" = x"" && { |
47 |
|
# Currently fails. Numerous buglets: "1 blocks" versus "1 block", |
48 |
# "1 block" must go to stderr, does not list cpio.testdir/x and cpio.testdir/y |
# "1 block" must go to stderr, does not list cpio.testdir/x and cpio.testdir/y |
49 |
testing "cpio lists hardlinks" \ |
testing "cpio lists hardlinks" \ |
50 |
"$ECHO -ne '$hexdump' | bzcat | cpio -t 2>&1; echo \$?" \ |
"$ECHO -ne '$hexdump' | bzcat | cpio -t 2>&1; echo \$?" \ |
51 |
"\ |
"\ |
|
1 block |
|
52 |
cpio.testdir |
cpio.testdir |
53 |
cpio.testdir/x |
cpio.testdir/x |
54 |
cpio.testdir/y |
cpio.testdir/y |
55 |
|
1 blocks |
56 |
0 |
0 |
57 |
" \ |
" \ |
58 |
"" "" |
"" "" |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
# More complex case |
# More complex case |
63 |
rm -rf cpio.testdir cpio.testdir2 2>/dev/null |
rm -rf cpio.testdir cpio.testdir2 2>/dev/null |
73 |
"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i); echo \$?; |
"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i); echo \$?; |
74 |
ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \ |
ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \ |
75 |
"\ |
"\ |
76 |
|
2 blocks |
77 |
0 |
0 |
78 |
-rw-r--r-- 2 $user $group 0 empty |
-rw-r--r-- 2 $user $group 0 empty |
79 |
-rw-r--r-- 2 $user $group 0 empty1 |
-rw-r--r-- 2 $user $group 0 empty1 |
83 |
" \ |
" \ |
84 |
"" "" |
"" "" |
85 |
|
|
86 |
|
|
87 |
|
# Was trying to create "/usr/bin", correct is "usr/bin". |
88 |
|
rm -rf cpio.testdir |
89 |
|
testing "cpio -p with absolute paths" \ |
90 |
|
"echo /usr/bin | cpio -dp cpio.testdir; echo \$?; |
91 |
|
ls cpio.testdir" \ |
92 |
|
"\ |
93 |
|
1 blocks |
94 |
|
0 |
95 |
|
usr |
96 |
|
" \ |
97 |
|
"" "" |
98 |
|
|
99 |
|
|
100 |
# Clean up |
# Clean up |
101 |
rm -rf cpio.testdir cpio.testdir2 2>/dev/null |
rm -rf cpio.testdir cpio.testdir2 2>/dev/null |
102 |
|
|