summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Event_Latency/run_tests.sh
blob: 483261ba02f6a7564dc7e168c4b091841eec32a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /bin/sh
# $Id$
#
# Runs Event_Latency test.

usage="Usage: $0 [-m <messages>] [-s <suppliers>]"
messages=1000
suppliers=1

########
######## Interpret command arguments.
########
skip_arg=0
for arg in "$@"; do
  if [ $skip_arg -eq 0 ]; then
    case $arg in
       -m ) messages=$2
            skip_arg=1
            ;;
       -s ) suppliers=$2
            skip_arg=1
            ;;
       -* ) echo undefined option: $arg
            echo $usage
            exit 1
            ;;
       *  ) echo $usage
            exit 1
            ;;
     esac
 else
   skip_arg=0
 fi
 shift
done

whoami=`whoami`

#### Get the user name
if [ "$LOGNAME" ]; then
  #### LOGNAME is preserved across su
  login=$LOGNAME
else
  #### whoami returns the users login, which changes across su
  login=$whoami
fi

run ()
#### Run the process in the RT class, if root on Solaris.
{
  if [ `uname -s` = 'SunOS'  -a  "$whoami" = 'root' ]; then
    LD_BIND_NOW=1 priocntl -e -c RT -p 0 $@
  else
    $@
  fi
}


########
######## Clean up on normal or abnormal termination.
########
trap '../start_services clean' 0 1 2 3 15


########
######## Start NameService, etc.
########
run ../start_services
NameService=`cat /tmp/nameserviceior_$login`
export NameService


########
######## Run the Event_Latency test.
########
./Event_Latency -j -t 50 -m $messages -s $suppliers -c $suppliers