--- /dev/null
+#!/bin/sh
+
+rm result_inventory
+#For every trans_inventory* file remove the lines starting with pre and sort the file
+for file in `ls trans_inventory*`
+do
+ echo "Doing $file"
+ grep -v pre $file > ${file}.nopre
+ sort -n ${file}.nopre > runs/${file}.sorted
+done
+
+\rm *.nopre
+cd runs
+let x=0;
+#for every sorted file created above diff it with the orginial file called pure/trans_inventory.sorted and print the total success or failures occured
+for file in `ls *sorted`
+do
+ echo -n "Diffing $file...";
+ diff $file ../pure/trans_inventory.sorted
+ if [ $? -ne 0 ]
+ then
+ let "x+=1";
+ else
+ echo " success ";
+ fi
+done
+
+echo "RESULT: x is $x";
+echo -n "RESULT: Total files compared is "
+ls *sorted | wc -l
+
+cd ..
--- /dev/null
+#!/bin/bash
+
+let i=0; #Keeps count of number of times the server is launched
+
+rm output #Errors and total number of run count are redirected to this file
+
+#Sets the BRISTLECONE parameter with a certain instruction count, probability and
+#number of failures that can be injected
+export BRISTLECONE="-initializerandom -injectinstructionfailures 10 0.00001667 1 -debugtask"
+while [ $i -le 299 ]; # The number of runs
+do
+ ./trans.bin & #Launch server executable in background
+ sleep 2;
+ ../../workloaderror 2>/dev/null & #Run the first workload
+ echo $i >> output;
+ sleep 5;
+ ps | grep workloaderror | grep -v grep | awk '{print $1}' | xargs kill -9 #Kill the first workload
+ if [ $? -eq 0 ] #Launch the second worload only if the Failure is injected in the first workload
+ then
+ ../../workloadtrans 2>/dev/null
+ else
+ echo " Error occured" >> output
+ fi;
+ let "i+=1";
+ ps | grep trans | grep -v grep | awk '{print $1}' | xargs kill -9 #Kill the server
+ sleep 1;
+done