This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] /
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 export BRISTLECONE="-initializerandom -injectinstructionfailures 35 0.00001667 50"
11 rm -rf results
12 mkdir results
13 cd results
14 while [ $i -le 201 ]; # The number of runs 
15   do
16   mkdir trial$i
17   cd trial$i
18   let errorcount=0
19   let count=0
20   ../../trans.bin &> log & #Launch server executable in background
21   sleep 2;
22   ../../Workload/workload 127.0.0.1 2>/dev/null & #Run the first workload
23   echo $i >> ../output;
24   while true
25   do
26   process=`ps | grep wget | grep -v grep | awk '{print $1}'`
27   sleep 1
28   process2=`ps | grep wget | grep -v grep | awk '{print $1}'`
29   if [ "$process" != "" ]
30   then
31   if [ "$process" = "$process2" ]
32     then
33       let "count=1"
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
36     then
37       let "errorcount+=1"
38     fi
39   fi
40 else
41       if [ "$process2" != "" ]
42           then
43           let "count=1"
44           else
45           let "count+=1"
46           if [ $count == 30 ]
47           then
48               break
49           fi
50           fi
51   fi
52 done
53 echo Errorcount=$errorcount >> ../output
54 let "i+=1";
55 process=`ps | grep workload | grep -v grep | awk '{print $1}'`
56 kill -9 $process
57 process=`ps | grep trans | grep -v grep | awk '{print $1}'`
58 cat ../../gdbquery | gdb ../../trans.bin $process &> output
59 kill -1 $process
60 sleep 1
61 kill $process
62 sleep 1;
63 cd ..
64 done