aboutsummaryrefslogtreecommitdiff
path: root/tests/testcases
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-04-06 11:10:30 +0000
committerEric Andersen <andersen@codepoet.org>2004-04-06 11:10:30 +0000
commit650fe63467e693990cf357c51b74db3278088a56 (patch)
tree660b1fb0e4d7f99802a85cdd00166fafbf3132dc /tests/testcases
parent39396b95fc7c46bfa29ec576357fb7f8e755762c (diff)
downloadbusybox-w32-650fe63467e693990cf357c51b74db3278088a56.tar.gz
busybox-w32-650fe63467e693990cf357c51b74db3278088a56.tar.bz2
busybox-w32-650fe63467e693990cf357c51b74db3278088a56.zip
Kill off the old 'tests' stuff. Write a ton of new tests for the
'testsuite' dir. Fix a bunch of broken tests. Fix the testsuite 'runtest' script so it actually reports all failures and provides meaningful feedback. -Erik
Diffstat (limited to 'tests/testcases')
-rw-r--r--tests/testcases404
1 files changed, 0 insertions, 404 deletions
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
33basename `pwd`
34
35# cat
36cat tester.sh
37echo 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
49echo "1234" | cut -c1
50echo "1234" | cut -c 1
51echo "1234567890" | cut -c2-7
52echo "1234567890" | cut -c 2-7
53echo "f1 f2" | cut -f2
54echo "f1 f2" | cut -f 2
55echo "f1 f2 f3 f4 f5" | cut -f2-4
56echo "f1 f2 f3 f4 f5" | cut -f 2-4
57
58# date
59date
60date -R
61date -u
62date +%d/%m/%y
63
64# dc - needs an input file
65
66# dd
67# BUG: record count line goes to stdout instead of stderr
68dd 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
74df
75df .
76df -k
77df -h
78df -m
79
80# dirname
81dirname `pwd`
82
83# dmesg (XXX: change the silly cmd business in the source)
84dmesg
85dmesg -n 8
86dmesg -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
96du
97du -s
98du -l
99du -k
100du -h
101du -m
102
103# dumpkmap - no counterprt?
104# dutmp - no counterprt?
105
106# echo
107echo "foo bar baz"
108echo -n "no newline"
109
110
111# expr
112expr 1 \\| 1
113expr 1 \\| 0
114expr 0 \\| 1
115expr 0 \\| 0
116
117expr 1 \\& 1
118expr 1 \\& 0
119expr 0 \\& 1
120expr 0 \\& 0
121
122expr 0 \\< 1
123expr 1 \\< 0
124
125expr 1 \\> 0
126expr 0 \\> 1
127
128expr 0 \\<= 1
129expr 1 \\<= 0
130expr 1 \\<= 1
131
132expr 1 \\>= 0
133expr 0 \\>= 1
134expr 1 \\>= 1
135
136expr 1 + 2
137expr 2 - 1
138expr 2 \\* 3
139expr 12 / 2
140expr 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
148find .
149
150# free
151# XXX: minor formatting differences
152free
153
154# freeramdisk
155# fsck.minix - won't test
156# getopt
157
158# grep
159grep -l strdup ../*utils/*.c
160grep -c strdup ../*utils/*.c
161grep -lc strdup ../*utils/*.c
162grep -cv strdup ../*utils/*.c
163grep -i null ../findutils/grep.c
164grep -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
170echo testing 1 2 3 >tmpfile1; gzip tmpfile1; echo tmpfile*; md5sum tmpfile1.gz; rm tmpfile1.gz
171echo testing 1 2 3 | gzip >tmpfile1.gz; md5sum tmpfile1.gz; rm tmpfile1.gz
172
173
174# halt - won't test, dangerous
175
176# head
177head tester.sh
178head -n 2 tester.sh
179
180# hostid
181hostid
182
183# hostname
184# XXX: minor formatting differences
185hostname
186hostname -s
187hostname -i
188hostname -d
189# not going to do this next one
190#hostname -F
191
192# id
193# BUG: Busybox id doesn't print supplemental groups
194id
195id -u
196id -g
197id -ur
198id -un
199
200
201# ifconfig
202# requires CONFIG_FEATURE_IFCONFIG_STATUS
203ifconfig
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
225ls ../e*
226ls -l ../e*
227ls -s ../e*
228ls -h ../e*
229ls -1 ../e*
230
231# lsmod
232lsmod
233
234# makedevs
235
236# md5sum
237md5sum tester.sh
238
239# mkdir
240mkdir 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)
247mkfifo F ; ls -l F ; rm F
248mkfifo -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
258mount
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
267ping -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
274pwd
275
276# rdate - won't test
277
278# readlink
279ln -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
286touch F ; rm F
287
288# rmdir
289# rmmod - won't test: dangerous
290
291# route
292# XXX: doesn't DNS resolve
293route
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
301echo foo | sed -ne '/^$/p'
302echo -e "foo\\n\\nbar" | sed -ne '/^$/p'
303
304sed -e '/test$/d' testcases
305sed -e '/^echo/d' testcases
306sed -e '/test/s/dangerous/PELIGROSO/' testcases
307sed -ne '1,/getopt/p' ../shellutils/pwd.c
308sed -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
314sh -c "echo a b c"
315sh -c ">"
316sh -c "a"
317sh sh.testcases
318
319
320# sleep - can't test: produces no output
321
322# sort
323sort tester.sh
324sort -n tester.sh
325sort -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
334tail tester.sh
335tail -n 2 tester.sh
336
337# tar
338
339# tee
340echo "please tee me!" | tee A B C ; cat A B C
341echo "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
349touch tmpfile1; ls tmpfile1; rm -f tmpfile1
350touch -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
354echo "cbaab" | tr abc zyx
355echo "TESTING A B C" | tr [A-Z] [a-z]
356# not GNU compatible
357echo fdhrnzvfu bffvsentr | tr [a-z] [n-z][a-m]
358echo abc[] | tr a[b AXB
359echo testing | tr -d aeiou
360
361# true
362true ; echo $?
363
364# false
365false ; 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
376uptime
377
378# usleep
379# uudecode
380# uuencode
381# watchdog
382
383# wc
384wc tester.sh
385wc -c tester.sh
386wc -w tester.sh
387wc -l tester.sh
388wc -L tester.sh
389
390# wget
391
392# which
393which ls
394
395# whoami
396whoami
397
398# xargs
399# XXX: Busygox xargs divides filenames with '\n' instead of ' '
400ls -1 ../e* | xargs
401ls -1 ../e* | xargs md5sum
402
403# yes - can't test: interactive (needs ^C)
404