From: Subrata <sub...@us...> - 2007-11-25 16:07:45
|
Update of /cvsroot/ltp/ltp/testscripts In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15861/ltp/testscripts Modified Files: adp.sh Log Message: Changes that allows adp to run top on batch mode instead of interactively, submitted by Rafael Folco <rf...@li...> Index: adp.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testscripts/adp.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** adp.sh 3 Jun 2004 16:16:36 -0000 1.1 --- adp.sh 25 Nov 2007 16:07:36 -0000 1.2 *************** *** 5,9 **** # ! echo "Starting test, please wait.... Ctrl-C to exit" for i in 1 2 3 4 5 --- 5,66 ---- # ! usage() ! { ! cat << EOF ! usage: $0 options ! ! This script runs ADP's stress test on /proc/[0-0]*/cmdline. ! ! OPTIONS ! -h display this message and exit ! -d delay for top, in seconds ! -n number of iterations for top ! EOF ! } ! ! ! checkvar() ! { ! VAR=$1 ! eval VALUE='$'$VAR ! if [ "x$VALUE" = "x" ]; then ! echo "`basename $0`: $VAR is not set." ! return 1 ! else ! return 0 ! fi ! } ! ! ! while getopts hd:n: OPTION ! do ! case $OPTION in ! h) ! usage ! exit 1 ! ;; ! d) ! delay=$OPTARG ! ;; ! n) ! iterations=$OPTARG ! ;; ! ?) ! usage ! exit 1 ! ;; ! esac ! done ! ! ! #check all vars ! checkvar delay && checkvar iterations || { ! usage ! exit 2 ! } ! ! echo "-------------------------------------------------------------------------" ! date ! echo "Starting tests..." for i in 1 2 3 4 5 *************** *** 12,16 **** done ! sleep 2 for i in 1 2 3 4 5 --- 69,73 ---- done ! echo "Stressing /proc/[0-9]*/cmdline..." for i in 1 2 3 4 5 *************** *** 19,21 **** done ! top --- 76,89 ---- done ! echo "Starting 'top', redirecting output to 'adp.log'..." ! top -b -d $delay -n $iterations > adp.log & ! ! echo "LTP ADP Test done. Killing processes..." ! killall adp_test.sh ! killall adp_children.sh ! ! echo "Done. Please check adp.log." ! date ! ! echo "-------------------------------------------------------------------------" ! |