1#!/bin/bash
2
3# Copyright (C) 2004 Dan Carpenter
4# This software is released under the terms of the GPL
5
6progname=$0
7dir=`dirname $progname`
8[ $dir == "." ] && dir=`pwd`
9
10if [[ "$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
16fi
17
18if [[ $1 == "" ]] ; then
19    echo "Enter a user name to run the test under"
20    read user
21else
22    user="$1"
23fi
24
25[[ "$2" == "" ]] || max_tests="$2"
26[[ "$3" == "" ]] || test_percent="$3"
27
28if [ ! -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"
35fi
36
37trap "echo \"CTRL-C Pressed.  Exiting\"
38./slay $user
39exit 0
40" 2
41
42while true ; do
43	chmod +x $dir
44	su $user -c ./test.sh
45	sleep 8
46	./slay $user
47done
48
49