1 #!/bin/bash 2 3 # Copyright (C) 2004 Dan Carpenter 4 # This software is released under the terms of the GPL 5 6 progname=$0 7 dir=`dirname $progname` 8 [ $dir == "." ] && dir=`pwd` 9 10 if [[ "$1" == "-h" || "$1" == "-help" ]] ; then 11 echo "$progname [user][max_tests][test_percent]" 12 echo " user => username to the scripts under" 13 echo " max_tests => maximun concurrent tests to run" 14 echo "test_percent => percent of the syscalls to test" 15 exit 0 16 fi 17 18 if [[ $1 == "" ]] ; then 19 echo "Enter a user name to run the test under" 20 read user 21 else 22 user="$1" 23 fi 24 25 [[ "$2" == "" ]] || max_tests="$2" 26 [[ "$3" == "" ]] || test_percent="$3" 27 28 if [ ! -e test_list.txt ] ; then 29 echo "Enter the path to the ltp scripts" 30 read ltp_path 31 echo "Creating test_list.txt" 32 find $ltp_path -type f -name \*[0-9] > test_list.txt 33 tmp=`cat test_list.txt | wc -l` 34 echo "$tmp test scripts found" 35 fi 36 37 trap "echo \"CTRL-C Pressed. Exiting\" 38 ./slay $user 39 exit 0 40 " 2 41 42 while true ; do 43 chmod +x $dir 44 su $user -c ./test.sh 45 sleep 8 46 ./slay $user 47 done 48 49