diff options
83 files changed, 316 insertions, 1570 deletions
diff --git a/tests/.cvsignore b/tests/.cvsignore deleted file mode 100644 index 3645cf92f..000000000 --- a/tests/.cvsignore +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | cp | ||
2 | cp_*.bb | ||
3 | cp_*.gnu | ||
4 | cp_tests | ||
5 | date | ||
6 | df | ||
7 | du | ||
8 | ln | ||
9 | ln_*.bb | ||
10 | ln_*.gnu | ||
11 | ln_tests | ||
12 | mv | ||
13 | mv_*.bb | ||
14 | mv_*.gnu | ||
15 | mv_tests | ||
16 | syslog_test | ||
diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 16f53452e..000000000 --- a/tests/Makefile +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | # busybox/tests/Makefile - Run through all defined tests. | ||
2 | # ------------------------ | ||
3 | # Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org> GPL | ||
4 | |||
5 | all:: message_header | ||
6 | |||
7 | message_header: | ||
8 | @echo | ||
9 | @echo BusyBox Test Suite. | ||
10 | @echo | ||
11 | (cd ..; tests/busybox.REGRESS.sh) | ||
12 | |||
13 | clean:: | ||
14 | rm -f *.o | ||
15 | rm -f tester.log | ||
16 | |||
17 | distclean: clean | ||
18 | |||
19 | .PHONY: all clean distclean message_header | ||
20 | |||
21 | include $(wildcard *_tests.mk) | ||
22 | |||
23 | BBL := $(shell pushd .. >/dev/null && \ | ||
24 | ${MAKE} busybox.links >/dev/null && \ | ||
25 | popd >/dev/null && \ | ||
26 | cat ../busybox.links | \ | ||
27 | sed -e 's,.*/\(.*\)$$,\1,') | ||
28 | |||
29 | ../busybox: | ||
30 | cd .. && ${MAKE} busybox | ||
31 | |||
32 | ${BBL}: ../busybox | ||
33 | rm -f $@ | ||
34 | ln ../busybox $@ | ||
35 | |||
36 | syslog_test: syslog_test.c | ||
diff --git a/tests/cp_tests.mk b/tests/cp_tests.mk deleted file mode 100644 index b96c5cea6..000000000 --- a/tests/cp_tests.mk +++ /dev/null | |||
@@ -1,360 +0,0 @@ | |||
1 | # cp_tests.mk - Set of test cases for busybox cp | ||
2 | # ------------- | ||
3 | # Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org> GPL | ||
4 | # | ||
5 | |||
6 | # GNU `cp' | ||
7 | GCP = /bin/cp | ||
8 | # BusyBox `cp' | ||
9 | BCP = $(shell pwd)/cp | ||
10 | |||
11 | all:: cp_tests | ||
12 | clean:: cp_clean | ||
13 | |||
14 | cp_clean: | ||
15 | - rm -rf cp_tests cp_*.{gnu,bb} cp | ||
16 | |||
17 | # check_cp_dir_to_dir_wo_a removed from this list; see below | ||
18 | cp_tests: cp_clean cp check_exists check_simple_cp check_cp_symlnk \ | ||
19 | check_cp_symlink_w_a check_cp_files_to_dir check_cp_files_to_dir_w_d \ | ||
20 | check_cp_files_to_dir_w_p check_cp_files_to_dir_w_p_and_d \ | ||
21 | check_cp_dir_to_dir_w_a \ | ||
22 | check_cp_dir_to_dir_w_a_take_two | ||
23 | |||
24 | check_exists: | ||
25 | @echo; | ||
26 | @echo "No output from diff means busybox cp is functioning properly."; | ||
27 | @echo "Some tests might show timestamp differences that are Ok."; | ||
28 | |||
29 | @echo; | ||
30 | @echo Verify that busybox cp exists; | ||
31 | @echo ------------------------------; | ||
32 | [ -x ${BCP} ] || exit 0 | ||
33 | |||
34 | @echo; | ||
35 | mkdir cp_tests; | ||
36 | |||
37 | check_simple_cp: | ||
38 | @echo Copy a file to a copy of the file; | ||
39 | @echo ------------------------------; | ||
40 | cd cp_tests; \ | ||
41 | echo A file > afile; \ | ||
42 | ls -l afile > ../cp_afile_afilecopy.gnu; \ | ||
43 | ${GCP} afile afilecopy; \ | ||
44 | ls -l afile afilecopy >> ../cp_afile_afilecopy.gnu; | ||
45 | |||
46 | @echo; | ||
47 | rm -rf cp_tests/*; | ||
48 | |||
49 | @echo; | ||
50 | cd cp_tests; \ | ||
51 | echo A file > afile; \ | ||
52 | ls -l afile > ../cp_afile_afilecopy.bb; \ | ||
53 | ${BCP} afile afilecopy; \ | ||
54 | ls -l afile afilecopy >> ../cp_afile_afilecopy.bb; | ||
55 | |||
56 | @echo; | ||
57 | @echo Might show timestamp differences. | ||
58 | -diff -u cp_afile_afilecopy.gnu cp_afile_afilecopy.bb; | ||
59 | |||
60 | @echo; | ||
61 | rm -rf cp_tests/*; | ||
62 | |||
63 | check_cp_symlnk: | ||
64 | @echo; echo Copy a file pointed to by a symlink; | ||
65 | @echo ------------------------------; | ||
66 | cd cp_tests; \ | ||
67 | mkdir here there; \ | ||
68 | echo A file > afile; \ | ||
69 | cd here; \ | ||
70 | ln -s ../afile .; \ | ||
71 | |||
72 | @echo; | ||
73 | cd cp_tests; \ | ||
74 | ls -lR . > ../cp_symlink.gnu; \ | ||
75 | ${GCP} here/afile there; \ | ||
76 | ls -lR . >> ../cp_symlink.gnu; | ||
77 | |||
78 | @echo; | ||
79 | rm -rf cp_tests/there/*; | ||
80 | |||
81 | sleep 1; | ||
82 | |||
83 | @echo; | ||
84 | cd cp_tests; \ | ||
85 | ls -lR . > ../cp_symlink.bb; \ | ||
86 | ${BCP} here/afile there; \ | ||
87 | ls -lR . >> ../cp_symlink.bb; | ||
88 | |||
89 | @echo; | ||
90 | @echo Will show timestamp difference. | ||
91 | -diff -u cp_symlink.gnu cp_symlink.bb; | ||
92 | |||
93 | @echo; | ||
94 | rm -rf cp_tests/* | ||
95 | |||
96 | check_cp_symlink_w_a: | ||
97 | @echo; echo Copy a symlink, useing the -a switch.; | ||
98 | @echo ------------------------------; | ||
99 | cd cp_tests; \ | ||
100 | echo A file > afile; \ | ||
101 | mkdir here there; \ | ||
102 | cd here; \ | ||
103 | ln -s ../afile . | ||
104 | |||
105 | cd cp_tests; \ | ||
106 | ls -lR . > ../cp_a_symlink.gnu; \ | ||
107 | ${GCP} -a here/afile there; \ | ||
108 | ls -lR . >> ../cp_a_symlink.gnu; | ||
109 | |||
110 | @echo; | ||
111 | rm -rf cp_tests/there/*; | ||
112 | |||
113 | sleep 1; | ||
114 | |||
115 | @echo; | ||
116 | cd cp_tests; \ | ||
117 | echo A file > afile; \ | ||
118 | ls -lR . > ../cp_a_symlink.bb; \ | ||
119 | ${BCP} -a here/afile there; \ | ||
120 | ls -lR . >> ../cp_a_symlink.bb; | ||
121 | |||
122 | @echo; | ||
123 | diff -u cp_a_symlink.gnu cp_a_symlink.bb; | ||
124 | |||
125 | @echo; | ||
126 | rm -rf cp_tests/*; | ||
127 | |||
128 | |||
129 | check_cp_files_to_dir: | ||
130 | # Copy a set of files to a directory. | ||
131 | @echo; echo Copy a set of files to a directory.; | ||
132 | @echo ------------------------------; | ||
133 | cd cp_tests; \ | ||
134 | echo A file number one > afile1; \ | ||
135 | echo A file number two, blah. > afile2; \ | ||
136 | ln -s afile1 symlink1; \ | ||
137 | mkdir there; | ||
138 | |||
139 | cd cp_tests; \ | ||
140 | ${GCP} afile1 afile2 symlink1 there/; \ | ||
141 | ls -lR > ../cp_files_dir.gnu; | ||
142 | |||
143 | @echo; | ||
144 | rm -rf cp_tests/there/*; | ||
145 | |||
146 | @echo; | ||
147 | cd cp_tests; \ | ||
148 | ${BCP} afile1 afile2 symlink1 there/; \ | ||
149 | ls -lR > ../cp_files_dir.bb; | ||
150 | |||
151 | @echo; | ||
152 | diff -u cp_files_dir.gnu cp_files_dir.bb; | ||
153 | |||
154 | @echo; | ||
155 | rm -rf cp_tests/*; | ||
156 | |||
157 | check_cp_files_to_dir_w_d: | ||
158 | # Copy a set of files to a directory with the -d switch. | ||
159 | @echo; echo Copy a set of files to a directory with the -d switch.; | ||
160 | @echo ------------------------------; | ||
161 | cd cp_tests; \ | ||
162 | echo A file number one > afile1; \ | ||
163 | echo A file number two, blah. > afile2; \ | ||
164 | ln -s afile1 symlink1; \ | ||
165 | mkdir there1; \ | ||
166 | ${GCP} -d afile1 afile2 symlink1 there1/; \ | ||
167 | ls -lR > ../cp_d_files_dir.gnu; | ||
168 | |||
169 | @echo; | ||
170 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
171 | |||
172 | @echo; | ||
173 | cd cp_tests; \ | ||
174 | echo A file number one > afile1; \ | ||
175 | echo A file number two, blah. > afile2; \ | ||
176 | ln -s afile1 symlink1; \ | ||
177 | mkdir there1; \ | ||
178 | ${BCP} -d afile1 afile2 symlink1 there1/; \ | ||
179 | ls -lR > ../cp_d_files_dir.bb; | ||
180 | |||
181 | @echo; | ||
182 | diff -u cp_d_files_dir.gnu cp_d_files_dir.bb; | ||
183 | |||
184 | @echo; | ||
185 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
186 | |||
187 | check_cp_files_to_dir_w_p: | ||
188 | # Copy a set of files to a directory with the -p switch. | ||
189 | @echo; echo Copy a set of files to a directory with the -p switch.; | ||
190 | @echo ------------------------------; | ||
191 | cd cp_tests; \ | ||
192 | echo A file number one > afile1; \ | ||
193 | echo A file number two, blah. > afile2; \ | ||
194 | touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \ | ||
195 | ln -s afile1 symlink1; \ | ||
196 | mkdir there1; \ | ||
197 | ${GCP} -p afile1 afile2 symlink1 there1/; \ | ||
198 | ls -lR > ../cp_p_files_dir.gnu; | ||
199 | |||
200 | @echo; | ||
201 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
202 | |||
203 | @echo; | ||
204 | cd cp_tests; \ | ||
205 | echo A file number one > afile1; \ | ||
206 | echo A file number two, blah. > afile2; \ | ||
207 | touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \ | ||
208 | ln -s afile1 symlink1; \ | ||
209 | mkdir there1; \ | ||
210 | ${BCP} -p afile1 afile2 symlink1 there1/; \ | ||
211 | ls -lR > ../cp_p_files_dir.bb; | ||
212 | |||
213 | @echo; | ||
214 | diff -u cp_p_files_dir.gnu cp_p_files_dir.bb; | ||
215 | |||
216 | @echo; | ||
217 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
218 | |||
219 | |||
220 | check_cp_files_to_dir_w_p_and_d: | ||
221 | @echo; echo Copy a set of files to a directory with -p and -d switches. | ||
222 | @echo ------------------------------; | ||
223 | cd cp_tests; \ | ||
224 | echo A file number one > afile1; \ | ||
225 | echo A file number two, blah. > afile2; \ | ||
226 | touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \ | ||
227 | ln -s afile1 symlink1; \ | ||
228 | mkdir there1; \ | ||
229 | ${GCP} -p -d afile1 afile2 symlink1 there1/; \ | ||
230 | ls -lR > ../cp_pd_files_dir.gnu; | ||
231 | |||
232 | @echo; | ||
233 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
234 | |||
235 | @echo; | ||
236 | cd cp_tests; \ | ||
237 | echo A file number one > afile1; \ | ||
238 | echo A file number two, blah. > afile2; \ | ||
239 | touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \ | ||
240 | ln -s afile1 symlink1; \ | ||
241 | mkdir there1; \ | ||
242 | ${BCP} -p -d afile1 afile2 symlink1 there1/; \ | ||
243 | ls -lR > ../cp_pd_files_dir.bb; | ||
244 | |||
245 | @echo; | ||
246 | diff -u cp_pd_files_dir.gnu cp_pd_files_dir.bb; | ||
247 | |||
248 | @echo; | ||
249 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | ||
250 | |||
251 | # This test doesn't work any more; gnu cp now _does_ copy a directory | ||
252 | # to a subdirectory of itself. What's worse, that "feature" has no | ||
253 | # (documented) way to be disabled with command line switches. | ||
254 | # It's not obvious that busybox cp should mimic this behavior. | ||
255 | # For now, this test is removed from the cp_tests list, above. | ||
256 | check_cp_dir_to_dir_wo_a: | ||
257 | # Copy a directory to another directory, without the -a switch. | ||
258 | @echo; echo Copy a directory to another directory, without the -a switch. | ||
259 | @echo ------------------------------; | ||
260 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | ||
261 | cd cp_tests; \ | ||
262 | touch a b c; \ | ||
263 | mkdir adir; \ | ||
264 | ls -lR . > ../cp_a_star_adir.gnu; \ | ||
265 | ${GCP} -a * adir; \ | ||
266 | ls -lR . >> ../cp_a_star_adir.gnu; | ||
267 | |||
268 | @echo | ||
269 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | ||
270 | cd cp_tests; \ | ||
271 | rm -rf adir; \ | ||
272 | mkdir adir; \ | ||
273 | ls -lR . > ../cp_a_star_adir.bb; \ | ||
274 | ${BCP} -a * adir; \ | ||
275 | ls -lR . >> ../cp_a_star_adir.bb; | ||
276 | |||
277 | @echo; | ||
278 | diff -u cp_a_star_adir.gnu cp_a_star_adir.bb; | ||
279 | |||
280 | # Done | ||
281 | @echo; | ||
282 | rm -rf cp_tests; | ||
283 | @echo; echo Done. | ||
284 | |||
285 | |||
286 | check_cp_dir_to_dir_w_a: | ||
287 | @echo; echo Copy a directory into another directory with the -a switch. | ||
288 | @echo ------------------------------; | ||
289 | cd cp_tests; \ | ||
290 | mkdir dir{a,b}; \ | ||
291 | echo A file > dira/afile; \ | ||
292 | echo A file in dirb > dirb/afileindirb; \ | ||
293 | ln -s dira/afile dira/alinktoafile; \ | ||
294 | mkdir dira/subdir1; \ | ||
295 | echo Another file > dira/subdir1/anotherfile; \ | ||
296 | ls -lR . > ../cp_a_dira_dirb.gnu; \ | ||
297 | ${GCP} -a dira dirb; \ | ||
298 | ls -lR . >> ../cp_a_dira_dirb.gnu; | ||
299 | |||
300 | @echo; | ||
301 | rm -rf cp_tests/dir{a,b}; | ||
302 | |||
303 | @echo; | ||
304 | cd cp_tests; \ | ||
305 | mkdir dir{a,b}; \ | ||
306 | echo A file > dira/afile; \ | ||
307 | echo A file in dirb > dirb/afileindirb; \ | ||
308 | ln -s dira/afile dira/alinktoafile; \ | ||
309 | mkdir dira/subdir1; \ | ||
310 | echo Another file > dira/subdir1/anotherfile; \ | ||
311 | ls -lR . > ../cp_a_dira_dirb.bb; \ | ||
312 | ${BCP} -a dira dirb; \ | ||
313 | ls -lR . >> ../cp_a_dira_dirb.bb; | ||
314 | |||
315 | @echo; | ||
316 | diff -u cp_a_dira_dirb.gnu cp_a_dira_dirb.bb; | ||
317 | |||
318 | @echo; | ||
319 | rm -rf cp_tests/dir{a,b}; | ||
320 | |||
321 | |||
322 | check_cp_dir_to_dir_w_a_take_two: | ||
323 | @echo; echo Copy a directory into another directory with the -a switch; | ||
324 | @echo ------------------------------; | ||
325 | mkdir -p cp_tests/gnu; \ | ||
326 | mkdir -p cp_tests/bb; \ | ||
327 | cd cp_tests; \ | ||
328 | mkdir here there; \ | ||
329 | echo A file > here/afile; \ | ||
330 | mkdir here/adir; \ | ||
331 | touch here/adir/afileinadir; \ | ||
332 | ln -s $$(pwd) here/alink; | ||
333 | |||
334 | @echo; | ||
335 | cd cp_tests/gnu; \ | ||
336 | ls -lR . > ../../cp_a_dir_dir.gnu; \ | ||
337 | ${GCP} -a here/ there/; \ | ||
338 | ls -lR . >> ../../cp_a_dir_dir.gnu; | ||
339 | |||
340 | @echo; | ||
341 | rm -rf cp_tests/there/*; | ||
342 | |||
343 | sleep 1; | ||
344 | |||
345 | @echo; | ||
346 | cd cp_tests/bb; \ | ||
347 | ls -lR . > ../../cp_a_dir_dir.bb; \ | ||
348 | ${BCP} -a here/ there/; \ | ||
349 | ls -lR . >> ../../cp_a_dir_dir.bb; | ||
350 | |||
351 | @echo; | ||
352 | echo "Erik 1" | ||
353 | diff -u cp_a_dir_dir.gnu cp_a_dir_dir.bb; | ||
354 | echo "Erik 2" | ||
355 | |||
356 | @echo; | ||
357 | echo "Erik 3" | ||
358 | rm -rf cp_tests/*; | ||
359 | |||
360 | |||
diff --git a/tests/ln_tests.mk b/tests/ln_tests.mk deleted file mode 100644 index 3110f8199..000000000 --- a/tests/ln_tests.mk +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | # ln_tests.mk - Set of tests for busybox ln | ||
2 | # ------------- | ||
3 | # Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org> GPL | ||
4 | # | ||
5 | |||
6 | # GNU `ln' | ||
7 | GLN = /bin/ln | ||
8 | # BusyBox `ln' | ||
9 | BLN = $(shell pwd)/ln | ||
10 | |||
11 | all:: ln_tests | ||
12 | clean:: ln_clean | ||
13 | |||
14 | ln_clean: | ||
15 | rm -rf ln_tests ln_*.{gnu,bb} ln | ||
16 | |||
17 | ln_tests: ln_clean ln | ||
18 | @echo; | ||
19 | @echo "No output from diff means busybox ln is functioning properly."; | ||
20 | |||
21 | @echo; | ||
22 | ${BLN} || true; | ||
23 | |||
24 | @echo; | ||
25 | mkdir ln_tests; | ||
26 | |||
27 | @echo; | ||
28 | cd ln_tests; \ | ||
29 | echo A file > afile; \ | ||
30 | ls -l afile > ../ln_afile_newname.gnu; \ | ||
31 | ${GLN} afile newname; \ | ||
32 | ls -l afile newname >> ../ln_afile_newname.gnu; | ||
33 | |||
34 | @echo; | ||
35 | rm -f ln_tests/{afile,newname}; | ||
36 | |||
37 | @echo; | ||
38 | cd ln_tests; \ | ||
39 | echo A file > afile; \ | ||
40 | ls -l afile > ../ln_afile_newname.bb; \ | ||
41 | ${BLN} afile newname; \ | ||
42 | ls -l afile newname >> ../ln_afile_newname.bb; | ||
43 | |||
44 | @echo; | ||
45 | diff -u ln_afile_newname.gnu ln_afile_newname.bb | ||
46 | |||
47 | @echo; | ||
48 | rm -f ln_tests/{afile,newname}; | ||
49 | |||
50 | @echo; | ||
51 | cd ln_tests; \ | ||
52 | echo A file > afile; \ | ||
53 | ls -l afile > ../ln_s_afile_newname.gnu; \ | ||
54 | ${GLN} -s afile newname; \ | ||
55 | ls -l afile newname >> ../ln_s_afile_newname.gnu; | ||
56 | |||
57 | @echo; | ||
58 | rm -f ln_tests/{afile,newname}; | ||
59 | |||
60 | @echo; | ||
61 | cd ln_tests; \ | ||
62 | echo A file > afile; \ | ||
63 | ls -l afile > ../ln_s_afile_newname.bb; \ | ||
64 | ${BLN} -s afile newname; \ | ||
65 | ls -l afile newname >> ../ln_s_afile_newname.bb; | ||
66 | |||
67 | @echo; | ||
68 | diff -u ln_s_afile_newname.gnu ln_s_afile_newname.bb | ||
69 | |||
70 | @echo; | ||
71 | rm -f ln_tests/{afile,newname}; | ||
diff --git a/tests/multibuild.pl b/tests/multibuild.pl deleted file mode 100755 index 301ed3500..000000000 --- a/tests/multibuild.pl +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # multibuild.pl | ||
4 | # Tests BusyBox-0.48 (at least) to see if each applet builds | ||
5 | # properly on its own. The most likely problems this will | ||
6 | # flush out are those involving preprocessor instructions in | ||
7 | # utility.c. | ||
8 | # | ||
9 | # TODO: some time it might be nice to list absolute and | ||
10 | # differential object sizes for each option... | ||
11 | # | ||
12 | |||
13 | $logfile = "multibuild.log"; | ||
14 | |||
15 | # How to handle all the CONFIG_FEATURE_FOO lines | ||
16 | if ($ARGV[0] eq "-all" ) { shift(@ARGV); $choice="all"; } | ||
17 | if ($ARGV[0] eq "-none") { shift(@ARGV); $choice="none"; } | ||
18 | # neither means, leave that part of Config.h alone | ||
19 | |||
20 | # Support building from pristine source | ||
21 | $make_opt = "-f $ARGV[0]/Makefile CONFIG_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne ""); | ||
22 | |||
23 | # Move the config file to a safe place | ||
24 | -e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die; | ||
25 | |||
26 | # Clear previous log file, if any | ||
27 | unlink($logfile); | ||
28 | |||
29 | # Parse the config file | ||
30 | open(C,"<Config.h.orig") || die; | ||
31 | while (<C>) { | ||
32 | if ($in_trailer) { | ||
33 | if (!$in_olympus) { | ||
34 | s/^\/\/#/#/ if ($choice eq "all" && !/USE_DEVPS_PATCH/); | ||
35 | s/^#/\/\/#/ if ($choice eq "none"); | ||
36 | } | ||
37 | $in_olympus=1 if /End of Features List/; | ||
38 | $trailer .= $_; | ||
39 | } else { | ||
40 | $in_trailer=1 if /End of Applications List/; | ||
41 | if (/^\/*#define CONFIG_([A-Z0-9_]*)/) { | ||
42 | push @apps, $1; | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | close C; | ||
47 | |||
48 | # Do the real work ... | ||
49 | $failed_tests=0; | ||
50 | for $a (@apps) { | ||
51 | # print "Testing build of applet $a ...\n"; | ||
52 | open (O, ">Config.h") || die; | ||
53 | print O "#define CONFIG_$a\n", $trailer; | ||
54 | close O; | ||
55 | system("echo -e '\n***\n$a\n***' >>$logfile"); | ||
56 | # With a fast computer and 1-second resolution on file timestamps, this | ||
57 | # process pushes beyond the limits of what unix make can understand. | ||
58 | # That's why need to weed out obsolete files before restarting make. | ||
59 | $result{$a} = system("rm -f *.o applet_source_list; make $make_opt busybox >>$logfile 2>&1"); | ||
60 | $flag = $result{$a} ? "FAILED!!!" : "ok"; | ||
61 | printf("Applet %-20s: %s\n", $a, $flag); | ||
62 | $total_tests++; | ||
63 | $failed_tests++ if $flag eq "FAILED!!!"; | ||
64 | # pause long enough to let user stop us with a ^C | ||
65 | select(undef, undef, undef, 0.03); | ||
66 | } | ||
67 | |||
68 | # Clean up our mess | ||
69 | system("mv -f Config.h.orig Config.h"); | ||
70 | |||
71 | print "$total_tests applets tested, $failed_tests failures\n"; | ||
72 | print "See $logfile for details.\n"; | ||
73 | |||
diff --git a/tests/multifeat.pl b/tests/multifeat.pl deleted file mode 100755 index 875b4a277..000000000 --- a/tests/multifeat.pl +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # | ||
3 | # multifeat.pl | ||
4 | # | ||
5 | # Turns on all applets, then tests turning on one feature at a time through | ||
6 | # iterative compilations. Tests if any features depend on each other in any | ||
7 | # weird ways or such-like problems. | ||
8 | # | ||
9 | # Hacked by Mark Whitley, but based *heavily* on multibuild.pl which was | ||
10 | # written by Larry Doolittle. | ||
11 | |||
12 | $logfile = "multifeat.log"; | ||
13 | |||
14 | # How to handle all the CONFIG_APPLET lines | ||
15 | # (most thorough testing occurs when you call it with the -all switch) | ||
16 | if ($ARGV[0] eq "-all" ) { shift(@ARGV); $choice="all"; } | ||
17 | if ($ARGV[0] eq "-none") { shift(@ARGV); $choice="none"; } | ||
18 | # neither means, leave that part of Config.h alone | ||
19 | |||
20 | # Support building from pristine source | ||
21 | $make_opt = "-f $ARGV[0]/Makefile CONFIG_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne ""); | ||
22 | |||
23 | # Move the config file to a safe place | ||
24 | -e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die; | ||
25 | |||
26 | # Clear previous log file, if any | ||
27 | unlink($logfile); | ||
28 | |||
29 | # Parse the config file | ||
30 | open(C,"<Config.h.orig") || die; | ||
31 | $in_applist=1; | ||
32 | $in_features=0; | ||
33 | $in_olympus=0; | ||
34 | while (<C>) { | ||
35 | if ($in_applist) { | ||
36 | s/^\/\/#/#/ if ($choice eq "all"); | ||
37 | s/^#/\/\/#/ if ($choice eq "none"); | ||
38 | $header .= $_; | ||
39 | if (/End of Applications List/) { | ||
40 | $in_applist=0; | ||
41 | $in_features=1 | ||
42 | } | ||
43 | } | ||
44 | elsif ($in_features) { | ||
45 | if (/^\/*#define CONFIG_FEATURE_([A-Z0-9_]*)/) { | ||
46 | push @features, $1; | ||
47 | } | ||
48 | if (/End of Features List/) { | ||
49 | $in_features=0; | ||
50 | $in_olympus=1 | ||
51 | } | ||
52 | } elsif ($in_olympus) { | ||
53 | $trailer .= $_; | ||
54 | } | ||
55 | } | ||
56 | close C; | ||
57 | |||
58 | # Do the real work ... | ||
59 | $failed_tests=0; | ||
60 | for $f (@features) { | ||
61 | # print "Testing build with feature $f ...\n"; | ||
62 | open (O, ">Config.h") || die; | ||
63 | print O $header, "#define CONFIG_FEATURE_$f\n", $trailer; | ||
64 | close O; | ||
65 | system("echo -e '\n***\n$f\n***' >>$logfile"); | ||
66 | # With a fast computer and 1-second resolution on file timestamps, this | ||
67 | # process pushes beyond the limits of what unix make can understand. | ||
68 | # That's why need to weed out obsolete files before restarting make. | ||
69 | $result{$f} = system("rm -f *.o applet_source_list; make $make_opt busybox >>$logfile 2>&1"); | ||
70 | $flag = $result{$f} ? "FAILED!!!" : "ok"; | ||
71 | printf("Feature %-20s: %s\n", $f, $flag); | ||
72 | $total_tests++; | ||
73 | $failed_tests++ if $flag eq "FAILED!!!"; | ||
74 | # pause long enough to let user stop us with a ^C | ||
75 | select(undef, undef, undef, 0.03); | ||
76 | } | ||
77 | |||
78 | # Clean up our mess | ||
79 | system("mv -f Config.h.orig Config.h"); | ||
80 | |||
81 | print "$total_tests applets tested, $failed_tests failures\n"; | ||
82 | print "See $logfile for details.\n"; | ||
83 | |||
diff --git a/tests/mv_tests.mk b/tests/mv_tests.mk deleted file mode 100644 index f03e08a73..000000000 --- a/tests/mv_tests.mk +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | # mv_tests.mk - Set of tests cases for busybox mv | ||
2 | # ------------- | ||
3 | # Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org> GPL | ||
4 | # | ||
5 | |||
6 | # GNU `mv' | ||
7 | GMV = /bin/mv | ||
8 | # BusyBox `mv' | ||
9 | BMV = $(shell pwd)/mv | ||
10 | |||
11 | all:: mv_tests | ||
12 | clean:: mv_clean | ||
13 | |||
14 | mv_clean: | ||
15 | rm -rf mv_tests mv_*.{gnu,bb} mv | ||
16 | |||
17 | mv_tests: mv_clean mv | ||
18 | @echo; | ||
19 | @echo "No output from diff means busybox mv is functioning properly."; | ||
20 | @echo; | ||
21 | @echo "No such file or directory is good; it means the old file got removed."; | ||
22 | @echo; | ||
23 | ${BMV} || true; | ||
24 | |||
25 | @echo; | ||
26 | mkdir mv_tests; | ||
27 | |||
28 | @echo; | ||
29 | cd mv_tests; \ | ||
30 | echo A file > afile; \ | ||
31 | ls -l afile > ../mv_afile_newname.gnu; \ | ||
32 | ${GMV} afile newname; \ | ||
33 | ls -l newname >> ../mv_afile_newname.gnu; | ||
34 | -ls -l mv_tests/afile; | ||
35 | |||
36 | @echo; | ||
37 | rm -f mv_tests/{afile,newname}; | ||
38 | |||
39 | @echo; | ||
40 | cd mv_tests; \ | ||
41 | echo A file > afile; \ | ||
42 | ls -l afile > ../mv_afile_newname.bb; \ | ||
43 | ${BMV} afile newname; \ | ||
44 | ls -l newname >> ../mv_afile_newname.bb; | ||
45 | -ls -l mv_tests/afile; | ||
46 | |||
47 | @echo; | ||
48 | diff -u mv_afile_newname.gnu mv_afile_newname.bb; | ||
49 | |||
50 | @echo; | ||
51 | rm -f mv_tests/{afile,newname}; | ||
52 | |||
53 | @echo; echo ------------------------------; | ||
54 | cd mv_tests; \ | ||
55 | echo A file > afile; \ | ||
56 | ln -s afile symlink; \ | ||
57 | ls -l afile symlink > ../mv_symlink_newname.gnu; \ | ||
58 | ${GMV} symlink newname; \ | ||
59 | ls -l afile newname >> ../mv_symlink_newname.gnu; | ||
60 | -ls -l mv_tests/symlink; | ||
61 | |||
62 | @echo; | ||
63 | rm -f mv_tests/{afile,newname}; | ||
64 | |||
65 | @echo; | ||
66 | cd mv_tests; \ | ||
67 | echo A file > afile; \ | ||
68 | ln -s afile symlink; \ | ||
69 | ls -l afile symlink > ../mv_symlink_newname.bb;\ | ||
70 | ${BMV} symlink newname; \ | ||
71 | ls -l afile newname >> ../mv_symlink_newname.bb; | ||
72 | -ls -l mv_tests/symlink; | ||
73 | |||
74 | @echo; | ||
75 | diff -u mv_symlink_newname.gnu mv_symlink_newname.bb; | ||
76 | |||
77 | @echo; | ||
78 | rm -rf mv_tests/*; | ||
79 | |||
80 | @echo; echo ------------------------------; | ||
81 | cd mv_tests; \ | ||
82 | echo A file > afile; \ | ||
83 | ln -s afile symlink; \ | ||
84 | mkdir newdir; \ | ||
85 | ls -lR > ../mv_file_symlink_dir.gnu; \ | ||
86 | ${GMV} symlink afile newdir; \ | ||
87 | ls -lR >> ../mv_file_symlink_dir.gnu; | ||
88 | -ls -l mv_tests/{symlink,afile}; | ||
89 | |||
90 | @echo; | ||
91 | rm -rf mv_tests/* | ||
92 | |||
93 | @echo; echo ------------------------------; | ||
94 | cd mv_tests; \ | ||
95 | echo A file > afile; \ | ||
96 | ln -s afile symlink; \ | ||
97 | mkdir newdir; \ | ||
98 | ls -lR > ../mv_file_symlink_dir.bb; \ | ||
99 | ${BMV} symlink afile newdir; \ | ||
100 | ls -lR >> ../mv_file_symlink_dir.bb; | ||
101 | -ls -l mv_tests/{symlink,afile}; | ||
102 | |||
103 | @echo; | ||
104 | diff -u mv_file_symlink_dir.gnu mv_file_symlink_dir.bb; | ||
105 | |||
106 | @echo; | ||
107 | rm -rf mv_tests/*; | ||
108 | |||
109 | @echo; echo ------------------------------; | ||
110 | cd mv_tests; \ | ||
111 | mkdir dir{a,b}; \ | ||
112 | echo A file > dira/afile; \ | ||
113 | echo A file in dirb > dirb/afileindirb; \ | ||
114 | ln -s dira/afile dira/alinktoafile; \ | ||
115 | mkdir dira/subdir1; \ | ||
116 | echo Another file > dira/subdir1/anotherfile; \ | ||
117 | ls -lR . > ../mv_dira_dirb.gnu; \ | ||
118 | ${GMV} dira dirb; \ | ||
119 | ls -lR . >> ../mv_dira_dirb.gnu; | ||
120 | |||
121 | # false; | ||
122 | @echo; | ||
123 | rm -rf mv_tests/dir{a,b}; | ||
124 | |||
125 | @echo; | ||
126 | cd mv_tests; \ | ||
127 | mkdir dir{a,b}; \ | ||
128 | echo A file > dira/afile; \ | ||
129 | echo A file in dirb > dirb/afileindirb; \ | ||
130 | ln -s dira/afile dira/alinktoafile; \ | ||
131 | mkdir dira/subdir1; \ | ||
132 | echo Another file > dira/subdir1/anotherfile; \ | ||
133 | ls -lR . > ../mv_dira_dirb.bb; \ | ||
134 | ${BMV} dira dirb; \ | ||
135 | ls -lR . >> ../mv_dira_dirb.bb; | ||
136 | |||
137 | @echo; | ||
138 | diff -u mv_dira_dirb.gnu mv_dira_dirb.bb; | ||
139 | |||
140 | # false; | ||
141 | @echo; | ||
142 | rm -rf mv_tests/dir{a,b}; | ||
143 | |||
144 | @echo; echo ------------------------------; | ||
145 | @echo There should be an error message about cannot mv a dir to a subdir of itself. | ||
146 | cd mv_tests; \ | ||
147 | mkdir adir; \ | ||
148 | touch -r . a b c adir; \ | ||
149 | ls -lR . > ../mv_a_star_adir.gnu; \ | ||
150 | ${GMV} * adir; \ | ||
151 | ls -lR . >> ../mv_a_star_adir.gnu; | ||
152 | |||
153 | @echo | ||
154 | @echo There should be an error message about cannot mv a dir to a subdir of itself. | ||
155 | cd mv_tests; \ | ||
156 | rm -rf a b c adir; \ | ||
157 | mkdir adir; \ | ||
158 | touch -r . a b c adir; \ | ||
159 | ls -lR . > ../mv_a_star_adir.bb; \ | ||
160 | ${BMV} * adir; \ | ||
161 | ls -lR . >> ../mv_a_star_adir.bb; | ||
162 | |||
163 | @echo; | ||
164 | diff -u mv_a_star_adir.gnu mv_a_star_adir.bb; | ||
165 | |||
166 | @echo; | ||
167 | rm -rf mv_test/*; | ||
diff --git a/tests/sh.testcases b/tests/sh.testcases deleted file mode 100644 index aa834d4a2..000000000 --- a/tests/sh.testcases +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | # try running this with bash, ksh, ash, and hush. | ||
2 | |||
3 | # simple quoting rules. | ||
4 | echo a b | ||
5 | echo "a b" | ||
6 | echo a "" b | ||
7 | echo a '' b | ||
8 | echo hello? | ||
9 | echo "hello?" | ||
10 | echo t* hello | ||
11 | echo t\* hello | ||
12 | |||
13 | # quick and painless exit for lash | ||
14 | if false; then true; exit; fi | ||
15 | |||
16 | # fairly simple command substitution | ||
17 | echo `echo -e foo\\\necho bar` | ||
18 | |||
19 | echo THIS IS A TEST >foo | ||
20 | cat $(echo FOO | tr 'A-Z' 'a-z') | ||
21 | cat foo | tr 'A-Z' 'a-z' | ||
22 | cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z' | ||
23 | |||
24 | cat foo | if true; then tr 'A-Z' 'a-z'; else echo bar1; fi | ||
25 | cat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fi | ||
26 | if true; then tr 'A-Z' 'a-z'; else echo bar3; fi <foo | ||
27 | if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo | ||
28 | if true || false; then echo foo; else echo bar5; fi | ||
29 | if true && false; then echo bar6; else echo foo; fi | ||
30 | |||
31 | # basic distinction between local and env variables | ||
32 | unset FOO | ||
33 | FOO=bar env | grep FOO | ||
34 | echo "but not here: $FOO" | ||
35 | FOO=bar | ||
36 | env | grep FOO | ||
37 | echo "yes, here: $FOO" | ||
38 | FOO= | ||
39 | echo a $FOO b | ||
40 | echo "a $FOO b" | ||
41 | |||
42 | # not quite so basic variables. Credit to Matt Kraai. | ||
43 | unset FOO | ||
44 | FOO=bar | ||
45 | export FOO | ||
46 | env | grep FOO | ||
47 | unset FOO | ||
48 | export FOO=bar | ||
49 | FOO=baz | ||
50 | env | grep FOO | ||
51 | |||
52 | # interaction between environment variables and if/then and subshells | ||
53 | FOO=default | ||
54 | if true; then FOO=new; fi | ||
55 | echo $FOO | ||
56 | FOO=default | ||
57 | (FOO=bogus) | ||
58 | echo $FOO | ||
59 | |||
60 | # make sure we can duplicate file descriptors properly | ||
61 | echo replacement >foo 2>&1 | ||
62 | cat foo | ||
63 | cat doesnt_exist >foo 2>&1 | ||
64 | tr 'a-z' 'A-Z' <foo | ||
65 | |||
66 | # fairly simple example of hush expanding variables too early | ||
67 | unset TMP | ||
68 | rm -f fish | ||
69 | TMP=fish && >$TMP | ||
70 | ls fish | ||
71 | |||
72 | # ash, lash, and hush do not create wish; bash and ksh do. | ||
73 | # Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test. | ||
74 | unset TMP | ||
75 | rm -f wish | ||
76 | TMP=wish >$TMP | ||
77 | ls wish | ||
78 | |||
79 | # The following example shows that hush's parser is | ||
80 | # not _really_ Bourne compatible | ||
81 | echo "echo Hello World" >"a=b" | ||
82 | unset a | ||
83 | chmod a+x "a=b" | ||
84 | PATH=$PATH:. | ||
85 | "a=b" | ||
86 | echo $a | ||
87 | |||
88 | # assuming the shell wasn't too buggy, clean up the mess | ||
89 | rm -f a=b wish fish foo | ||
diff --git a/tests/syslog_test.c b/tests/syslog_test.c deleted file mode 100644 index fb4c691b1..000000000 --- a/tests/syslog_test.c +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #include <syslog.h> | ||
2 | |||
3 | int do_log(char* msg, int delay) | ||
4 | { | ||
5 | openlog("testlog", LOG_PID, LOG_DAEMON); | ||
6 | while(1) { | ||
7 | syslog(LOG_ERR, "%s: testing one, two, three\n", msg); | ||
8 | sleep(delay); | ||
9 | } | ||
10 | closelog(); | ||
11 | return(0); | ||
12 | }; | ||
13 | |||
14 | int main(void) | ||
15 | { | ||
16 | if (fork()==0) | ||
17 | do_log("A", 2); | ||
18 | do_log("B", 3); | ||
19 | } | ||
diff --git a/tests/testcases b/tests/testcases deleted file mode 100644 index 37e741260..000000000 --- a/tests/testcases +++ /dev/null | |||
@@ -1,404 +0,0 @@ | |||
1 | # testcases | ||
2 | # | ||
3 | # This file should be filled with test cases to test applets that: | ||
4 | # | ||
5 | # - can somehow produce output (we can't test sync or sleep) | ||
6 | # - have a GNU (or other) counterpart | ||
7 | # - are not interactive (don't require a ^C or anything) | ||
8 | # - don't require extensive setup or cleanup (a litte setup is fine) | ||
9 | # - don't have huge and possibly damaging effects (fsck, swapoff) | ||
10 | # | ||
11 | # If possible, a test case should be made that tests each option the applet | ||
12 | # supports. When a new option is added, a new test case should be written for | ||
13 | # it. When somebody reports a bug with a testcase, that testcase should be | ||
14 | # added here as well. | ||
15 | # | ||
16 | # Some other guidelines to follow: | ||
17 | # | ||
18 | # - please try to keep applets alphabetized, it will make life easier | ||
19 | # - use the file tester.sh or testcases when you need to do a non-destructive | ||
20 | # test on a file (i.e., cat, md5sum) | ||
21 | # - try to make the applet you're testing the first thing on the line (this | ||
22 | # not always possible) | ||
23 | # - (???) if you have to create a temporary file, call it TMPFILE | ||
24 | # - pipe symbols that represent real pipes need a space in front of them | ||
25 | # (so the test script can find them and add the "../busybox" after it). | ||
26 | # - pipe symbols that are not used for pipes need to be shell-escaped, | ||
27 | # with a double \. See the expr test cases. | ||
28 | |||
29 | |||
30 | # ar | ||
31 | |||
32 | # basename | ||
33 | basename `pwd` | ||
34 | |||
35 | # cat | ||
36 | cat tester.sh | ||
37 | echo hello there | cat tester.sh - | ||
38 | |||
39 | # chmod | ||
40 | # chown | ||
41 | # chgrp | ||
42 | # chroot | ||
43 | # chvt - can't be tested here | ||
44 | # clear - can't be tested here | ||
45 | # cmp | ||
46 | # cp | ||
47 | |||
48 | # cut | ||
49 | echo "1234" | cut -c1 | ||
50 | echo "1234" | cut -c 1 | ||
51 | echo "1234567890" | cut -c2-7 | ||
52 | echo "1234567890" | cut -c 2-7 | ||
53 | echo "f1 f2" | cut -f2 | ||
54 | echo "f1 f2" | cut -f 2 | ||
55 | echo "f1 f2 f3 f4 f5" | cut -f2-4 | ||
56 | echo "f1 f2 f3 f4 f5" | cut -f 2-4 | ||
57 | |||
58 | # date | ||
59 | date | ||
60 | date -R | ||
61 | date -u | ||
62 | date +%d/%m/%y | ||
63 | |||
64 | # dc - needs an input file | ||
65 | |||
66 | # dd | ||
67 | # BUG: record count line goes to stdout instead of stderr | ||
68 | dd if=/dev/urandom of=O bs=1k count=1 ; ls -l O ; rm O | ||
69 | |||
70 | # deallocvt | ||
71 | |||
72 | # df | ||
73 | # XXX: minor formatting differences | ||
74 | df | ||
75 | df . | ||
76 | df -k | ||
77 | df -h | ||
78 | df -m | ||
79 | |||
80 | # dirname | ||
81 | dirname `pwd` | ||
82 | |||
83 | # dmesg (XXX: change the silly cmd business in the source) | ||
84 | dmesg | ||
85 | dmesg -n 8 | ||
86 | dmesg -s 512 | ||
87 | # I really don't want to do this next one | ||
88 | #dmesg -c | ||
89 | |||
90 | # dos2unix - needs an input file | ||
91 | # dpkg | ||
92 | # dpkg_deb | ||
93 | |||
94 | # du | ||
95 | # BUG: rounding behavior differs from GNU du | ||
96 | du | ||
97 | du -s | ||
98 | du -l | ||
99 | du -k | ||
100 | du -h | ||
101 | du -m | ||
102 | |||
103 | # dumpkmap - no counterprt? | ||
104 | # dutmp - no counterprt? | ||
105 | |||
106 | # echo | ||
107 | echo "foo bar baz" | ||
108 | echo -n "no newline" | ||
109 | |||
110 | |||
111 | # expr | ||
112 | expr 1 \\| 1 | ||
113 | expr 1 \\| 0 | ||
114 | expr 0 \\| 1 | ||
115 | expr 0 \\| 0 | ||
116 | |||
117 | expr 1 \\& 1 | ||
118 | expr 1 \\& 0 | ||
119 | expr 0 \\& 1 | ||
120 | expr 0 \\& 0 | ||
121 | |||
122 | expr 0 \\< 1 | ||
123 | expr 1 \\< 0 | ||
124 | |||
125 | expr 1 \\> 0 | ||
126 | expr 0 \\> 1 | ||
127 | |||
128 | expr 0 \\<= 1 | ||
129 | expr 1 \\<= 0 | ||
130 | expr 1 \\<= 1 | ||
131 | |||
132 | expr 1 \\>= 0 | ||
133 | expr 0 \\>= 1 | ||
134 | expr 1 \\>= 1 | ||
135 | |||
136 | expr 1 + 2 | ||
137 | expr 2 - 1 | ||
138 | expr 2 \\* 3 | ||
139 | expr 12 / 2 | ||
140 | expr 12 % 5 | ||
141 | |||
142 | # somebody else can do all the string stuff | ||
143 | |||
144 | |||
145 | # fbset - can't be tested here | ||
146 | # fdflush | ||
147 | # find | ||
148 | find . | ||
149 | |||
150 | # free | ||
151 | # XXX: minor formatting differences | ||
152 | free | ||
153 | |||
154 | # freeramdisk | ||
155 | # fsck.minix - won't test | ||
156 | # getopt | ||
157 | |||
158 | # grep | ||
159 | grep -l strdup ../*utils/*.c | ||
160 | grep -c strdup ../*utils/*.c | ||
161 | grep -lc strdup ../*utils/*.c | ||
162 | grep -cv strdup ../*utils/*.c | ||
163 | grep -i null ../findutils/grep.c | ||
164 | grep -e strdup -e regcomp -e atexit ../findutils/grep.c | ||
165 | |||
166 | # gunzip | ||
167 | |||
168 | # gzip | ||
169 | # XXX: compressed output differs from gzip-1.2.4, but decompresses fine | ||
170 | echo testing 1 2 3 >tmpfile1; gzip tmpfile1; echo tmpfile*; md5sum tmpfile1.gz; rm tmpfile1.gz | ||
171 | echo testing 1 2 3 | gzip >tmpfile1.gz; md5sum tmpfile1.gz; rm tmpfile1.gz | ||
172 | |||
173 | |||
174 | # halt - won't test, dangerous | ||
175 | |||
176 | # head | ||
177 | head tester.sh | ||
178 | head -n 2 tester.sh | ||
179 | |||
180 | # hostid | ||
181 | hostid | ||
182 | |||
183 | # hostname | ||
184 | # XXX: minor formatting differences | ||
185 | hostname | ||
186 | hostname -s | ||
187 | hostname -i | ||
188 | hostname -d | ||
189 | # not going to do this next one | ||
190 | #hostname -F | ||
191 | |||
192 | # id | ||
193 | # BUG: Busybox id doesn't print supplemental groups | ||
194 | id | ||
195 | id -u | ||
196 | id -g | ||
197 | id -ur | ||
198 | id -un | ||
199 | |||
200 | |||
201 | # ifconfig | ||
202 | # requires CONFIG_FEATURE_IFCONFIG_STATUS | ||
203 | ifconfig | ||
204 | #ifconfig -a | ||
205 | #ifconfig eth0 | ||
206 | #ifconfig lo | ||
207 | |||
208 | # init - won't test | ||
209 | # insmod - won't test | ||
210 | |||
211 | # kill | ||
212 | #kill -l | ||
213 | # not going to do any more | ||
214 | |||
215 | # length | ||
216 | # ln - see ln_tests.mk | ||
217 | # loadacm | ||
218 | # loadfont | ||
219 | # loadkmap | ||
220 | # logger | ||
221 | # logname | ||
222 | |||
223 | # ls | ||
224 | # XXX: minor formatting differences | ||
225 | ls ../e* | ||
226 | ls -l ../e* | ||
227 | ls -s ../e* | ||
228 | ls -h ../e* | ||
229 | ls -1 ../e* | ||
230 | |||
231 | # lsmod | ||
232 | lsmod | ||
233 | |||
234 | # makedevs | ||
235 | |||
236 | # md5sum | ||
237 | md5sum tester.sh | ||
238 | |||
239 | # mkdir | ||
240 | mkdir D ; ls -ld D ; rmdir D | ||
241 | |||
242 | # mkfifo | ||
243 | # | ||
244 | # we will test making one. actually testing pushing data through it requires | ||
245 | # more interaction than we can manage here. | ||
246 | # (these lines turn up an existing ls bug) | ||
247 | mkfifo F ; ls -l F ; rm F | ||
248 | mkfifo -m 0600 F ; ls -l F ; rm F | ||
249 | |||
250 | # mkfs.minix - won't test | ||
251 | # mknod | ||
252 | # mkswap - won't test | ||
253 | # mktemp | ||
254 | # more - can't test: interactive | ||
255 | |||
256 | # mount | ||
257 | # BUG: proc line starts with /proc instead of proc | ||
258 | mount | ||
259 | # not going to test mount with any args, can't be done safely or sanely | ||
260 | |||
261 | # mt | ||
262 | # mv - see mv_tests.mk | ||
263 | # nc | ||
264 | # nfsmount | ||
265 | # nslookup | ||
266 | # ping | ||
267 | ping -c 3 yahoo.com | ||
268 | # pivot_root | ||
269 | # poweroff - won't test | ||
270 | # printf | ||
271 | # ps - there's lotsa differences between busybox ps and any other ps | ||
272 | |||
273 | # pwd | ||
274 | pwd | ||
275 | |||
276 | # rdate - won't test | ||
277 | |||
278 | # readlink | ||
279 | ln -sf tester.sh L ; readlink L ; rm -f L | ||
280 | |||
281 | # reboot - won't test | ||
282 | # renice - won't test | ||
283 | # reset - can't test: no output | ||
284 | |||
285 | # rm | ||
286 | touch F ; rm F | ||
287 | |||
288 | # rmdir | ||
289 | # rmmod - won't test: dangerous | ||
290 | |||
291 | # route | ||
292 | # XXX: doesn't DNS resolve | ||
293 | route | ||
294 | |||
295 | # rpm2cpio | ||
296 | |||
297 | # sed - we can do some one-liners here, some testing is a little | ||
298 | # difficult to do in just this space (like a,i,c cmds). | ||
299 | |||
300 | # test ^$ matching | ||
301 | echo foo | sed -ne '/^$/p' | ||
302 | echo -e "foo\\n\\nbar" | sed -ne '/^$/p' | ||
303 | |||
304 | sed -e '/test$/d' testcases | ||
305 | sed -e '/^echo/d' testcases | ||
306 | sed -e '/test/s/dangerous/PELIGROSO/' testcases | ||
307 | sed -ne '1,/getopt/p' ../shellutils/pwd.c | ||
308 | sed -e '/getopt/r ../shellutils/pwd.c' ../editors/sed.c | ||
309 | |||
310 | |||
311 | # setkeycodes | ||
312 | |||
313 | # sh - note that we cannot test the shell interactively here | ||
314 | sh -c "echo a b c" | ||
315 | sh -c ">" | ||
316 | sh -c "a" | ||
317 | sh sh.testcases | ||
318 | |||
319 | |||
320 | # sleep - can't test: produces no output | ||
321 | |||
322 | # sort | ||
323 | sort tester.sh | ||
324 | sort -n tester.sh | ||
325 | sort -r tester.sh | ||
326 | |||
327 | # stty | ||
328 | # swapon - won't test: dangerous | ||
329 | # swapoff - won't test: dangerous | ||
330 | # sync - can't test: no output | ||
331 | # syslogd - won't test: too involved | ||
332 | |||
333 | # tail | ||
334 | tail tester.sh | ||
335 | tail -n 2 tester.sh | ||
336 | |||
337 | # tar | ||
338 | |||
339 | # tee | ||
340 | echo "please tee me!" | tee A B C ; cat A B C | ||
341 | echo "please tee me!" | tee A B C ; echo "tee me too!" | tee -a A B C ; cat A B C ; rm A B C | ||
342 | |||
343 | # telnet - can't test: interactive | ||
344 | |||
345 | # test | ||
346 | # tftp | ||
347 | |||
348 | # touch | ||
349 | touch tmpfile1; ls tmpfile1; rm -f tmpfile1 | ||
350 | touch -c tmpfile1; ls tmpfile1; rm -f tmpfile1 | ||
351 | |||
352 | # tr | ||
353 | # BUG: Busybox tr range handling minix style [a-z] instead of GNU # style a-z | ||
354 | echo "cbaab" | tr abc zyx | ||
355 | echo "TESTING A B C" | tr [A-Z] [a-z] | ||
356 | # not GNU compatible | ||
357 | echo fdhrnzvfu bffvsentr | tr [a-z] [n-z][a-m] | ||
358 | echo abc[] | tr a[b AXB | ||
359 | echo testing | tr -d aeiou | ||
360 | |||
361 | # true | ||
362 | true ; echo $? | ||
363 | |||
364 | # false | ||
365 | false ; echo $? | ||
366 | |||
367 | # tty | ||
368 | # umount | ||
369 | # uname | ||
370 | # uniq | ||
371 | # unix2dos | ||
372 | # update | ||
373 | |||
374 | # uptime | ||
375 | # BUG: doesn't print number of users | ||
376 | uptime | ||
377 | |||
378 | # usleep | ||
379 | # uudecode | ||
380 | # uuencode | ||
381 | # watchdog | ||
382 | |||
383 | # wc | ||
384 | wc tester.sh | ||
385 | wc -c tester.sh | ||
386 | wc -w tester.sh | ||
387 | wc -l tester.sh | ||
388 | wc -L tester.sh | ||
389 | |||
390 | # wget | ||
391 | |||
392 | # which | ||
393 | which ls | ||
394 | |||
395 | # whoami | ||
396 | whoami | ||
397 | |||
398 | # xargs | ||
399 | # XXX: Busygox xargs divides filenames with '\n' instead of ' ' | ||
400 | ls -1 ../e* | xargs | ||
401 | ls -1 ../e* | xargs md5sum | ||
402 | |||
403 | # yes - can't test: interactive (needs ^C) | ||
404 | |||
diff --git a/tests/tester.sh b/tests/tester.sh deleted file mode 100755 index a17762f05..000000000 --- a/tests/tester.sh +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # tester.sh - reads testcases from file and tests busybox applets vs GNU | ||
4 | # counterparts | ||
5 | # | ||
6 | # This should be run from within the tests/ directory. Before you run it, you | ||
7 | # should compile up a busybox that has all applets and all features turned on. | ||
8 | |||
9 | # set up defaults (can be changed with cmd-line options) | ||
10 | BUSYBOX=../busybox | ||
11 | TESTCASES=testcases | ||
12 | LOGFILE=tester.log | ||
13 | CONFIG_OUT=bb.out | ||
14 | GNU_OUT=gnu.out | ||
15 | SETUP="" | ||
16 | CLEANUP="" | ||
17 | KEEPTMPFILES="no" | ||
18 | DEBUG=2 | ||
19 | |||
20 | |||
21 | #while getopts 'p:t:l:b:g:s:c:kd:' opt | ||
22 | while getopts 'p:t:l:s:c:kd:' opt | ||
23 | do | ||
24 | case $opt in | ||
25 | p) BUSYBOX=$OPTARG; ;; | ||
26 | t) TESTCASES=$OPTARG; ;; | ||
27 | l) LOGFILE=$OPTARG; ;; | ||
28 | # b) CONFIG_OUT=$OPTARG; ;; | ||
29 | # g) GNU_OUT=$OPTARG; ;; | ||
30 | s) SETUP=$OPTARG; ;; | ||
31 | c) CLEANUP=$OPTARG; ;; | ||
32 | k) KEEPTMPFILES="yes"; ;; | ||
33 | d) DEBUG=$OPTARG; ;; | ||
34 | *) | ||
35 | echo "usage: $0 [-ptlbgsc]" | ||
36 | echo " -p PATH path to busybox executable (default=$BUSYBOX)" | ||
37 | echo " -t FILE run testcases in FILE (default=$TESTCASES)" | ||
38 | echo " -l FILE log test results in FILE (default=$LOGFILE)" | ||
39 | # echo " -b FILE store temporary busybox output in FILE" | ||
40 | # echo " -g FILE store temporary GNU output in FILE" | ||
41 | echo " -s FILE (setup) run commands in FILE before testcases" | ||
42 | echo " -c FILE (cleanup) run commands in FILE after testcases" | ||
43 | echo " -k keep temporary output files (don't delete them)" | ||
44 | echo " -d NUM set level of debugging output" | ||
45 | echo " 0 = no output" | ||
46 | echo " 1 = output failures / whoops lines only" | ||
47 | echo " 2 = (default) output setup / cleanup msgs and testcase lines" | ||
48 | echo " 3+= other debug noise (internal stuff)" | ||
49 | exit 1 | ||
50 | ;; | ||
51 | esac | ||
52 | done | ||
53 | #shift `expr $OPTIND - 1` | ||
54 | |||
55 | |||
56 | # maybe print some debug output | ||
57 | if [ $DEBUG -ge 3 ] | ||
58 | then | ||
59 | echo "BUSYBOX=$BUSYBOX" | ||
60 | echo "TESTCASES=$TESTCASES" | ||
61 | echo "LOGFILE=$LOGFILE" | ||
62 | echo "CONFIG_OUT=$CONFIG_OUT" | ||
63 | echo "GNU_OUT=$GNU_OUT" | ||
64 | echo "SETUP=$SETUP" | ||
65 | echo "CLEANUP=$CLEANUP" | ||
66 | echo "DEBUG=$DEBUG" | ||
67 | fi | ||
68 | |||
69 | |||
70 | # do sanity checks | ||
71 | if [ ! -e $BUSYBOX ] | ||
72 | then | ||
73 | echo "Busybox executable: $BUSYBOX not found!" | ||
74 | exit 1 | ||
75 | fi | ||
76 | |||
77 | if [ ! -e $TESTCASES ] | ||
78 | then | ||
79 | echo "Testcases file: $TESTCASES not found!" | ||
80 | exit 1 | ||
81 | fi | ||
82 | |||
83 | |||
84 | # do normal setup | ||
85 | [ -e $LOGFILE ] && rm $LOGFILE | ||
86 | unalias -a # gets rid of aliases that might create different output | ||
87 | |||
88 | |||
89 | # do extra setup (if any) | ||
90 | if [ ! -z "$SETUP" ] | ||
91 | then | ||
92 | [ $DEBUG -ge 2 ] && echo "running setup commands in $SETUP" | ||
93 | source $SETUP | ||
94 | fi | ||
95 | |||
96 | |||
97 | # go through each line in the testcase file | ||
98 | cat $TESTCASES | while read line | ||
99 | do | ||
100 | #echo $line | ||
101 | # only process non-blank lines and non-comment lines | ||
102 | if [ "$line" ] | ||
103 | then | ||
104 | if [ `echo "$line" | cut -c1` != "#" ] | ||
105 | then | ||
106 | |||
107 | # test if the applet was compiled into busybox | ||
108 | # (this only tests the applet at the beginning of the line) | ||
109 | #applet=`echo $line | cut -d' ' -f1` | ||
110 | applet=`echo $line | sed 's/\(^[^ ;]*\)[ ;].*/\1/'` | ||
111 | $BUSYBOX 2>&1 | grep -qw $applet | ||
112 | if [ $? -eq 1 ] | ||
113 | then | ||
114 | echo "WHOOPS: $applet not compiled into busybox" | tee -a $LOGFILE | ||
115 | else | ||
116 | |||
117 | # execute line using gnu / system programs | ||
118 | [ $DEBUG -ge 2 ] && echo "testing: $line" | tee -a $LOGFILE | ||
119 | sh -c "$line" > $GNU_OUT | ||
120 | |||
121 | # change line to include "busybox" before every statement | ||
122 | line="$BUSYBOX $line" | ||
123 | # is this a bash-2-ism? | ||
124 | # line=${line//;/; $BUSYBOX } | ||
125 | # line=${line//|/| $BUSYBOX } | ||
126 | # assume $BUSYBOX has no commas | ||
127 | line=`echo "$line" | sed -e 's,;,; '$BUSYBOX, \ | ||
128 | -e 's, |, | '$BUSYBOX,` | ||
129 | |||
130 | # execute line using busybox programs | ||
131 | [ $DEBUG -ge 2 ] && echo "testing: $line" | tee -a $LOGFILE | ||
132 | sh -c "$line" > $CONFIG_OUT | ||
133 | |||
134 | # see if they match | ||
135 | diff -q $CONFIG_OUT $GNU_OUT > /dev/null | ||
136 | if [ $? -eq 1 ] | ||
137 | then | ||
138 | [ $DEBUG -ge 1 ] && echo "FAILED: $line" | tee -a $LOGFILE | ||
139 | diff -u $CONFIG_OUT $GNU_OUT >> $LOGFILE | ||
140 | fi | ||
141 | fi | ||
142 | fi | ||
143 | fi | ||
144 | done | ||
145 | |||
146 | [ $DEBUG -gt 0 ] && echo "Finished. Results are in $LOGFILE" | ||
147 | |||
148 | |||
149 | # do normal cleanup | ||
150 | [ "$KEEPTMPFILES" = "no" ] && rm -f $CONFIG_OUT $GNU_OUT | ||
151 | |||
152 | |||
153 | # do extra cleanup (if any) | ||
154 | if [ ! -z "$CLEANUP" ] | ||
155 | then | ||
156 | [ $DEBUG -ge 2 ] && echo "running cleanup commands in $CLEANUP" | ||
157 | source $CLEANUP | ||
158 | fi | ||
diff --git a/tests/tst-syslogd.c b/tests/tst-syslogd.c deleted file mode 100644 index bae10afdf..000000000 --- a/tests/tst-syslogd.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * tst-syslogd.c - tests concurrent threads calling syslog | ||
3 | * | ||
4 | * build with: gcc -Wall tst-syslogd.c -lpthread | ||
5 | */ | ||
6 | |||
7 | #include <stdio.h> | ||
8 | #include <pthread.h> | ||
9 | #include <syslog.h> | ||
10 | #include <unistd.h> | ||
11 | |||
12 | void *log_func(void *arg) | ||
13 | { | ||
14 | int i; | ||
15 | int thrid = (int)arg; | ||
16 | |||
17 | openlog(NULL, LOG_PERROR | LOG_PID, LOG_USER); | ||
18 | for (i = 0; i < 10; i++) { | ||
19 | syslog(LOG_DEBUG, "thread %i iter %i\n", thrid, i); | ||
20 | sleep(thrid); /* this mixes things up a bit */ | ||
21 | } | ||
22 | closelog(); | ||
23 | |||
24 | return NULL; | ||
25 | } | ||
26 | |||
27 | int main(int argc, char **argv) | ||
28 | { | ||
29 | pthread_t thr1, thr2, thr3; | ||
30 | int id1 = 1; | ||
31 | int id2 = 2; | ||
32 | int id3 = 3; | ||
33 | |||
34 | pthread_create(&thr1, NULL, log_func, (void *)id1); | ||
35 | pthread_create(&thr2, NULL, log_func, (void *)id2); | ||
36 | pthread_create(&thr3, NULL, log_func, (void *)id3); | ||
37 | |||
38 | pthread_join(thr1, NULL); | ||
39 | pthread_join(thr2, NULL); | ||
40 | pthread_join(thr3, NULL); | ||
41 | |||
42 | return 0; | ||
43 | } | ||
44 | |||
diff --git a/testsuite/basename/basename-works b/testsuite/basename/basename-works new file mode 100644 index 000000000..38907d4c1 --- /dev/null +++ b/testsuite/basename/basename-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x$(basename $(pwd)) = x$(busybox basename $(pwd)) | ||
2 | |||
diff --git a/testsuite/cmp/cmp-detects-difference b/testsuite/cmp/cmp-detects-difference index aa0744487..b9bb628f1 100644 --- a/testsuite/cmp/cmp-detects-difference +++ b/testsuite/cmp/cmp-detects-difference | |||
@@ -1,3 +1,9 @@ | |||
1 | echo foo >foo | 1 | echo foo >foo |
2 | echo bar >bar | 2 | echo bar >bar |
3 | ! busybox cmp -s foo bar | 3 | set +e |
4 | busybox cmp -s foo bar | ||
5 | if [ $? != 0 ] ; then | ||
6 | exit 0; | ||
7 | fi | ||
8 | |||
9 | exit 1; | ||
diff --git a/testsuite/cp/cp-a-files-to-dir b/testsuite/cp/cp-a-files-to-dir index 8fb3c201d..39f8f8103 100644 --- a/testsuite/cp/cp-a-files-to-dir +++ b/testsuite/cp/cp-a-files-to-dir | |||
@@ -8,7 +8,7 @@ busybox cp -a file1 file2 link1 dir1 there | |||
8 | test -f there/file1 | 8 | test -f there/file1 |
9 | test -f there/file2 | 9 | test -f there/file2 |
10 | test ! -s there/dir1/file3 | 10 | test ! -s there/dir1/file3 |
11 | test -l there/link1 | 11 | test -L there/link1 |
12 | test `readlink there/link1` = "file2" | 12 | test xfile2 = x`readlink there/link1` |
13 | test ! file3 -ot there/dir1/file3 | 13 | test ! dir1/file3 -ot there/dir1/file3 |
14 | test ! file3 -nt there/dir1/file3 | 14 | test ! dir1/file3 -nt there/dir1/file3 |
diff --git a/testsuite/cp/cp-a-preserves-links b/testsuite/cp/cp-a-preserves-links index aae8313c6..0c0cd9653 100644 --- a/testsuite/cp/cp-a-preserves-links +++ b/testsuite/cp/cp-a-preserves-links | |||
@@ -2,4 +2,4 @@ touch foo | |||
2 | ln -s foo bar | 2 | ln -s foo bar |
3 | busybox cp -a bar baz | 3 | busybox cp -a bar baz |
4 | test -L baz | 4 | test -L baz |
5 | test `readlink baz` = "foo" | 5 | test xfoo = x`readlink baz` |
diff --git a/testsuite/cp/cp-d-files-to-dir b/testsuite/cp/cp-d-files-to-dir index 9407ead00..9571a567e 100644 --- a/testsuite/cp/cp-d-files-to-dir +++ b/testsuite/cp/cp-d-files-to-dir | |||
@@ -7,5 +7,5 @@ busybox cp -d file1 file2 file3 link1 there | |||
7 | test -f there/file1 | 7 | test -f there/file1 |
8 | test -f there/file2 | 8 | test -f there/file2 |
9 | test ! -s there/file3 | 9 | test ! -s there/file3 |
10 | test -l there/link1 | 10 | test -L there/link1 |
11 | test `readlink there/link1` = "file2" | 11 | test xfile2 = x`readlink there/link1` |
diff --git a/testsuite/cp/cp-does-not-copy-unreadable-file b/testsuite/cp/cp-does-not-copy-unreadable-file index 68c576727..ce11bfab0 100644 --- a/testsuite/cp/cp-does-not-copy-unreadable-file +++ b/testsuite/cp/cp-does-not-copy-unreadable-file | |||
@@ -1,4 +1,6 @@ | |||
1 | touch foo | 1 | touch foo |
2 | chmod a-r foo | 2 | chmod a-r foo |
3 | set +e | ||
3 | busybox cp foo bar | 4 | busybox cp foo bar |
5 | set -e | ||
4 | test ! -f bar | 6 | test ! -f bar |
diff --git a/testsuite/cp/cp-preserves-links b/testsuite/cp/cp-preserves-links index d3223b132..301dc5fd8 100644 --- a/testsuite/cp/cp-preserves-links +++ b/testsuite/cp/cp-preserves-links | |||
@@ -2,4 +2,4 @@ touch foo | |||
2 | ln -s foo bar | 2 | ln -s foo bar |
3 | busybox cp -d bar baz | 3 | busybox cp -d bar baz |
4 | test -L baz | 4 | test -L baz |
5 | test `readlink baz` = "foo" | 5 | test xfoo = x`readlink baz` |
diff --git a/testsuite/date/date-R-works b/testsuite/date/date-R-works new file mode 100644 index 000000000..ec3a06751 --- /dev/null +++ b/testsuite/date/date-R-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x"`date -R`" = x"`busybox date -R`" | ||
2 | |||
diff --git a/testsuite/date/date-format-works b/testsuite/date/date-format-works new file mode 100644 index 000000000..f28d06cfc --- /dev/null +++ b/testsuite/date/date-format-works | |||
@@ -0,0 +1 @@ | |||
test x"`date +%d/%m/%y`" = x"`busybox date +%d/%m/%y`" | |||
diff --git a/testsuite/date/date-u-works b/testsuite/date/date-u-works new file mode 100644 index 000000000..7d9902a3f --- /dev/null +++ b/testsuite/date/date-u-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x"`date -u`" = x"`busybox date -u`" | ||
2 | |||
diff --git a/testsuite/date/date-works b/testsuite/date/date-works new file mode 100644 index 000000000..2f6dd1eca --- /dev/null +++ b/testsuite/date/date-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x"`date`" = x"`busybox date`" | ||
2 | |||
diff --git a/testsuite/dirname/dirname-works b/testsuite/dirname/dirname-works new file mode 100644 index 000000000..f339c8f73 --- /dev/null +++ b/testsuite/dirname/dirname-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x$(dirname $(pwd)) = x$(busybox dirname $(pwd)) | ||
2 | |||
diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works new file mode 100644 index 000000000..8ec5d4c24 --- /dev/null +++ b/testsuite/du/du-h-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du -h .. > logfile.gnu | ||
2 | busybox du -h .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-k-works b/testsuite/du/du-k-works new file mode 100644 index 000000000..43b119c7c --- /dev/null +++ b/testsuite/du/du-k-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du -k .. > logfile.gnu | ||
2 | busybox du -k .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works new file mode 100644 index 000000000..c5d439853 --- /dev/null +++ b/testsuite/du/du-l-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du -l .. > logfile.gnu | ||
2 | busybox du -l .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-m-works b/testsuite/du/du-m-works new file mode 100644 index 000000000..e3e2d3a56 --- /dev/null +++ b/testsuite/du/du-m-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du -m .. > logfile.gnu | ||
2 | busybox du -m .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-s-works b/testsuite/du/du-s-works new file mode 100644 index 000000000..16b0a3e5a --- /dev/null +++ b/testsuite/du/du-s-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du -s .. > logfile.gnu | ||
2 | busybox du -s .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-works b/testsuite/du/du-works new file mode 100644 index 000000000..87ba63032 --- /dev/null +++ b/testsuite/du/du-works | |||
@@ -0,0 +1,3 @@ | |||
1 | du .. > logfile.gnu | ||
2 | busybox du .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/echo/echo-prints-argument b/testsuite/echo/echo-prints-argument index 98779dbbb..479dac89c 100644 --- a/testsuite/echo/echo-prints-argument +++ b/testsuite/echo/echo-prints-argument | |||
@@ -1 +1 @@ | |||
test `busybox echo fubar` = fubar | test xfubar = x`busybox echo fubar` | ||
diff --git a/testsuite/expr/expr-works b/testsuite/expr/expr-works new file mode 100644 index 000000000..af49ac4d5 --- /dev/null +++ b/testsuite/expr/expr-works | |||
@@ -0,0 +1,59 @@ | |||
1 | # busybox expr | ||
2 | busybox expr 1 \| 1 | ||
3 | busybox expr 1 \| 0 | ||
4 | busybox expr 0 \| 1 | ||
5 | busybox expr 1 \& 1 | ||
6 | busybox expr 0 \< 1 | ||
7 | busybox expr 1 \> 0 | ||
8 | busybox expr 0 \<= 1 | ||
9 | busybox expr 1 \<= 1 | ||
10 | busybox expr 1 \>= 0 | ||
11 | busybox expr 1 \>= 1 | ||
12 | busybox expr 1 + 2 | ||
13 | busybox expr 2 - 1 | ||
14 | busybox expr 2 \* 3 | ||
15 | busybox expr 12 / 2 | ||
16 | busybox expr 12 % 5 | ||
17 | |||
18 | |||
19 | set +e | ||
20 | busybox expr 0 \| 0 | ||
21 | if [ $? != 1 ] ; then | ||
22 | exit 1; | ||
23 | fi; | ||
24 | |||
25 | busybox expr 1 \& 0 | ||
26 | if [ $? != 1 ] ; then | ||
27 | exit 1; | ||
28 | fi; | ||
29 | |||
30 | busybox expr 0 \& 1 | ||
31 | if [ $? != 1 ] ; then | ||
32 | exit 1; | ||
33 | fi; | ||
34 | |||
35 | busybox expr 0 \& 0 | ||
36 | if [ $? != 1 ] ; then | ||
37 | exit 1; | ||
38 | fi; | ||
39 | |||
40 | busybox expr 1 \< 0 | ||
41 | if [ $? != 1 ] ; then | ||
42 | exit 1; | ||
43 | fi; | ||
44 | |||
45 | busybox expr 0 \> 1 | ||
46 | if [ $? != 1 ] ; then | ||
47 | exit 1; | ||
48 | fi; | ||
49 | |||
50 | busybox expr 1 \<= 0 | ||
51 | if [ $? != 1 ] ; then | ||
52 | exit 1; | ||
53 | fi; | ||
54 | |||
55 | busybox expr 0 \>= 1 | ||
56 | if [ $? != 1 ] ; then | ||
57 | exit 1; | ||
58 | fi; | ||
59 | |||
diff --git a/testsuite/grep/grep-matches-NUL b/testsuite/grep/grep-matches-NUL index 597d22cb4..082bd8700 100644 --- a/testsuite/grep/grep-matches-NUL +++ b/testsuite/grep/grep-matches-NUL | |||
@@ -1,2 +1,8 @@ | |||
1 | # XFAIL | 1 | set +e |
2 | echo -e '\0' | busybox grep . | 2 | echo -e '\0' | busybox grep . |
3 | if [ $? != 0 ] ; then | ||
4 | exit 0; | ||
5 | fi | ||
6 | |||
7 | exit 1; | ||
8 | |||
diff --git a/testsuite/head/head-n-works b/testsuite/head/head-n-works new file mode 100644 index 000000000..121a1fa1d --- /dev/null +++ b/testsuite/head/head-n-works | |||
@@ -0,0 +1,3 @@ | |||
1 | head -n 2 ../README > logfile.gnu | ||
2 | busybox head -n 2 ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/head/head-works b/testsuite/head/head-works new file mode 100644 index 000000000..ea10adeb4 --- /dev/null +++ b/testsuite/head/head-works | |||
@@ -0,0 +1,3 @@ | |||
1 | head ../README > logfile.gnu | ||
2 | busybox head ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/hostid/hostid-works b/testsuite/hostid/hostid-works new file mode 100644 index 000000000..e85698e66 --- /dev/null +++ b/testsuite/hostid/hostid-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x$(hostid) = x$(busybox hostid) | ||
2 | |||
diff --git a/testsuite/hostname/hostname-d-works b/testsuite/hostname/hostname-d-works new file mode 100644 index 000000000..a9aeb92cb --- /dev/null +++ b/testsuite/hostname/hostname-d-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x$(hostname -d) = x$(busybox hostname -d) | ||
2 | |||
diff --git a/testsuite/hostname/hostname-i-works b/testsuite/hostname/hostname-i-works new file mode 100644 index 000000000..68a3e6789 --- /dev/null +++ b/testsuite/hostname/hostname-i-works | |||
@@ -0,0 +1,2 @@ | |||
1 | test x$(hostname -i) = x$(busybox hostname -i) | ||
2 | |||
diff --git a/testsuite/hostname/hostname-s-works b/testsuite/hostname/hostname-s-works new file mode 100644 index 000000000..172b94409 --- /dev/null +++ b/testsuite/hostname/hostname-s-works | |||
@@ -0,0 +1 @@ | |||
test x$(hostname -s) = x$(busybox hostname -s) | |||
diff --git a/testsuite/hostname/hostname-works b/testsuite/hostname/hostname-works new file mode 100644 index 000000000..f51a406ea --- /dev/null +++ b/testsuite/hostname/hostname-works | |||
@@ -0,0 +1 @@ | |||
test x$(hostname) = x$(busybox hostname) | |||
diff --git a/testsuite/id/id-g-works b/testsuite/id/id-g-works new file mode 100644 index 000000000..671fc5361 --- /dev/null +++ b/testsuite/id/id-g-works | |||
@@ -0,0 +1 @@ | |||
test x$(id -g) = x$(busybox id -g) | |||
diff --git a/testsuite/id/id-u-works b/testsuite/id/id-u-works new file mode 100644 index 000000000..2358cb0d7 --- /dev/null +++ b/testsuite/id/id-u-works | |||
@@ -0,0 +1 @@ | |||
test x$(id -u) = x$(busybox id -u) | |||
diff --git a/testsuite/id/id-un-works b/testsuite/id/id-un-works new file mode 100644 index 000000000..db390e733 --- /dev/null +++ b/testsuite/id/id-un-works | |||
@@ -0,0 +1 @@ | |||
test x$(id -un) = x$(busybox id -un) | |||
diff --git a/testsuite/id/id-ur-works b/testsuite/id/id-ur-works new file mode 100644 index 000000000..6b0fcb038 --- /dev/null +++ b/testsuite/id/id-ur-works | |||
@@ -0,0 +1 @@ | |||
test x$(id -ur) = x$(busybox id -ur) | |||
diff --git a/testsuite/ln/ln-creates-hard-links b/testsuite/ln/ln-creates-hard-links new file mode 100644 index 000000000..2f6e23f9a --- /dev/null +++ b/testsuite/ln/ln-creates-hard-links | |||
@@ -0,0 +1,4 @@ | |||
1 | echo file number one > file1 | ||
2 | busybox ln file1 link1 | ||
3 | test -f file1 | ||
4 | test -f link1 | ||
diff --git a/testsuite/ln/ln-creates-soft-links b/testsuite/ln/ln-creates-soft-links new file mode 100644 index 000000000..e875e4c8a --- /dev/null +++ b/testsuite/ln/ln-creates-soft-links | |||
@@ -0,0 +1,4 @@ | |||
1 | echo file number one > file1 | ||
2 | busybox ln -s file1 link1 | ||
3 | test -L link1 | ||
4 | test xfile1 = x`readlink link1` | ||
diff --git a/testsuite/ln/ln-force-creates-hard-links b/testsuite/ln/ln-force-creates-hard-links new file mode 100644 index 000000000..c96b7d6cf --- /dev/null +++ b/testsuite/ln/ln-force-creates-hard-links | |||
@@ -0,0 +1,5 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > link1 | ||
3 | busybox ln -f file1 link1 | ||
4 | test -f file1 | ||
5 | test -f link1 | ||
diff --git a/testsuite/ln/ln-force-creates-soft-links b/testsuite/ln/ln-force-creates-soft-links new file mode 100644 index 000000000..cab8d1db7 --- /dev/null +++ b/testsuite/ln/ln-force-creates-soft-links | |||
@@ -0,0 +1,5 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > link1 | ||
3 | busybox ln -f -s file1 link1 | ||
4 | test -L link1 | ||
5 | test xfile1 = x`readlink link1` | ||
diff --git a/testsuite/ln/ln-preserves-hard-links b/testsuite/ln/ln-preserves-hard-links new file mode 100644 index 000000000..47fb98961 --- /dev/null +++ b/testsuite/ln/ln-preserves-hard-links | |||
@@ -0,0 +1,8 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > link1 | ||
3 | set +e | ||
4 | busybox ln file1 link1 | ||
5 | if [ $? != 0 ] ; then | ||
6 | exit 0; | ||
7 | fi | ||
8 | exit 1; | ||
diff --git a/testsuite/ln/ln-preserves-soft-links b/testsuite/ln/ln-preserves-soft-links new file mode 100644 index 000000000..a8123ece3 --- /dev/null +++ b/testsuite/ln/ln-preserves-soft-links | |||
@@ -0,0 +1,9 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > link1 | ||
3 | set +e | ||
4 | busybox ln -s file1 link1 | ||
5 | if [ $? != 0 ] ; then | ||
6 | exit 0; | ||
7 | fi | ||
8 | exit 1; | ||
9 | |||
diff --git a/testsuite/ls/ls-1-works b/testsuite/ls/ls-1-works new file mode 100644 index 000000000..8651ecd72 --- /dev/null +++ b/testsuite/ls/ls-1-works | |||
@@ -0,0 +1,3 @@ | |||
1 | ls -1 .. > logfile.gnu | ||
2 | busybox ls -1 .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/ls/ls-h-works b/testsuite/ls/ls-h-works new file mode 100644 index 000000000..f54a7be0b --- /dev/null +++ b/testsuite/ls/ls-h-works | |||
@@ -0,0 +1,3 @@ | |||
1 | ls -h .. > logfile.gnu | ||
2 | busybox ls -h .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/ls/ls-l-works b/testsuite/ls/ls-l-works new file mode 100644 index 000000000..50e44597e --- /dev/null +++ b/testsuite/ls/ls-l-works | |||
@@ -0,0 +1,3 @@ | |||
1 | ls -l .. > logfile.gnu | ||
2 | busybox ls -l .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/ls/ls-s-works b/testsuite/ls/ls-s-works new file mode 100644 index 000000000..98a612d06 --- /dev/null +++ b/testsuite/ls/ls-s-works | |||
@@ -0,0 +1,3 @@ | |||
1 | ls -1s .. > logfile.gnu | ||
2 | busybox ls -1s .. > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/mv/mv-files-to-dir b/testsuite/mv/mv-files-to-dir new file mode 100644 index 000000000..c8eaba88e --- /dev/null +++ b/testsuite/mv/mv-files-to-dir | |||
@@ -0,0 +1,16 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > file2 | ||
3 | ln -s file2 link1 | ||
4 | mkdir dir1 | ||
5 | touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3 | ||
6 | mkdir there | ||
7 | busybox mv file1 file2 link1 dir1 there | ||
8 | test -f there/file1 | ||
9 | test -f there/file2 | ||
10 | test -f there/dir1/file3 | ||
11 | test -L there/link1 | ||
12 | test xfile2 = x`readlink there/link1` | ||
13 | test ! -e file1 | ||
14 | test ! -e file2 | ||
15 | test ! -e link1 | ||
16 | test ! -e dir1/file3 | ||
diff --git a/testsuite/mv/mv-follows-links b/testsuite/mv/mv-follows-links new file mode 100644 index 000000000..1fb355b81 --- /dev/null +++ b/testsuite/mv/mv-follows-links | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -f baz | ||
diff --git a/testsuite/mv/mv-moves-empty-file b/testsuite/mv/mv-moves-empty-file new file mode 100644 index 000000000..48afca4d5 --- /dev/null +++ b/testsuite/mv/mv-moves-empty-file | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-hardlinks b/testsuite/mv/mv-moves-hardlinks new file mode 100644 index 000000000..eaa8215a4 --- /dev/null +++ b/testsuite/mv/mv-moves-hardlinks | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | ln foo bar | ||
3 | busybox mv bar baz | ||
4 | test ! -f bar -a -f baz | ||
diff --git a/testsuite/mv/mv-moves-large-file b/testsuite/mv/mv-moves-large-file new file mode 100644 index 000000000..77d088ff1 --- /dev/null +++ b/testsuite/mv/mv-moves-large-file | |||
@@ -0,0 +1,4 @@ | |||
1 | dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-small-file b/testsuite/mv/mv-moves-small-file new file mode 100644 index 000000000..065c7f1e9 --- /dev/null +++ b/testsuite/mv/mv-moves-small-file | |||
@@ -0,0 +1,4 @@ | |||
1 | echo I WANT > foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-symlinks b/testsuite/mv/mv-moves-symlinks new file mode 100644 index 000000000..c413af07c --- /dev/null +++ b/testsuite/mv/mv-moves-symlinks | |||
@@ -0,0 +1,6 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -f foo | ||
5 | test ! -e bar | ||
6 | test -L baz | ||
diff --git a/testsuite/mv/mv-moves-unreadable-files b/testsuite/mv/mv-moves-unreadable-files new file mode 100644 index 000000000..bc9c3133c --- /dev/null +++ b/testsuite/mv/mv-moves-unreadable-files | |||
@@ -0,0 +1,5 @@ | |||
1 | touch foo | ||
2 | chmod a-r foo | ||
3 | busybox mv foo bar | ||
4 | test ! -e foo | ||
5 | test -f bar | ||
diff --git a/testsuite/mv/mv-preserves-hard-links b/testsuite/mv/mv-preserves-hard-links new file mode 100644 index 000000000..b3ba3aa29 --- /dev/null +++ b/testsuite/mv/mv-preserves-hard-links | |||
@@ -0,0 +1,6 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS | ||
2 | touch foo | ||
3 | ln foo bar | ||
4 | mkdir baz | ||
5 | busybox mv foo bar baz | ||
6 | test baz/foo -ef baz/bar | ||
diff --git a/testsuite/mv/mv-preserves-links b/testsuite/mv/mv-preserves-links new file mode 100644 index 000000000..ea565d2f1 --- /dev/null +++ b/testsuite/mv/mv-preserves-links | |||
@@ -0,0 +1,5 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -L baz | ||
5 | test xfoo = x`readlink baz` | ||
diff --git a/testsuite/mv/mv-refuses-mv-dir-to-subdir b/testsuite/mv/mv-refuses-mv-dir-to-subdir new file mode 100644 index 000000000..7c572c4f8 --- /dev/null +++ b/testsuite/mv/mv-refuses-mv-dir-to-subdir | |||
@@ -0,0 +1,23 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > file2 | ||
3 | ln -s file2 link1 | ||
4 | mkdir dir1 | ||
5 | touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3 | ||
6 | mkdir there | ||
7 | busybox mv file1 file2 link1 dir1 there | ||
8 | test -f there/file1 | ||
9 | test -f there/file2 | ||
10 | test -f there/dir1/file3 | ||
11 | test -L there/link1 | ||
12 | test xfile2 = x`readlink there/link1` | ||
13 | test ! -e file1 | ||
14 | test ! -e file2 | ||
15 | test ! -e link1 | ||
16 | test ! -e dir1/file3 | ||
17 | set +e | ||
18 | busybox mv there there/dir1 | ||
19 | if [ $? != 0 ] ; then | ||
20 | exit 0; | ||
21 | fi | ||
22 | |||
23 | exit 1; | ||
diff --git a/testsuite/mv/mv-removes-source-file b/testsuite/mv/mv-removes-source-file new file mode 100644 index 000000000..48afca4d5 --- /dev/null +++ b/testsuite/mv/mv-removes-source-file | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/pwd/pwd-prints-working-directory b/testsuite/pwd/pwd-prints-working-directory index 7bea10741..8575347d6 100644 --- a/testsuite/pwd/pwd-prints-working-directory +++ b/testsuite/pwd/pwd-prints-working-directory | |||
@@ -1 +1 @@ | |||
test `pwd` = `busybox pwd` | test $(pwd) = $(busybox pwd) | ||
diff --git a/testsuite/runtest b/testsuite/runtest index f57f464ee..89aba3985 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
@@ -2,37 +2,19 @@ | |||
2 | 2 | ||
3 | PATH=$(dirname $(pwd)):$PATH | 3 | PATH=$(dirname $(pwd)):$PATH |
4 | 4 | ||
5 | show_result () | ||
6 | { | ||
7 | local resolution=$1 | ||
8 | local testcase=$2 | ||
9 | local status=0 | ||
10 | |||
11 | if [ $resolution = XPASS -o $resolution = FAIL ]; then | ||
12 | status=1 | ||
13 | fi | ||
14 | |||
15 | if [ "$verbose" -o $status -eq 1 ]; then | ||
16 | echo "$resolution: $testcase" | ||
17 | fi | ||
18 | |||
19 | return $status | ||
20 | } | ||
21 | |||
22 | run_applet_testcase () | 5 | run_applet_testcase () |
23 | { | 6 | { |
24 | local applet=$1 | 7 | local applet=$1 |
25 | local testcase=$2 | 8 | local testcase=$2 |
26 | 9 | ||
27 | local status=0 | 10 | local status=0 |
28 | local X= | ||
29 | local RES= | 11 | local RES= |
30 | 12 | ||
31 | local uc_applet=$(echo $applet | tr a-z A-Z) | 13 | local uc_applet=$(echo $applet | tr a-z A-Z) |
32 | local testname=$(basename $testcase) | 14 | local testname=$(basename $testcase) |
33 | 15 | ||
34 | if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then | 16 | if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then |
35 | show_result UNTESTED $testname | 17 | echo UNTESTED: $testname |
36 | return 0 | 18 | return 0 |
37 | fi | 19 | fi |
38 | 20 | ||
@@ -40,15 +22,11 @@ run_applet_testcase () | |||
40 | local feature=`sed -ne 's/^# FEATURE: //p' $testcase` | 22 | local feature=`sed -ne 's/^# FEATURE: //p' $testcase` |
41 | 23 | ||
42 | if grep -q "^# ${feature} is not set$" ../.config; then | 24 | if grep -q "^# ${feature} is not set$" ../.config; then |
43 | show_result UNTESTED $testname | 25 | echo UNTESTED: $testname |
44 | return 0 | 26 | return 0 |
45 | fi | 27 | fi |
46 | fi | 28 | fi |
47 | 29 | ||
48 | if grep -q "^# XFAIL$" $testcase; then | ||
49 | X=X | ||
50 | fi | ||
51 | |||
52 | rm -rf tmp | 30 | rm -rf tmp |
53 | mkdir -p tmp | 31 | mkdir -p tmp |
54 | pushd tmp >/dev/null | 32 | pushd tmp >/dev/null |
@@ -56,14 +34,14 @@ run_applet_testcase () | |||
56 | sh -x -e ../$testcase >.logfile.txt 2>&1 | 34 | sh -x -e ../$testcase >.logfile.txt 2>&1 |
57 | 35 | ||
58 | if [ $? != 0 ] ; then | 36 | if [ $? != 0 ] ; then |
59 | show_result ${X}FAIL $testname | 37 | echo FAIL: $testname |
60 | if [ "$verbose" == 1 ]; then | 38 | if [ "$verbose" = 1 ]; then |
61 | cat .logfile.txt | 39 | cat .logfile.txt |
62 | exit 1; | 40 | #exit 1; |
63 | fi; | 41 | fi; |
64 | status=$? | 42 | status=$? |
65 | else | 43 | else |
66 | show_result ${X}PASS $testname | 44 | echo PASS: $testname |
67 | rm -f .logfile.txt | 45 | rm -f .logfile.txt |
68 | status=$? | 46 | status=$? |
69 | fi | 47 | fi |
diff --git a/testsuite/sed/sed-append-next-line b/testsuite/sed/sed-append-next-line index e7f72f476..0621a319f 100644 --- a/testsuite/sed/sed-append-next-line +++ b/testsuite/sed/sed-append-next-line | |||
@@ -1,10 +1,11 @@ | |||
1 | # XFAIL | ||
2 | # This will fail if CONFIG_FEATURE_SED_GNU_COMPATABILITY is defined | 1 | # This will fail if CONFIG_FEATURE_SED_GNU_COMPATABILITY is defined |
3 | busybox sed 'N;p'>output <<EOF | 2 | busybox sed 'N;p'>output <<EOF |
4 | a | 3 | a |
5 | b | 4 | b |
6 | c | 5 | c |
7 | EOF | 6 | EOF |
7 | |||
8 | set +e | ||
8 | cmp -s output - <<EOF | 9 | cmp -s output - <<EOF |
9 | a | 10 | a |
10 | b | 11 | b |
@@ -12,3 +13,7 @@ a | |||
12 | b | 13 | b |
13 | c | 14 | c |
14 | EOF | 15 | EOF |
16 | if [ $? != 0 ] ; then | ||
17 | exit 0; | ||
18 | fi | ||
19 | exit 1; | ||
diff --git a/testsuite/sort/sort-n-works b/testsuite/sort/sort-n-works new file mode 100644 index 000000000..c9b63a36a --- /dev/null +++ b/testsuite/sort/sort-n-works | |||
@@ -0,0 +1,3 @@ | |||
1 | sort -n ../README > logfile.gnu | ||
2 | busybox sort -n ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/sort/sort-r-works b/testsuite/sort/sort-r-works new file mode 100644 index 000000000..6422ba940 --- /dev/null +++ b/testsuite/sort/sort-r-works | |||
@@ -0,0 +1,3 @@ | |||
1 | sort -r ../README > logfile.gnu | ||
2 | busybox sort -r ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/sort/sort-works b/testsuite/sort/sort-works new file mode 100644 index 000000000..0110aa010 --- /dev/null +++ b/testsuite/sort/sort-works | |||
@@ -0,0 +1,3 @@ | |||
1 | sort ../README > logfile.gnu | ||
2 | busybox sort ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/strings/strings-works-like-GNU b/testsuite/strings/strings-works-like-GNU index 02e423134..2d6471033 100644 --- a/testsuite/strings/strings-works-like-GNU +++ b/testsuite/strings/strings-works-like-GNU | |||
@@ -1,8 +1,9 @@ | |||
1 | rm -f foo bar | 1 | rm -f foo bar |
2 | strings -af ../../busybox > foo | 2 | strings -af ../../busybox > foo |
3 | busybox strings -af ../../busybox > bar | 3 | busybox strings -af ../../busybox > bar |
4 | set +e | ||
4 | test ! -f foo -a -f bar | 5 | test ! -f foo -a -f bar |
5 | if [ $? = 0 ] ; then | 6 | if [ $? = 0 ] ; then |
6 | diff -q foo bar | 7 | set -e |
7 | fi; | 8 | diff -q foo bar |
8 | 9 | fi | |
diff --git a/testsuite/tail/tail-n-works b/testsuite/tail/tail-n-works new file mode 100644 index 000000000..321db7f8a --- /dev/null +++ b/testsuite/tail/tail-n-works | |||
@@ -0,0 +1,3 @@ | |||
1 | tail -n 2 ../README > logfile.gnu | ||
2 | busybox tail -n 2 ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/tail/tail-works b/testsuite/tail/tail-works new file mode 100644 index 000000000..321db7f8a --- /dev/null +++ b/testsuite/tail/tail-works | |||
@@ -0,0 +1,3 @@ | |||
1 | tail -n 2 ../README > logfile.gnu | ||
2 | busybox tail -n 2 ../README > logfile.bb | ||
3 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/tar/tar-extracts-multiple-files b/testsuite/tar/tar-extracts-multiple-files index e26901e8c..46701dc3f 100644 --- a/testsuite/tar/tar-extracts-multiple-files +++ b/testsuite/tar/tar-extracts-multiple-files | |||
@@ -1,5 +1,6 @@ | |||
1 | touch foo bar | 1 | touch foo bar |
2 | tar cf foo.tar foo bar | 2 | tar cf foo.tar foo bar |
3 | rm foo bar | 3 | rm foo bar |
4 | busybox tar xf foo.tar | 4 | busybox tar -xf foo.tar |
5 | test -f foo -a -f bar | 5 | test -f foo -a -f bar |
6 | exit 99; | ||
diff --git a/testsuite/tr/tr-d-works b/testsuite/tr/tr-d-works new file mode 100644 index 000000000..d939e8b0f --- /dev/null +++ b/testsuite/tr/tr-d-works | |||
@@ -0,0 +1,4 @@ | |||
1 | echo testing | tr -d aeiou > logfile.gnu | ||
2 | echo testing | busybox tr -d aeiou > logfile.bb | ||
3 | |||
4 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/tr/tr-non-gnu b/testsuite/tr/tr-non-gnu new file mode 100644 index 000000000..ffa6951ae --- /dev/null +++ b/testsuite/tr/tr-non-gnu | |||
@@ -0,0 +1 @@ | |||
echo fdhrnzvfu bffvsentr | busybox tr '[a-z]' '[n-z][a-m]' | |||
diff --git a/testsuite/tr/tr-works b/testsuite/tr/tr-works new file mode 100644 index 000000000..8753a3f28 --- /dev/null +++ b/testsuite/tr/tr-works | |||
@@ -0,0 +1,9 @@ | |||
1 | echo "cbaab" | tr abc zyx > logfile.gnu | ||
2 | echo "TESTING A B C" | tr [A-Z] [a-z] >> logfile.gnu | ||
3 | echo abc[] | tr a[b AXB >> logfile.gnu | ||
4 | |||
5 | echo "cbaab" | busybox tr abc zyx > logfile.bb | ||
6 | echo "TESTING A B C" | busybox tr [A-Z] [a-z] >> logfile.bb | ||
7 | echo abc[] | busybox tr a[b AXB >> logfile.bb | ||
8 | |||
9 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/uptime/uptime-works b/testsuite/uptime/uptime-works new file mode 100644 index 000000000..80e578778 --- /dev/null +++ b/testsuite/uptime/uptime-works | |||
@@ -0,0 +1,2 @@ | |||
1 | busybox uptime | ||
2 | |||
diff --git a/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly b/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly index 0ccf23b59..1a48a6656 100644 --- a/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly +++ b/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly | |||
@@ -1,6 +1,4 @@ | |||
1 | saved_umask=$(umask) | 1 | saved_umask=$(umask) |
2 | umask 0 | 2 | umask 0 |
3 | busybox uuencode foo </dev/null | head -n 1 | grep -q 666 | 3 | busybox uuencode foo </dev/null | head -n 1 | grep -q 666 |
4 | status=$? | ||
5 | umask $saved_umask | 4 | umask $saved_umask |
6 | return $status | ||
diff --git a/testsuite/which/which-uses-default-path b/testsuite/which/which-uses-default-path index f612aeb54..63ceb9f8f 100644 --- a/testsuite/which/which-uses-default-path +++ b/testsuite/which/which-uses-default-path | |||
@@ -2,6 +2,3 @@ BUSYBOX=$(type -p busybox) | |||
2 | SAVED_PATH=$PATH | 2 | SAVED_PATH=$PATH |
3 | unset PATH | 3 | unset PATH |
4 | $BUSYBOX which ls | 4 | $BUSYBOX which ls |
5 | STATUS=$? | ||
6 | export PATH=$SAVED_PATH | ||
7 | return $STATUS | ||
diff --git a/testsuite/xargs/xargs-works b/testsuite/xargs/xargs-works new file mode 100644 index 000000000..4ad581804 --- /dev/null +++ b/testsuite/xargs/xargs-works | |||
@@ -0,0 +1,3 @@ | |||
1 | find -name \*works -type f | xargs md5sum > logfile.gnu | ||
2 | find -name \*works -type f | busybox xargs md5sum > logfile.bb | ||
3 | diff -u logfile.gnu logfile.bb | ||