3 let i=0; #Keeps count of number of times the server is launched
5 rm output #Errors and total number of run count are redirected to this file
7 #Sets the BRISTLECONE parameter with a certain instruction count, probability and
8 #number of failures that can be injected
9 #export BRISTLECONE="-initializerandom -injectinstructionfailures 10 0.00001667 1 -debugtask"
10 export BRISTLECONE="-initializerandom -injectinstructionfailures 35 0.00001667 50"
14 while [ $i -le 299 ]; # The number of runs
20 ../../trans.bin & #Launch server executable in background
22 ../../Workload/workload 127.0.0.1 2>/dev/null & #Run the first workload
26 process=`ps | grep wget | grep -v grep | awk '{print $1}'`
28 process2=`ps | grep wget | grep -v grep | awk '{print $1}'`
29 if [ "$process" != "" ]
31 if [ "$process" = "$process2" ]
34 kill -9 $process #Kill the first workload
35 if [ $? -eq 0 ] #Launch the second worload only if the Failure is injected in the first workload
41 if [ "$process2" != "" ]
53 echo Errorcount=$errorcount >> ../output
55 process=`ps | grep workload | grep -v grep | awk '{print $1}'`
57 ps | grep trans | grep -v grep | awk '{print $1}' | xargs kill -9 #Kill the server