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"
13 while [ $i -le 299 ]; # The number of runs
15 ../trans.bin & #Launch server executable in background
17 ../Workload/workloaderror 127.0.0.1 2>/dev/null & #Run the first workload
20 process=`ps | grep workloaderror | grep -v grep | awk '{print $1}'`
21 kill -9 $process #Kill the first workload
22 if [ $? -eq 0 ] #Launch the second worload only if the Failure is injected in the first workload
24 ../Workload/workloadtrans 127.0.0.1 2>/dev/null
26 echo "No Fault Injected" >> output
29 ps | grep trans | grep -v grep | awk '{print $1}' | xargs kill -9 #Kill the server