From fe3fbf6860e1ba5f2ff32def6ed8a63148fd98fa Mon Sep 17 00:00:00 2001 From: levine Date: Wed, 13 May 1998 21:58:24 +0000 Subject: fixed traps, and use port that depends on uid --- TAO/tests/Param_Test/run_test.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/TAO/tests/Param_Test/run_test.sh b/TAO/tests/Param_Test/run_test.sh index 6af06e1af7a..8b0a7ef384c 100755 --- a/TAO/tests/Param_Test/run_test.sh +++ b/TAO/tests/Param_Test/run_test.sh @@ -1,25 +1,37 @@ #!/bin/sh # $Id$ -PORT=30001 -IORFILE=theior -INVOCATION=sii +uid=`id | cut -c5-20 | cut -f1 -d"("` +port=`expr 30001 + $uid` +iorfile=theior +invocation=sii + +if [ `uname -s` = 'SunOS' ]; then + #### SunOS sh's trap doesn't understand symbolic names for signals. + sigchld=18 +else + sigchld='SIGCHLD' + # Don't do this on SunOS. It goes into an endless loop. + trap "start_server" $sigchld +fi + start_server() { - ./server -ORBobjrefstyle url -ORBport $PORT -o $IORFILE 2>&1 | sed -e 's/^/SERVER: /' & + ./server -ORBobjrefstyle url -ORBport $port -o $iorfile 2>&1 | \ + sed -e 's/^/SERVER: /' & server_pid=`ps | grep server | grep -v grep | awk '{print $1;}'` sleep 2 # Give the server a chance to start up } # Restart the server if we get SIGCHLD, i.e., the server died. -trap "start_server" SIGCHLD start_server -trap "kill $server_pid; rm -f $IORFILE" 0 1 2 3 15 +trap "kill $server_pid; rm -f $iorfile" 0 1 2 3 15 -TYPES="short ubstring fixed_struct strseq var_struct nested_struct struct_seq objref" -for type in $TYPES +types="short ubstring fixed_struct strseq var_struct nested_struct struct_seq objref" +for type in $types do echo "BEGIN Testing type $type" - ./client -f $IORFILE -i $INVOCATION -t $type 2>&1 | sed -e "s/^/CLIENT($type): /" + ./client -f $iorfile -i $invocation -t $type 2>&1 | \ + sed -e "s/^/CLIENT($type): /" echo "END Testing type $type" done -- cgit v1.2.1