This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
/
runalltest.sh
executable file
·227 lines (188 loc) · 6.28 KB
/
runalltest.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#!/bin/sh
#
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# For any questions about this software or licensing,
# please email [email protected] or [email protected].
#
# Script to run UTs & STs
set -e
usage() {
echo 'Usage: ./runalltest.sh [--no-motr-rpm][--no-ut-run][--no-st-run][--no-ossperf-run][--no-https]
[--use-ipv6][--basic-s3cmd-rand | --basic-s3cmd-zero]'
echo ' [--help]'
echo 'Optional params as below:'
echo ' --no-motr-rpm : Use motr libs from source code (third_party/motr)'
echo ' Default is (false) i.e. use motr libs from pre-installed'
echo ' motr rpm location (/usr/lib64)'
echo ' --no-ut-run : Do not run UTs, Default (false)'
echo ' --no-st-run : Do not run STs, Default (false)'
echo ' --no-https : Use http for STs, Default (false)'
echo ' --use-ipv6 : Use ipv6 for STs, Default (false)'
echo ' --no-ossperf-run : Do not run parallel/sequential perf tests by ossperf tool, Default (false)'
echo ' --basic-s3cmd-rand: Run only basic s3cmd regression tests with random filled objects'
echo ' --basic-s3cmd-zero: Run only basic s3cmd regression tests with zero filled objects'
echo ' --help (-h) : Display help'
}
# read the options
OPTS=`getopt -o h --long no-motr-rpm,no-ut-run,no-st-run,no-https,use-ipv6,no-ossperf-run,basic-s3cmd-rand,basic-s3cmd-zero,help -n 'runalltest.sh' -- "$@"`
eval set -- "$OPTS"
no_motr_rpm=0
no_ut_run=0
no_st_run=0
use_http=0
no_ossperf_run=0
use_ipv6=0
basic_only_rand=0
basic_only_zero=0
cont_zero_param=""
# extract options and their arguments into variables.
while true; do
case "$1" in
--no-motr-rpm) no_motr_rpm=1; shift ;;
--no-ut-run) no_ut_run=1; shift ;;
--no-st-run) no_st_run=1; shift ;;
--no-https) use_http=1; shift ;;
--use-ipv6) use_ipv6=1; shift ;;
--no-ossperf-run) no_ossperf_run=1; shift ;;
--basic-s3cmd-rand) basic_only_rand=1; shift ;;
--basic-s3cmd-zero) basic_only_zero=1; cont_zero_param="--cont_zero"; shift ;;
-h|--help) usage; exit 0;;
--) shift; break ;;
*) echo "Internal error! $1" ; exit 1 ;;
esac
done
if [ $basic_only_zero -eq 1 ] && [ $basic_only_rand -eq 1 ]
then
echo "Only one basic s3cmd test configuration should be specified"
exit 1
fi
abort()
{
echo >&2 '
***************
*** ABORTED ***
***************
'
echo "Error encountered. Exiting test runs prematurely..." >&2
trap : 0
exit 1
}
trap 'abort' 0
if [ $no_motr_rpm -eq 1 ]
then
# use motr libs from source code
export LD_LIBRARY_PATH="$(pwd)/third_party/motr/motr/.libs/:"\
"$(pwd)/third_party/motr/helpers/.libs/:"\
"$(pwd)/third_party/motr/extra-libs/gf-complete/src/.libs/"
fi
WORKING_DIR=`pwd`
if [ $basic_only_zero -eq 1 ] || [ $basic_only_rand -eq 1 ]
then
CLITEST_SRC=`pwd`/st/clitests
cd $CLITEST_SRC
sh ./s3cmd_basic_reg_test.sh --config ./pathstyle.s3cfg $cont_zero_param
cd $WORKING_DIR
trap : 0
exit 0
fi
if [ $no_ut_run -eq 0 ]
then
UT_BIN=./bazel-bin/s3ut
UT_DEATHTESTS_BIN=./bazel-bin/s3utdeathtests
UT_MEMPOOL_BIN=./bazel-bin/s3mempoolut
UT_MEMPOOLMGR_BIN=./bazel-bin/s3mempoolmgrut
UT_S3BACKGROUNDDELETE=./s3backgrounddelete/scripts/run_all_ut.sh
UT_S3CONFSTORE=./s3cortxutils/s3confstore/scripts/run_all_ut.sh
printf "\nCheck s3ut..."
type $UT_BIN >/dev/null
printf "OK \n"
$UT_BIN 2>&1
printf "\nCheck s3mempoolmgrut..."
type $UT_MEMPOOLMGR_BIN >/dev/null
printf "OK \n"
$UT_MEMPOOLMGR_BIN 2>&1
printf "\nCheck s3utdeathtests..."
type $UT_DEATHTESTS_BIN >/dev/null
printf "OK \n"
$UT_DEATHTESTS_BIN 2>&1
printf "\nCheck s3mempoolut..."
type $UT_MEMPOOL_BIN >/dev/null
printf "OK \n"
$UT_MEMPOOL_BIN 2>&1
printf "\nCheck s3backgrounddeleteut..."
type $UT_S3BACKGROUNDDELETE >/dev/null
printf "OK \n"
$UT_S3BACKGROUNDDELETE 2>&1
printf "\nCheck s3confstoreut..."
type $UT_S3CONFSTORE >/dev/null
printf "OK \n"
$UT_S3CONFSTORE 2>&1
fi
if [ $no_st_run -eq 0 ]
then
use_ipv6_arg=""
if [ $use_ipv6 -eq 1 ]
then
use_ipv6_arg="--use_ipv6"
fi
CLITEST_SRC=`pwd`/st/clitests
cd $CLITEST_SRC
if [ $use_http -eq 1 ]
then
sh ./runallsystest.sh --no_https $use_ipv6_arg
else
sh ./runallsystest.sh $use_ipv6_arg
fi
fi
if [ $no_ossperf_run -eq 0 ]
then
PERF_SRC=$WORKING_DIR/perf
cd $PERF_SRC
if [ -d "testfiles" ]
then
rm -rf testfiles
fi
echo "ossperf tests..."
echo "Parallel worload of 5 files each of size 5000 bytes"
USE_HTTP_FLAG=""
if [ $use_http -eq 1 ] ; then
USE_HTTP_FLAG=" -x "
fi
ossperf.sh -n 5 -s 5000 -b seagatebucket -c ../st/clitests/virtualhoststyle.s3cfg -p $USE_HTTP_FLAG 2>&1
if [ $? -ne 0 ]; then
echo "ossperf -- parallel workload test succeeded"
fi
echo "Sequential workload of 5 files each of size 5000 bytes"
ossperf.sh -n 5 -s 5000 -b seagatebucket -c ../st/clitests/virtualhoststyle.s3cfg $USE_HTTP_FLAG 2>&1
if [ $? -ne 0 ]; then
echo "ossperf -- sequential workload test succeeded"
fi
# Parallel multipart workload
ossperf.sh -n 2 -s 18874368 -b seagatebucket -c ../st/clitests/virtualhoststyle.s3cfg -p $USE_HTTP_FLAG 2>&1
if [ $? -ne 0 ]; then
echo "ossperf -- parallel workload(Multipart) succeeded"
fi
# Sequential multipart workload
ossperf.sh -n 2 -s 18874368 -b seagatebucket -c ../st/clitests/virtualhoststyle.s3cfg $USE_HTTP_FLAG 2>&1
if [ $? -ne 0 ]; then
echo "ossperf -- sequential workload(Multipart) succeeded"
fi
echo "*************************************************"
echo "*** System tests with ossperf Runs Successful ***"
echo "*************************************************"
fi
cd $WORKING_DIR
trap : 0