From 7c6ca85e52ecd3faf4ef81d278dbd61a0318b2aa Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 15 Nov 2006 02:05:24 +0000 Subject: [PATCH] adding scripts for automating results --- .../WebServer/Workload/batch/difference.sh | 32 +++++++++++++++++++ .../batch/pure/trans_inventory.sorted | 7 ++++ .../WebServer/Workload/batch/run.sh | 27 ++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100755 Robust/src/Benchmarks/WebServer/Workload/batch/difference.sh create mode 100644 Robust/src/Benchmarks/WebServer/Workload/batch/pure/trans_inventory.sorted create mode 100644 Robust/src/Benchmarks/WebServer/Workload/batch/run.sh diff --git a/Robust/src/Benchmarks/WebServer/Workload/batch/difference.sh b/Robust/src/Benchmarks/WebServer/Workload/batch/difference.sh new file mode 100755 index 00000000..fde42f68 --- /dev/null +++ b/Robust/src/Benchmarks/WebServer/Workload/batch/difference.sh @@ -0,0 +1,32 @@ +#!/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 .. diff --git a/Robust/src/Benchmarks/WebServer/Workload/batch/pure/trans_inventory.sorted b/Robust/src/Benchmarks/WebServer/Workload/batch/pure/trans_inventory.sorted new file mode 100644 index 00000000..5cb507b4 --- /dev/null +++ b/Robust/src/Benchmarks/WebServer/Workload/batch/pure/trans_inventory.sorted @@ -0,0 +1,7 @@ + +book 258 50 +bread 9590 4 +car 39 10000 +coke 2620 5 +pen 601 5 +soap 42 7 diff --git a/Robust/src/Benchmarks/WebServer/Workload/batch/run.sh b/Robust/src/Benchmarks/WebServer/Workload/batch/run.sh new file mode 100644 index 00000000..bed27d70 --- /dev/null +++ b/Robust/src/Benchmarks/WebServer/Workload/batch/run.sh @@ -0,0 +1,27 @@ +#!/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 -- 2.34.1