blob: 92f4ed3ec12976abb6a29d808c002e1d18c20000 [file] [log] [blame]
Mark Whitleyd2117e92001-03-10 00:51:29 +00001# 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
25
26# ar
27
28# basename
29basename `pwd`
30
31# cat
32cat tester.sh
33
34# chmod
35# chown
36# chgrp
37# chroot
38# chvt - can't be tested here
39# clear - can't be tested here
40# cmp
41# cp
42# mv
43
44# cut
45echo "1234" | cut -c1
46echo "f1 f2" | cut -f2
47
48# date
49date
50date -R
51date -u
52date +%d/%m/%y
53
54# dc - needs an input file
Mark Whitleyc75f83d2001-03-13 23:30:18 +000055
Mark Whitleyd2117e92001-03-10 00:51:29 +000056# dd
Mark Whitleyc75f83d2001-03-13 23:30:18 +000057dd if=/dev/urandom of=O bs=1k count=1 ; ls -l O ; rm O
58
Mark Whitleyd2117e92001-03-10 00:51:29 +000059# deallocvt
60
61# df
62df
63df .
64df -k
65df -h
66df -m
67
68# dirname
69dirname `pwd`
70
71# dmesg (XXX: change the silly cmd business in the source)
72dmesg
73dmesg -n 8
74dmesg -s 512
75# I really don't want to do this next one
76#dmesg -c
77
78# dos2unix - needs an input file
79# dpkg
80# dpkg_deb
81
82# du
83du
84du -s
85du -l
86du -k
87du -h
88du -m
89
90# dumpkmap - no counterprt?
91# dutmp - no counterprt?
92
93# echo
94echo "foo bar baz"
95echo -n "no newline"
96
97
98# expr
Mark Whitleyc75f83d2001-03-13 23:30:18 +000099# XXX: something's wrong with the way I'm doing these. Figure it out later.
100#expr 1 \| 1
101#expr 1 \| 0
102#expr 0 \| 1
103#expr 0 \| 0
104#
105#expr 1 \& 1
106#expr 1 \& 0
107#expr 0 \& 1
108#expr 0 \& 0
109#
110#expr 0 \< 1
111#expr 1 \< 0
112#
113#expr 1 \> 0
114#expr 0 \> 1
115#
116#expr 0 \<= 1
117#expr 1 \<= 0
118#expr 1 \<= 1
119#
120#expr 1 \>= 0
121#expr 0 \>= 1
122#expr 1 \>= 1
123#
124#expr 1 + 2
125#expr 2 - 1
126#expr 2 \* 3
127#expr 12 / 2
128#expr 12 % 5
Mark Whitleyd2117e92001-03-10 00:51:29 +0000129
130# somebody else can do all the string stuff
131
132
133# fbset - can't be tested here
134# fdflush
135# find
136find .
137
138# free
139free
140
141# freeramdisk
142# fsck.minix - won't test
143# getopt
144# grep
145# gunzip
146# gzip
147# halt
148
149# head
150head tester.sh
151head -n 2 tester.sh
152
153# hostid
154hostid
155
156# hostname
157hostname
158hostname -s
159hostname -i
160hostname -d
161# not going to do this next one
162#hostname -F
163
164# id
165id
166id -u
167id -g
168id -ur
169id -un
170
171
172# ifconfig
173#ifconfig
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000174#ifconfig -a
Mark Whitleyd2117e92001-03-10 00:51:29 +0000175#ifconfig eth0
176#ifconfig lo
177
178# init - won't test
179# insmod - won't test
180
181# kill
182#kill -l
183# not going to do any more
184
185# length
186# ln
187# loadacm
188# loadfont
189# loadkmap
190# logger
191# logname
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000192
Mark Whitleyd2117e92001-03-10 00:51:29 +0000193# ls
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000194ls ../e*
195ls -l ../e*
196ls -s ../e*
197ls -h ../e*
198ls -1 ../e*
Mark Whitleyd2117e92001-03-10 00:51:29 +0000199
200# lsmod
201lsmod
202
203# makedevs
204
205# md5sum
206md5sum tester.sh
207
208# mkdir
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000209mkdir D ; ls -ld D ; rmdir D
210
Mark Whitleyd2117e92001-03-10 00:51:29 +0000211# mkfifo
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000212#
213# we will test making one. actually testing pushing data through it requires
214# more interaction than we can manage here.
215# (these lines turn up an existing ls bug)
216mkfifo F ; ls -l F ; rm F
217mkfifo -m 0600 F ; ls -l F ; rm F
218
Mark Whitleyd2117e92001-03-10 00:51:29 +0000219# mkfs.minix - won't test
220# mknod
221# mkswap - won't test
222# mktemp
223# more - can't test: interactive
224
225# mount
226mount
227# not going to test any more
228
229# mt
230# nc
231# nfsmount
232# nslookup
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000233# ping
234ping -c 3 yahoo.com
Mark Whitleyd2117e92001-03-10 00:51:29 +0000235# pivot_root
236# poweroff - won't test
237# printf
238# ps - there's lotsa differences between busybox ps and any other ps
239
240# pwd
241pwd
242
243# rdate - won't test
244
245# readlink
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000246ln -sf tester.sh L ; readlink L ; rm -f L
Mark Whitleyd2117e92001-03-10 00:51:29 +0000247
248# reboot - won't test
249# renice - won't test
250# reset - can't test: no output
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000251
Mark Whitleyd2117e92001-03-10 00:51:29 +0000252# rm
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000253touch F ; rm F
254
Mark Whitleyd2117e92001-03-10 00:51:29 +0000255# rmdir
256# rmmod - won't test: dangerous
257# route
258# rpmunpack
259# sed - we can do some one-liners here; probably needs it's own input file
260# setkeycodes
Mark Whitley7384d7d2001-03-15 18:19:13 +0000261
262# sh - note that we cannot test the shell interactively here
263sh -c "echo a b c"
264sh -c ">"
265sh -c "a"
266
Mark Whitleyd2117e92001-03-10 00:51:29 +0000267# sleep - can't test: produces no output
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000268
Mark Whitleyd2117e92001-03-10 00:51:29 +0000269# sort
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000270sort tester.sh
271sort -n tester.sh
272sort -r tester.sh
273
Mark Whitleyd2117e92001-03-10 00:51:29 +0000274# stty
275# swapon - won't test: dangerous
276# swapoff - won't test: dangerous
277# sync - can't test: no output
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000278# syslogd - won't test: too involved
Mark Whitleyd2117e92001-03-10 00:51:29 +0000279
280# tail
281tail tester.sh
282tail -n 2 tester.sh
283
284# tar
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000285
Mark Whitleyd2117e92001-03-10 00:51:29 +0000286# tee
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000287echo "please tee me!" | tee A B C ; cat A B C
288echo "please tee me!" | tee A B C ; echo "tee me too!" | tee -a A B C ; cat A B C ; rm A B C
289
290# telnet - can't test: interactive
291
Mark Whitleyd2117e92001-03-10 00:51:29 +0000292# test
293# tftp
294# touch
295# tr
296true ; echo $?
297false ; echo $?
298# tty
299# umount
300# uname
301# uniq
302# unix2dos
303# update
304
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000305# uptime
Mark Whitleyd2117e92001-03-10 00:51:29 +0000306uptime
307
308# usleep
309# uudecode
310# uuencode
311# watchdog
312
313# wc
314wc tester.sh
315wc -c tester.sh
316wc -w tester.sh
317wc -l tester.sh
318wc -L tester.sh
319
320# wget
321
322# which
323which ls
324
325# whoami
326whoami
327
328# xargs
Mark Whitleyc75f83d2001-03-13 23:30:18 +0000329ls -1 ../e* | xargs
330ls -1 ../e* | xargs md5sum
Mark Whitleyd2117e92001-03-10 00:51:29 +0000331
332# yes - can't test: interactive (needs ^C)