Change tabbing for everything....
[IRC.git] / Robust / src / Benchmarks / WebServer / Workload / batch / run.sh
1 #!/bin/bash
2
3 let i=0; #Keeps count of number of times the server is launched
4
5 rm output #Errors and total number of run count are redirected to this file
6
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 rm -rf results
11 mkdir results
12 cd results
13 while [ $i -le 299 ]; # The number of runs 
14 do
15         ../trans.bin & #Launch server executable in background
16         sleep 2;
17         ../Workload/workloaderror 127.0.0.1 2>/dev/null & #Run the first workload
18         echo $i >> output;
19         sleep 5;
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
23         then
24                 ../Workload/workloadtrans 127.0.0.1 2>/dev/null
25         else
26                 echo "No Fault Injected" >> output
27         fi;
28         let "i+=1";
29         ps | grep trans | grep -v grep | awk '{print $1}' | xargs kill -9 #Kill the server 
30         sleep 1;
31 done