3 # This test is a part of RPC & TI-RPC Test Suite created by Cyril LACABANNE
5 # Please refer to RPC & TI-RPC Test Suite documentation.
6 # More details at http://nfsv4.bullopensource.org/doc/rpc_testsuite.php
8 # TEST : RPC stdcall clnt_call performance
9 # creation : 2007-06-28 revision 2007-
11 # **********************
12 # *** INITIALISATION ***
13 # **********************
14 # Parameters such as tests information, threads number...
16 TESTNAME
="RPC_std-call_clnt_call.performance"
18 # test binaries, used to call
19 TESTCLIENTPATH
="rpc_suite/rpc/rpc_stdcall_clnt_call"
20 TESTCLIENTBIN
="7-performance.bin"
21 TESTCLIENT
=$CLIENTTSTPACKDIR/$TESTCLIENTPATH/$TESTCLIENTBIN
22 # table to save all tests result
24 # tmp file declaration to store test returned result
25 TMPRESULTFILE
=/tmp
/rpcts.tmp
31 # erase temp. result file
32 echo -n "">$TMPRESULTFILE
34 # function to collect log result
37 # default : test failed
40 # if result table is empty last test crashes (segment fault), so return must be "failed"
41 if [ ${#result[*]} -eq 0 ]
46 # if all test instances return same result return the first element, note that test succeeds if value is 0
50 # function to put test result into logfile
55 1)r_valueTxt
="FAILED";;
57 3)r_valueTxt
="INTERRUPTED";;
59 5)r_valueTxt
="UNTESTED";;
62 echo $TESTCLIENTPATH"/"$
( echo $TESTCLIENTBIN | cut
-d .
-f1 )": execution: "$r_valueTxt>>$LOCLOGDIR/$TESTLOGFILE
63 # print into log file tests perf results
64 echo -n "Average execution time : "${result[1]}" ms (">>$LOCLOGDIR/$TESTLOGFILE
65 echo "for "${result[2]}" iterations)">>$LOCLOGDIR/$TESTLOGFILE
66 echo "Minimal execution time : "${result[3]}" ms">>$LOCLOGDIR/$TESTLOGFILE
67 echo "Maximal execution time : "${result[4]}" ms">>$LOCLOGDIR/$TESTLOGFILE
70 # test needs this server to run
71 serv
=$
( $REMOTESHELL $SERVERUSER@
$SERVERIP "ps -e | grep $TESTSERVER_1_BIN" )
75 echo "/!\ Panic : no test server found"
76 echo " $TESTSERVER_1_BIN needed, but not running on server"
77 echo " Test skipped with status 4"
80 echo " * $TESTNAME execution: "$r_valueTxt
84 # launch client instances depeding on test...
85 $REMOTESHELL $CLIENTUSER@
$CLIENTIP "$TESTCLIENT $SERVERIP $PROGNUMBASE $NBPERFTESTITER" >>$TMPRESULTFILE&
87 # wait for the end of all test
90 # test if all test instances have stopped
91 # if it remains at least one instances, script kills instances and put status HUNG to the whole test case
93 IS_EX
=`$REMOTESHELL $CLIENTUSER@$CLIENTIP "ps -e | grep $TESTCLIENTBIN"`
99 echo " - error : prog is still running -> kill"
101 $REMOTESHELL $CLIENTUSER@
$CLIENTIP "killall -9 $TESTCLIENTBIN"
104 echo " * $TESTNAME execution: "$r_valueTxt
112 # if test program correctly run, this part aims to collect all test results and put result into log file
113 result
=( $
(cat $TMPRESULTFILE) )
116 echo " * $TESTNAME execution: "$r_valueTxt