blob: 4ba5040ccc722e964e89ff61d85eb7136a973337 (
plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
#!/bin/bash
#
# Run specified performance tests and
# gather details about the test run
#
runTest()
{
echo "$@"
echo "$@ --csv -o $LOG_DIR" >> $LOG_DIR/TestRun.log 2>&1
./$@ --csv -o $LOG_DIR >> $LOG_DIR/TestRun.log 2>&1
}
showUsageExit()
{
echo "Usage $0 <Path to Test Pack> <LOG DIR> <TEST LIST FILE>"
exit 1
}
# Ensure we have minimum of three arguments
if [[ $# > 2 ]] ; then
TEST_VERSION=$1
LOG_DIR=$2
TEST_LIST=$3
# Remove these arguments from the $@ variable
shift
shift
shift
else
showUsageExit
fi
#
# Check the specified broker is reachable
# it it is not the log and show usage
#
if [ ! -d $TEST_VERSION ] ; then
echo "Tests not available at: $TEST_VERSION"
showUsageExit
fi
#
# Check to see if we have an absolute path for logging
#
logStart=`echo $LOG_DIR|cut -c 1`
#
# If we don't have an absolute path then add the current
# directory path to the start.
#
if [[ $logStart != '/' ]] ; then
echo -n "$LOG_DIR is not absolute, using "
LOG_DIR=`pwd`/$LOG_DIR
echo $LOG_DIR
fi
#
# Validate that the directory does not exist
# - this is so we can guarrantee a clean run.
# If it does exit then log and show usage
#
if [ -d $LOG_DIR ] ; then
echo "Log directory already exists : $LOG_DIR"
showUsageExit
fi
#
# Check to see if we have an absolute path for test list
#
testListStart=`echo $TEST_LIST|cut -c 1`
#
# If we don't have an absolute path then add the current
# directory path to the start.
#
if [[ $testListStart != '/' ]] ; then
echo -n "$TEST_LIST is not absolute, using "
TEST_LIST=`pwd`/$TEST_LIST
echo $TEST_LIST
fi
#
# Validate that the directory does not exist
# - this is so we can guarrantee a clean run.
# If it does exit then log and show usage
#
# -r Check file exists and is readable
if [ ! -r $TEST_LIST ] ; then
echo "Test file is not readable : $TEST_LIST"
showUsageExit
fi
#
# Create the logging directory
#
mkdir -p $LOG_DIR
echo "Starting Test Run in : $TEST_VERSION"
pushd $TEST_VERSION/bin > /dev/null
#
# Run tests
#
while read testCommand
do
runTest $testCommand
done < "$TEST_LIST"
popd > /dev/null
#
# Generate Stat files
#
echo "Generating Stat data"
for file in `find $LOG_DIR -name "*.csv"` ; do
stat $file > $file.stat
done
|