Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 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 | |
| 25 | |
| 26 | # ar |
| 27 | |
| 28 | # basename |
| 29 | basename `pwd` |
| 30 | |
| 31 | # cat |
| 32 | cat 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 |
| 45 | echo "1234" | cut -c1 |
| 46 | echo "f1 f2" | cut -f2 |
| 47 | |
| 48 | # date |
| 49 | date |
| 50 | date -R |
| 51 | date -u |
| 52 | date +%d/%m/%y |
| 53 | |
| 54 | # dc - needs an input file |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 55 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 56 | # dd |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 57 | dd if=/dev/urandom of=O bs=1k count=1 ; ls -l O ; rm O |
| 58 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 59 | # deallocvt |
| 60 | |
| 61 | # df |
| 62 | df |
| 63 | df . |
| 64 | df -k |
| 65 | df -h |
| 66 | df -m |
| 67 | |
| 68 | # dirname |
| 69 | dirname `pwd` |
| 70 | |
| 71 | # dmesg (XXX: change the silly cmd business in the source) |
| 72 | dmesg |
| 73 | dmesg -n 8 |
| 74 | dmesg -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 |
| 83 | du |
| 84 | du -s |
| 85 | du -l |
| 86 | du -k |
| 87 | du -h |
| 88 | du -m |
| 89 | |
| 90 | # dumpkmap - no counterprt? |
| 91 | # dutmp - no counterprt? |
| 92 | |
| 93 | # echo |
| 94 | echo "foo bar baz" |
| 95 | echo -n "no newline" |
| 96 | |
| 97 | |
| 98 | # expr |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 99 | # 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 Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 129 | |
| 130 | # somebody else can do all the string stuff |
| 131 | |
| 132 | |
| 133 | # fbset - can't be tested here |
| 134 | # fdflush |
| 135 | # find |
| 136 | find . |
| 137 | |
| 138 | # free |
| 139 | free |
| 140 | |
| 141 | # freeramdisk |
| 142 | # fsck.minix - won't test |
| 143 | # getopt |
| 144 | # grep |
| 145 | # gunzip |
| 146 | # gzip |
| 147 | # halt |
| 148 | |
| 149 | # head |
| 150 | head tester.sh |
| 151 | head -n 2 tester.sh |
| 152 | |
| 153 | # hostid |
| 154 | hostid |
| 155 | |
| 156 | # hostname |
| 157 | hostname |
| 158 | hostname -s |
| 159 | hostname -i |
| 160 | hostname -d |
| 161 | # not going to do this next one |
| 162 | #hostname -F |
| 163 | |
| 164 | # id |
| 165 | id |
| 166 | id -u |
| 167 | id -g |
| 168 | id -ur |
| 169 | id -un |
| 170 | |
| 171 | |
| 172 | # ifconfig |
| 173 | #ifconfig |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 174 | #ifconfig -a |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 175 | #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 Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 192 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 193 | # ls |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 194 | ls ../e* |
| 195 | ls -l ../e* |
| 196 | ls -s ../e* |
| 197 | ls -h ../e* |
| 198 | ls -1 ../e* |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 199 | |
| 200 | # lsmod |
| 201 | lsmod |
| 202 | |
| 203 | # makedevs |
| 204 | |
| 205 | # md5sum |
| 206 | md5sum tester.sh |
| 207 | |
| 208 | # mkdir |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 209 | mkdir D ; ls -ld D ; rmdir D |
| 210 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 211 | # mkfifo |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 212 | # |
| 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) |
| 216 | mkfifo F ; ls -l F ; rm F |
| 217 | mkfifo -m 0600 F ; ls -l F ; rm F |
| 218 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 219 | # mkfs.minix - won't test |
| 220 | # mknod |
| 221 | # mkswap - won't test |
| 222 | # mktemp |
| 223 | # more - can't test: interactive |
| 224 | |
| 225 | # mount |
| 226 | mount |
| 227 | # not going to test any more |
| 228 | |
| 229 | # mt |
| 230 | # nc |
| 231 | # nfsmount |
| 232 | # nslookup |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 233 | # ping |
| 234 | ping -c 3 yahoo.com |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 235 | # 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 |
| 241 | pwd |
| 242 | |
| 243 | # rdate - won't test |
| 244 | |
| 245 | # readlink |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 246 | ln -sf tester.sh L ; readlink L ; rm -f L |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 247 | |
| 248 | # reboot - won't test |
| 249 | # renice - won't test |
| 250 | # reset - can't test: no output |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 251 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 252 | # rm |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 253 | touch F ; rm F |
| 254 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 255 | # 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 Whitley | 7384d7d | 2001-03-15 18:19:13 +0000 | [diff] [blame] | 261 | |
| 262 | # sh - note that we cannot test the shell interactively here |
| 263 | sh -c "echo a b c" |
| 264 | sh -c ">" |
| 265 | sh -c "a" |
| 266 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 267 | # sleep - can't test: produces no output |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 268 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 269 | # sort |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 270 | sort tester.sh |
| 271 | sort -n tester.sh |
| 272 | sort -r tester.sh |
| 273 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 274 | # stty |
| 275 | # swapon - won't test: dangerous |
| 276 | # swapoff - won't test: dangerous |
| 277 | # sync - can't test: no output |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 278 | # syslogd - won't test: too involved |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 279 | |
| 280 | # tail |
| 281 | tail tester.sh |
| 282 | tail -n 2 tester.sh |
| 283 | |
| 284 | # tar |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 285 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 286 | # tee |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 287 | echo "please tee me!" | tee A B C ; cat A B C |
| 288 | 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 |
| 289 | |
| 290 | # telnet - can't test: interactive |
| 291 | |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 292 | # test |
| 293 | # tftp |
| 294 | # touch |
| 295 | # tr |
| 296 | true ; echo $? |
| 297 | false ; echo $? |
| 298 | # tty |
| 299 | # umount |
| 300 | # uname |
| 301 | # uniq |
| 302 | # unix2dos |
| 303 | # update |
| 304 | |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 305 | # uptime |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 306 | uptime |
| 307 | |
| 308 | # usleep |
| 309 | # uudecode |
| 310 | # uuencode |
| 311 | # watchdog |
| 312 | |
| 313 | # wc |
| 314 | wc tester.sh |
| 315 | wc -c tester.sh |
| 316 | wc -w tester.sh |
| 317 | wc -l tester.sh |
| 318 | wc -L tester.sh |
| 319 | |
| 320 | # wget |
| 321 | |
| 322 | # which |
| 323 | which ls |
| 324 | |
| 325 | # whoami |
| 326 | whoami |
| 327 | |
| 328 | # xargs |
Mark Whitley | c75f83d | 2001-03-13 23:30:18 +0000 | [diff] [blame] | 329 | ls -1 ../e* | xargs |
| 330 | ls -1 ../e* | xargs md5sum |
Mark Whitley | d2117e9 | 2001-03-10 00:51:29 +0000 | [diff] [blame] | 331 | |
| 332 | # yes - can't test: interactive (needs ^C) |