forked from Percona-QA/psmdb-misc-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_smoke_psmdb_3.0.sh
executable file
·174 lines (150 loc) · 6.25 KB
/
run_smoke_psmdb_3.0.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/bash
# Run smoke tests for PSMDB 3.0
basedir=$(cd "$(dirname "$0")" || exit; pwd)
# shellcheck source=run_smoke_resmoke_funcs.sh
source "${basedir}/run_smoke_resmoke_funcs.sh"
detectEngines
# suite definitions - first element is suite name
# followed by runSets
# runSets:
# default - run the suite with default smoke config
# se - run the suite with all non-default storage engines
# auth - run the suite with authentication
# wiredTiger - run with wiredTiger storage engine
# PerconaFT - run with PerconaFT storage engine
# rocksdb - run with rocksdb storage engine
# mmapv1 - run with mmapv1 storage engine
# suite name or runSets can have -- style options specified
# which are passed to smoke
#
# lines beginning one or more spaces followed by a $ denote shell commands to
# run before the preceding suite runSets are run.
readarray SUITES <<-EOS
aggregation --nopreallocj|default|auth|se
audit --nopreallocj|default|se
auth --nopreallocj|default|se
concurrency --nopreallocj|default|se
concurrency --nopreallocj --shell-write-mode compatibility|default|se
dbtest --nopreallocj|default|se
disk --nopreallocj|default
dur --nopreallocj|default
failPoint --nopreallocj|default|auth
gle --nopreallocj --auth|default|se
gle --nopreallocj --auth --shell-write-mode commands|default|se
jsCore --nopreallocj --shell-write-mode commands|se|default|auth
jsCore --nopreallocj --shell-write-mode compatibility|default|se
jsCore --shell-write-mode commands --small-oplog|default|se
mmap_v1 --nopreallocj|default
mongosTest --nopreallocj|default
multiVersion --nopreallocj|default
$ rm -rf ${DBPATH}/install ${DBPATH}/multiversion
$ python buildscripts/setup_multiversion_mongodb.py ${DBPATH}/install ${DBPATH}/multiversion "Linux/x86_64" "1.8" "2.0" "2.2" "2.4" "2.6"
$ [[ ${PATH} == *"/data/multiversion"* ]] || export PATH=${PATH}:/data/multiversion
noPassthrough --nopreallocj|default|se
noPassthroughWithMongod --nopreallocj|default|se
parallel --nopreallocj|default|se
parallel --nopreallocj --shell-write-mode compatibility|default|se
replSets --nopreallocj|default|se|auth
repl --nopreallocj|default|se|auth
sharding --nopreallocj|default|se|auth
slow1 --nopreallocj|default|se
slow2 --nopreallocj|default|se
ssl --nopreallocj --use-ssl|default
sslSpecial --nopreallocj|default
tool --nopreallocj|default|se
EOS
# smoke parameters
SMOKE_BASE="--continue-on-failure --with-cleanbb"
SMOKE_DEFAULT=""
SMOKE_AUTH="--auth"
SMOKE_SE=""
run_system_validations
# trial number
if [ "$1" == "" ]; then
echo "Usage ./run_smoke.sh {trial #}"
exit 1;
fi
trial=$1
# main script
runSmoke() {
local smokeParams=$1
local logOutputFile=$2
local suiteRawName=$3
rm -rf "${DBPATH}/db/*"
runPreprocessingCommands "${logOutputFile}" "${suiteRawName}"
echo "Running Command: python buildscripts/smoke.py ${smokeParams}" | tee -a "${logOutputFile}"
# shellcheck disable=SC2086
python buildscripts/smoke.py ${smokeParams} >>"${logOutputFile}" 2>&1
}
for suite in "${SUITES[@]}"; do
# skip lines begining with space
if [[ "${suite}" == " "* ]]; then
continue;
fi
IFS='|' read -r -a suiteDefinition <<< "${suite}"
suiteElementNumber=0
for suiteElement in "${suiteDefinition[@]}"; do
if [[ ${suiteElement} =~ ^([a-zA-Z0-9_]+)[[:space:]](.*)$ ]]; then
suiteElementName=${BASH_REMATCH[1]}
suiteElementOptions=${BASH_REMATCH[2]}
else
suiteElementName=${suiteElement}
suiteElementOptions=""
fi
if [ ${suiteElementNumber} -eq 0 ]; then
suite=${suiteElementName}
suiteRawName=${suiteElement}
suiteOptions=${suiteElementOptions}
suiteLogTag=$(echo "${suiteElement}" | sed -r -e 's/ +/_/g' -e 's/-//g')
else
suiteRunSet=${suiteElementName}
suiteRunSetOptions=${suiteElementOptions}
logOutputFilePrefix="smoke_${suiteLogTag}_${suiteRunSet}"
case "$suiteRunSet" in
"default"|"auth")
logOutputFile="${logOutputFilePrefix}_${trial}.log"
echo "Suite Definition: ${suiteRawName}|${suiteElement}" | tee -a "${logOutputFile}"
[ "${suiteRunSet}" == "default" ] && smokeParams=${SMOKE_DEFAULT}
[ "${suiteRunSet}" == "auth" ] && smokeParams=${SMOKE_AUTH}
smokeParams="${SMOKE_BASE} ${smokeParams} --storageEngine=${DEFAULT_ENGINE} ${suiteOptions} ${suiteRunSetOptions} ${suite}"
runSmoke "${smokeParams}" "${logOutputFile}" "${suiteRawName}"
;;
"wiredTiger"|"PerconaFT"|"rocksdb"|"mmapv1")
logOutputFile="${logOutputFilePrefix}_${trial}.log"
if hasEngine "${suiteRunSet}"; then
echo "Suite Definition: ${suiteRawName}|${suiteElement}" | tee -a "${logOutputFile}"
smokeParams="${SMOKE_BASE} ${SMOKE_SE} --storageEngine=${suiteRunSet} ${suiteOptions} ${suiteRunSetOptions} ${suite}"
runSmoke "${smokeParams}" "${logOutputFile}" "${suiteRawName}"
else
echo "failed: Storage Engine runSet: ${suiteRunSet} requested for suite ${suite} but is not available." | tee -a "${logOutputFile}"
fi
;;
"se")
for engine in "${ENGINES[@]}"; do
if [ ! "${engine}" == "${DEFAULT_ENGINE}" ]; then
logOutputFile="${logOutputFilePrefix}_${engine}_${trial}.log"
if [[ -z "${suiteRunSetOptions}" ]]; then
suiteDefinition="${suiteRawName}|${engine}"
else
suiteDefinition="${suiteRawName}|${engine} ${suiteRunSetOptions}"
fi
echo "Suite Definition: ${suiteDefinition}" | tee -a "${logOutputFile}"
smokeParams="${SMOKE_BASE} --storageEngine=${engine} ${SMOKE_SE} ${suiteOptions} ${suiteRunSetOptions} ${suite}"
runSmoke "${smokeParams}" "${logOutputFile}" "${suiteRawName}"
fi
done
;;
*)
echo "failed: Unknown runSet definition: ${suiteRunSet} for ${suite}" | tee -a "smoke_unknown_${trial}.log"
;;
esac
fi
((suiteElementNumber++))
done
done
# output summary report
find . -type f \( -name "*_${trial}.log" -and -not -name "smoke_summary_${trial}.log" \) \
-print \
-exec sh -c 'logfile="$1"; grep -E -A9999 "^[0-9]+ tests succeeded" "${logfile}" | sed -e "s/^/ /"' _ "{}" \; \
-exec echo "" \; \
| tee "smoke_summary_${trial}.log"