@@ -32,214 +32,207 @@ supported_builds="full"
32
32
# Supported tests
33
33
supported_tests=" external_custom camel criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring zookeeper"
34
34
35
- function check_version() {
36
- version=$1
37
-
38
- for current_version in ${supported_versions}
39
- do
40
- if [[ " ${version} " == " ${current_version} " ]]; then
41
- return 1
42
- fi
43
- done
44
-
45
- return 0
46
- }
47
-
48
35
# Set a valid version
49
36
function set_version() {
50
- version=$1
51
-
52
- if (check_version ${version} ); then
53
- echo " ERROR: Invalid Version: ${version} "
54
- echo " Usage: $0 [${supported_versions} ]"
55
- exit 1
56
- fi
37
+ version=$1
38
+ for current_version in ${supported_versions}
39
+ do
40
+ if [[ " ${version} " == " ${current_version} " ]]; then
41
+ # Valid version found, you can perform additional actions if needed
42
+ echo " Setting version to: ${version} "
43
+ return
44
+ fi
45
+ done
46
+ # If no valid version is found, display an error message
47
+ echo " ERROR: Invalid Version: ${version} "
48
+ echo " Usage: $0 [${supported_versions} ]"
49
+ exit 1
57
50
}
58
51
59
52
function check_os() {
60
- os=$1
53
+ os=$1
61
54
62
- for current_os in ${supported_os}
63
- do
64
- if [[ " ${os} " == " ${current_os} " ]]; then
65
- return 1
66
- fi
67
- done
55
+ for current_os in ${supported_os}
56
+ do
57
+ if [[ " ${os} " == " ${current_os} " ]]; then
58
+ return 1
59
+ fi
60
+ done
68
61
69
- return 0
62
+ return 0
70
63
}
71
64
72
65
# Set a valid os
73
66
function set_os() {
74
- os=$1
75
- if (check_os ${os} ); then
76
- echo " ERROR: Invalid OS: ${os} "
77
- echo " Usage: $0 [${supported_os} ]"
78
- exit 1
79
- fi
67
+ os=$1
68
+ if (check_os ${os} ); then
69
+ echo " ERROR: Invalid OS: ${os} "
70
+ echo " Usage: $0 [${supported_os} ]"
71
+ exit 1
72
+ fi
80
73
}
81
74
82
75
function check_test() {
83
- test=$1
76
+ test=$1
84
77
85
- for current_test in ${supported_tests}
86
- do
87
- if [[ " ${test} " == " ${current_test} " ]]; then
88
- return 1
89
- fi
90
- done
78
+ for current_test in ${supported_tests}
79
+ do
80
+ if [[ " ${test} " == " ${current_test} " ]]; then
81
+ return 1
82
+ fi
83
+ done
91
84
92
- return 0
85
+ return 0
93
86
}
94
87
95
88
# Set a valid test
96
89
function set_test() {
97
- test=$1
98
- if (check_test ${test} ); then
99
- echo " ERROR: Invalid Test: ${test} "
100
- echo " Usage: $0 [${supported_tests} ]"
101
- exit 1
102
- fi
90
+ test=$1
91
+ if (check_test ${test} ); then
92
+ echo " ERROR: Invalid Test: ${test} "
93
+ echo " Usage: $0 [${supported_tests} ]"
94
+ exit 1
95
+ fi
103
96
}
104
97
105
98
function check_vm() {
106
- vm=$1
99
+ vm=$1
107
100
108
- for current_vm in ${supported_jvms}
109
- do
110
- if [[ " ${vm} " == " ${current_vm} " ]]; then
111
- return 1
112
- fi
113
- done
101
+ for current_vm in ${supported_jvms}
102
+ do
103
+ if [[ " ${vm} " == " ${current_vm} " ]]; then
104
+ return 1
105
+ fi
106
+ done
114
107
115
- return 0
108
+ return 0
116
109
}
117
110
118
111
# Set a valid vm
119
112
function set_vm() {
120
- vm=$1
121
- if (check_vm ${vm} ); then
122
- echo " ERROR: Invalid VM: ${vm} "
123
- echo " Usage: $0 [${supported_jvms} ]"
124
- exit 1
125
- fi
113
+ vm=$1
114
+ if (check_vm ${vm} ); then
115
+ echo " ERROR: Invalid VM: ${vm} "
116
+ echo " Usage: $0 [${supported_jvms} ]"
117
+ exit 1
118
+ fi
126
119
}
127
120
128
121
function check_package() {
129
- package=$1
122
+ package=$1
130
123
131
- for current_package in ${supported_packages}
132
- do
133
- if [[ " ${package} " == " ${current_package} " ]]; then
134
- return 1
135
- fi
136
- done
124
+ for current_package in ${supported_packages}
125
+ do
126
+ if [[ " ${package} " == " ${current_package} " ]]; then
127
+ return 1
128
+ fi
129
+ done
137
130
138
- return 0
131
+ return 0
139
132
}
140
133
141
134
# Set a valid package
142
135
function set_package() {
143
- package=$1
144
- if (check_package ${package} ); then
145
- echo " ERROR: Invalid Package: ${package} "
146
- echo " Usage: $0 [${supported_packages} ]"
147
- exit 1
148
- fi
136
+ package=$1
137
+ if (check_package ${package} ); then
138
+ echo " ERROR: Invalid Package: ${package} "
139
+ echo " Usage: $0 [${supported_packages} ]"
140
+ exit 1
141
+ fi
149
142
}
150
143
151
144
function check_build() {
152
- build=$1
145
+ build=$1
153
146
154
- for current_build in ${supported_builds}
155
- do
156
- if [[ " ${build} " == " ${current_build} " ]]; then
157
- return 1
158
- fi
159
- done
147
+ for current_build in ${supported_builds}
148
+ do
149
+ if [[ " ${build} " == " ${current_build} " ]]; then
150
+ return 1
151
+ fi
152
+ done
160
153
161
- return 0
154
+ return 0
162
155
}
163
156
164
157
# Set a valid build
165
158
function set_build() {
166
- build=$1
167
- if (check_build ${build} ); then
168
- echo " ERROR: Invalid Build: ${build} "
169
- echo " Usage: $0 [${supported_builds} ]"
170
- exit 1
171
- fi
159
+ build=$1
160
+ if (check_build ${build} ); then
161
+ echo " ERROR: Invalid Build: ${build} "
162
+ echo " Usage: $0 [${supported_builds} ]"
163
+ exit 1
164
+ fi
172
165
}
173
166
174
167
# Set a platform
175
168
function set_platform() {
176
- # TO-DO: Add supported_platforms when portable tests support more platforms
177
- platform=$1
169
+ # TO-DO: Add supported_platforms when portable tests support more platforms
170
+ platform=$1
178
171
}
179
172
180
173
# Set base_docker_registry_url
181
174
function set_base_docker_registry_url() {
182
- base_docker_registry_url=" $1 "
175
+ base_docker_registry_url=" $1 "
183
176
}
184
177
185
178
# Set base_docker_registry_dir
186
179
function set_base_docker_registry_dir() {
187
- base_docker_registry_dir=" $1 "
180
+ base_docker_registry_dir=" $1 "
188
181
}
189
182
190
183
# Reading properties of test.properties file
191
184
function getProperty() {
192
- PROP_KEY=$1
193
- PROP_VALUE=` cat $PROPERTY_FILE | grep " $PROP_KEY " | cut -d' =' -f 2-`
194
- echo ` sed -e ' s/^"//' -e ' s/"$//' <<< " $PROP_VALUE" `
185
+ PROP_KEY=$1
186
+ PROP_VALUE=` cat $PROPERTY_FILE | grep " $PROP_KEY " | cut -d' =' -f 2-`
187
+ echo ` sed -e ' s/^"//' -e ' s/"$//' <<< " $PROP_VALUE" `
195
188
}
196
189
197
190
# Used for external_custom tests
198
191
function set_external_custom_test_info(){
199
- test=$1
200
- check_external_custom_test=$2
201
- github_url=" ${EXTERNAL_CUSTOM_REPO} "
202
- test_command=" ${EXTERNAL_TEST_CMD} "
203
- test_results=" testResults"
204
- tag_version=" ${EXTERNAL_REPO_BRANCH} "
205
- environment_variable=" MODE=java"
206
- ubuntu_packages=" git"
207
- maven_version=" 3.8.5"
192
+ test=$1
193
+ check_external_custom_test=$2
194
+ github_url=" ${EXTERNAL_CUSTOM_REPO} "
195
+ test_command=" ${EXTERNAL_TEST_CMD} "
196
+ test_results=" testResults"
197
+ tag_version=" ${EXTERNAL_REPO_BRANCH} "
198
+ environment_variable=" MODE=java"
199
+ ubuntu_packages=" git"
200
+ maven_version=" 3.8.5"
208
201
}
209
202
210
203
# Set the valid OSes for the current architectures.
211
204
function set_test_info() {
212
- test=$1
213
- check_external_custom_test=$2
214
- cd ../
215
- path_to_file=$( pwd)
216
- echo ${path_to_file}
217
- PROPERTY_FILE=${path_to_file} /${test} /test.properties
218
- github_url=$( getProperty " github_url" )
219
- test_options=$( getProperty " test_options" )
220
- test_results=$( getProperty " test_results" )
221
- ant_version=$( getProperty " ant_version" )
222
- ant_contrib_version=$( getProperty " ant_contrib_version" )
223
- ivy_version=$( getProperty " ivy_version" )
224
- jdk_install=$( getProperty " jdk_install" )
225
- tag_version=$( getProperty " tag_version" )
226
- gradle_version=$( getProperty " gradle_version" )
227
- sbt_version=$( getProperty " sbt_version" )
228
- bazel_version=$( getProperty " bazel_version" )
229
- openssl_version=$( getProperty " openssl_version" )
230
- python_version=$( getProperty " python_version" )
231
- criu_version=$( getProperty " criu_version" )
232
- maven_version=$( getProperty " maven_version" )
233
- environment_variable=$( getProperty " environment_variable" )
234
- localPropertyFile=$( getProperty " localPropertyFile" )
235
- ubuntu_packages=$( getProperty " ubuntu_packages" )
236
- ubi_packages=$( getProperty " ubi_packages" )
205
+ test=$1
206
+ check_external_custom_test=$2
207
+ cd ../
208
+ path_to_file=$( pwd)
209
+ echo ${path_to_file}
210
+ PROPERTY_FILE=${path_to_file} /${test} /test.properties
211
+ github_url=$( getProperty " github_url" )
212
+ test_options=$( getProperty " test_options" )
213
+ test_results=$( getProperty " test_results" )
214
+ ant_version=$( getProperty " ant_version" )
215
+ ant_contrib_version=$( getProperty " ant_contrib_version" )
216
+ ivy_version=$( getProperty " ivy_version" )
217
+ jdk_install=$( getProperty " jdk_install" )
218
+ tag_version=$( getProperty " tag_version" )
219
+ gradle_version=$( getProperty " gradle_version" )
220
+ sbt_version=$( getProperty " sbt_version" )
221
+ bazel_version=$( getProperty " bazel_version" )
222
+ openssl_version=$( getProperty " openssl_version" )
223
+ python_version=$( getProperty " python_version" )
224
+ criu_version=$( getProperty " criu_version" )
225
+ maven_version=$( getProperty " maven_version" )
226
+ environment_variable=$( getProperty " environment_variable" )
227
+ localPropertyFile=$( getProperty " localPropertyFile" )
228
+ ubuntu_packages=$( getProperty " ubuntu_packages" )
229
+ ubi_packages=$( getProperty " ubi_packages" )
237
230
}
238
231
239
232
function cleanup_images() {
240
- # Delete any old containers that have exited.
241
- docker rm $( docker ps -a | grep " Exited" | awk ' { print $1 }' ) 2> /dev/null
233
+ # Delete any old containers that have exited.
234
+ docker rm $( docker ps -a | grep " Exited" | awk ' { print $1 }' ) 2> /dev/null
242
235
243
- # Delete any old images for our target_repo on localhost.
244
- docker rmi -f $( docker images | grep -e " adoptopenjdk" | awk ' { print $3 }' | sort | uniq) 2> /dev/null
236
+ # Delete any old images for our target_repo on localhost.
237
+ docker rmi -f $( docker images | grep -e " adoptopenjdk" | awk ' { print $3 }' | sort | uniq) 2> /dev/null
245
238
}
0 commit comments