-
Notifications
You must be signed in to change notification settings - Fork 3
/
cassandraStress.sh
executable file
·71 lines (51 loc) · 1.36 KB
/
cassandraStress.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
REGRESS_PATH=~/test/HPCC-Platform/testing/regress/
TARGETS=( hthor thor roxie )
LONG_DATE=$(date +%Y-%m-%d_%H-%M-%S);
LOGFILE=~/iter-log-${LONG_DATE}.log
RESFILE=~/iter-res-${LONG_DATE}.log
ShowRes()
(
IFS=$'\n'
for line in $1
do
echo $line >> ${LOGFILE}
done
#echo ""
)
echo "Start..." > ${LOGFILE}
echo "Start..." > ${RESFILE}
for target in ${TARGETS[@]}
do
iter=1
while true
do
echo "Target:"${target}", iteration:"$iter
echo "Target:"${target}", iteration:"$iter >> ${LOGFILE}
echo "Target:"${target}", iteration:"$iter >> ${RESFILE}
res=$( ecl run -v -t ${target} ${REGRESS_PATH}ecl/cassandra-simple.ecl 2>&1 )
ShowRes "$res"
# echo $res
pass=$( echo ${res} | grep '<Result_18>Done' )
if [ -z "${pass}" ]
then
echo "Fail"
echo "Fail" >> ${RESFILE}
else
echo "Pass"
echo "Pass" >> ${RESFILE}
fi
echo "" >> ${LOGFILE}
sleep 10
echo "------------------------------------------"
echo "------------------------------------------" >> ${LOGFILE}
echo "------------------------------------------" >> ${RESFILE}
iter=$(( $iter + 1 ))
if [ ${iter} -eq 11 ]
then
break;
fi
done
done
echo "End." >> ${LOGFILE}
echo "End." >> ${RESFILE}