# See "NOT DONE YET" messages for commands not yet tested.
# BROKEN for things broken.
#---------------
# Thing that don't work in shell.
# A) cat <<EOF	type processing.
#---------------
WORKING=`pwd`
echo "WORKING=${WORKING}" >${WORKING}/WORKING
#---
/bin/basename banana/apple.c
/bin/basename banana/apple.c .c
/bin/basename banana/apple.c .s
#---
/bin/cat /etc/rc
/bin/cat /etc/inittab /etc/group
/bin/echo "test cat with stdin" | /bin/cat /etc/passwd /dev/stdin /etc/group
/bin/echo "test cat with no argument" | /bin/cat
#---
# Test file redirection in shell (and create files for below.
/bin/echo A > ${WORKING}/A
/bin/echo B 1> ${WORKING}/B
/bin/cat /FKSHFKDH 2> ${WORKING}/C
/bin/cat /etc/group /FKSHFKDH >${WORKING}/D 2> ${WORKING}/E
#---
/bin/chgrp demogroup ${WORKING}/A
/bin/chgrp wheel ${WORKING}/B ${WORKING}/C
/bin/chgrp 200 ${WORKING}/D
/bin/chgrp doesnotexist ${WORKING}/E
#---
/bin/chmod 700 ${WORKING}/A
/bin/chmod 555 ${WORKING}/B ${WORKING}/C
/bin/chmod 777 ${WORKING}/D
/bin/chmod 7777 ${WORKING}/E
/bin/chmod a+x ${WORKING}/A
#---
/bin/chown demo ${WORKING}/A
/bin/chown root ${WORKING}/B ${WORKING}/C
/bin/chown 200 ${WORKING}/D
/bin/chown doesnotexist ${WORKING}/E
#---
/bin/cmp ${WORKING}/A ${WORKING}/B
/bin/cmp /etc/group ${WORKING}/D
# no checking for correct number of arguments
/bin/cmp
/bin/cmp ${WORKING}/D
/bin/cmp ${WORKING}/D /etc/group fjkdjfkdj
#---
/bin/cp /etc/group ${WORKING}/F
/bin/cp /etc/group ${WORKING}
/bin/cp /etc/group /etc/passwd ${WORKING}
#---
/bin/date
/bin/date 200002282359.59
/bin/sleep 2
/bin/date
#---
/bin/dd if=${WORKING}/D of=${WORKING}/Z
/bin/dd if=${WORKING}/D of=${WORKING}/Z bs=10 count=2 skip=4 seek=6
/bin/cat Z
# put in a newline.
/bin/echo ""
#---
/bin/df
/bin/df /
/bin/df ${WORKING}
/bin/df /proc
/bin/df /doesnotexist
#---
/bin/dirname
/bin/dirname banana
/bin/dirname banana/cucumber
#---
/bin/echo
/bin/echo "test echo" command
#---
# test variables and expr
a=5
b=2
/bin/echo a=$a b=$b
/bin/expr $a + $b
/bin/expr $a - $b
# test quoting of * in shell.
/bin/expr $a "*" $b
# test backslash-quoting of * in shell.
/bin/expr $a \* $b
/bin/expr $a / $b
/bin/expr $a % $b
/bin/expr 0 \| $b
/bin/expr $a \| $b
/bin/expr "" \| $a
/bin/expr $a \& $b
/bin/expr $a \& 0
/bin/expr 0 \& $b
/bin/expr 1 "=" 1
/bin/expr 1 "=" 2
/bin/expr 1 "=" 2
#---
/bin/false
/bin/echo "status of false gave $?"
#---
/bin/free
#---
#
/bin/echo "IP=" | /bin/dd if=/dev/stdin of=${WORKING}/V bs=3 count=1
/sbin/ifconfig eth0 | /bin/busybox grep "inet addr:" > ${WORKING}/I.1
/bin/sed -e 's/^.*inet addr:\([0-9.][0-9.]*\) .*/\1/' ${WORKING}/I.1 >>${WORKING}/IP
/bin/cat ${WORKING}/IP >>${WORKING}/V
/bin/echo "" >>${WORKING}/V
cat ${WORKING}/WORKING >>${WORKING}/V
/bin/echo '/bin/ftp -n $IP <${WORKING}/ftp' >>${WORKING}/V
#---
/bin/chmod 555 ${WORKING}/V
/bin/echo "user maintainer blip" >${WORKING}/ftp
# ftp "dir" sometimes hangs *sigh*.
# /bin/echo "dir ${WORKING}" >>${WORKING}/ftp
/bin/echo "put /etc/rc ${WORKING}/ftp.put" >>${WORKING}/ftp
/bin/echo "get /etc/rc ${WORKING}/ftp.get" >>${WORKING}/ftp
/bin/echo "quit" >>${WORKING}/ftp
/bin/echo "doing ftp test"
/bin/sh ${WORKING}/V
/bin/echo "done with ftp test"
#---
/bin/hostname
#---
/bin/kill -1 1
/bin/kill -HUP 1
/bin/kill -1 444444
#---
/bin/l ${WORKING}
#---
/bin/ln ${WORKING}/A ${WORKING}/a
/bin/ln -s ${WORKING}/B ${WORKING}/b
#---
# /bin/login must somewhat work, you are here.
# /bin/login
#---
/bin/logname
#---
/bin/ls -liaF ${WORKING}/*
/bin/ls -d ${WORKING}/*
#---
/bin/mkdir ${WORKING}/DIR0 ${WORKING}/DIR1
#---
/bin/mkfifo ${WORKING}/FIFO
#---
/bin/mknod ${WORKING}/NODb b 5 6
/bin/mknod ${WORKING}/NODc c 5 6
/bin/mknod ${WORKING}/NODp p
/bin/ls -li ${WORKING}/NOD*
#---
# kludge around prompting for input.
# BROKEN /bin/echo q | /bin/more /etc/rc | head
/bin/echo q | /bin/more /etc/rc
#---
# mount already has been mostly tested, we are running.
/bin/mount
#---
/bin/mv ${WORKING}/NODb ${WORKING}/NODc ${WORKING}/NODp ${WORKING}/DIR0
#---
/bin/echo '/bin/ping -c 10 -i 1 -l 5 -n -p ff -R -s 1500 -t 5 ' | /bin/dd if=/dev/stdin of=${WORKING}/PING bs=51 count=1
/bin/cat ${WORKING}/IP >>${WORKING}/PING
/bin/echo "" >>${WORKING}/PING
/bin/chmod 555 ${WORKING}/PING
/bin/sh ${WORKING}/PING
#---
/bin/printenv
/bin/printenv PATH
#---
/bin/ps
#---
/bin/pwd
#---
/bin/rm ${WORKING}/DIR0/NOD*
#---
/bin/rmdir ${WORKING}/DIR0
#---
/bin/sash ${WORKING}/PING
#---
# done a lot already with sh.
# /bin/sh
#---
# wants "now", yells about soon.
/bin/shutdown -h soon
#---
/bin/date
/bin/sleep 1
/bin/date
/bin/sleep 2
/bin/date
#---
/bin/stty
/bin/stty erase 
#---
/bin/sync
#---
# NOT DONE YET
# /bin/tftp
#---
# NOT DONE YET
# /bin/tip
#---
/bin/touch ${WORKING}/g ${WORKING}/h
#---
/bin/true
/bin/echo "true returns status $?"
#---
# NOT DONE YET
# /bin/umount
#---
# NOT DONE YET
# /bin/vi
#---
/bin/which stty sleep date
#---
/bin/whoami
#---
/bin/yes abcdefghijklmnopqrstuvwxyz01234567890 | /bin/head
#---
# NOT DONE YET
# /bin/zic
#------------------------------------------------------------------------------
# Already running.
# /sbin/agetty
#---
/sbin/arp
/sbin/arp -a
#---
# NOT DONE YET
# /sbin/depmod
#---
# Already ran this.
# /sbin/expand
#---
# Already ran this with ftp test above.
# /sbin/ftpd
#---
# NOT DONE YET
# /sbin/genksyms
#---
# NOT DONE YET
# /sbin/httpd
#---
# NOT DONE YET
# /sbin/ifattach
#---
/sbin/ifconfig -a
#---
# Already running, ftp test shows that it is running.
# /sbin/inetd
#---
# Already running.
# /sbin/init
#---
# NOT DONE YET
# /sbin/insmod
#---
# NOT DONE YET
# /sbin/insmod_ksymoops_clean
#---
# NOT DONE YET
# /sbin/ipfwadm
#---
# NOT DONE YET (linux doesn't support shell scripts)
# /sbin/kernelversion
#---
# NOT DONE YET
# /sbin/kallsyms
#---
# NOT DONE YET
# /sbin/ksyms
#---
# NOT DONE YET
# /sbin/lsmod
#---
# NOT DONE YET
# /sbin/modinfo
#---
# NOT DONE YET
# /sbin/modprobe
#---
# NOT DONE YET, needs NFS.
# /sbin/portmap
#---
# NOT DONE YET
# /sbin/pppd
#---
# NOT DONE YET
# /sbin/rmmod
#---
/sbin/route
#---
# NOT DONE YET
# /sbin/telnetd
#---
# Already tested, with ftp test.
# /sbin/tftpd
#------------------------------------------------------------------------------
# Busybox does a bunch of built-in commands, some much "better".
/bin/busybox
# Some cleanup of files
/bin/busybox rm -f ${WORKING}/m* ${WORKING}/ftp* A B C D E F group passwd Z V I.1 IP a b g FIFO h
/bin/busybox rmdir DIR1
# Show more complete ls.
/bin/busybox ls -Flu ${WORKING}
# Show more complete free.
/bin/busybox free
#---
/bin/clear
/bin/echo
#---
/bin/dmesg | /bin/head
#---
/bin/du ${WORKING}
#---
/bin/find ${WORKING} -name run
#---
/bin/cp ${WORKING}/PING ${WORKING}/PING.save
/bin/gzip ${WORKING}/PING
#---
/bin/cp ${WORKING}/PING.gz ${WORKING}/PING.save.gz
/bin/gunzip ${WORKING}/PING.gz
/bin/cmp ${WORKING}/PING.save ${WORKING}/PING
#---
# Already did head a couple times, do the -n option.
/bin/head -n 4 /etc/rc
#---
/bin/echo "-----------------------------------------------------------------------------"
/bin/sort /etc/rc
/bin/echo "-----------------------------------------------------------------------------"
#---
# /bin/tar cvf ${WORKING}/xxx /etc/rc /etc/group
# cd ${WORKING}
# /bin/tar xvf ${WORKING}/xxx
# /bin/ls -la ${WORKING}/etc
#---
/bin/echo "testing tee command" | /bin/tee ${WORKING}/tee
/bin/cat ${WORKING}/tee
#---
/bin/uname -m
/bin/uname -n
/bin/uname -r
/bin/uname -s
/bin/uname -p
/bin/uname -v
/bin/uname -a
#---
/bin/wc /etc/rc
/bin/wc -l /etc/rc
/bin/wc -w /etc/rc
/bin/wc -c /etc/rc
/bin/wc -L /etc/rc
#---
# NOTE: do not put /bin/zcat, it does not work right!
zcat ${WORKING}/PING.save.gz
#---
# Final cleanup.
/bin/busybox rm -f P* etc/* tee xxx
# --tar not working above.  -- /bin/busybox rmdir etc
#---
/bin/catchup
echo "doing ps"
/bin/catchup
/bin/ps
echo "doing busybox ps"
/bin/catchup
/bin/busybox ps
echo "Done with evm-testscript"
/bin/catchup
rm WORKING
exit 0
