waynedunican | e4ff7e5 | 2023-03-01 09:07:31 +0000 | [diff] [blame] | 1 | #!/bin/bash |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 2 | # |
| 3 | # Copyright 2016-2017 Huawei Technologies Co., Ltd. |
| 4 | # Modification Copyright 2019 © Samsung Electronics Co., Ltd. |
| 5 | # Modification Copyright 2021 © AT&T Intellectual Property. |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 6 | # Modification Copyright 2021-2024 Nordix Foundation. |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 20 | |
| 21 | function docker_stats(){ |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame] | 22 | # General memory details |
| 23 | if [ "$(uname -s)" == "Darwin" ] |
| 24 | then |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame] | 25 | sh -c "top -l1 | head -10" |
| 26 | echo |
| 27 | else |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame] | 28 | sh -c "top -bn1 | head -3" |
| 29 | echo |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 30 | |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame] | 31 | sh -c "free -h" |
| 32 | echo |
| 33 | fi |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 34 | |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame] | 35 | # Memory details per Docker |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 36 | docker ps --format "table {{ .Image }}\t{{ .Names }}\t{{ .Status }}" |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 37 | echo |
| 38 | |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 39 | docker stats --no-stream |
| 40 | echo |
| 41 | } |
| 42 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 43 | function setup_clamp() { |
rameshiyer27 | 3397d84 | 2024-08-18 11:12:23 +0100 | [diff] [blame] | 44 | export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 45 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh policy-clamp-runtime-acm --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 46 | sleep 30 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 47 | bash ${SCRIPTS}/wait_for_rest.sh localhost "${ACM_PORT}" |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 48 | } |
| 49 | |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 50 | function setup_clamp_replica() { |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 51 | export ACM_REPLICA_TEARDOWN=true |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 52 | export ROBOT_FILES="policy-clamp-test.robot" |
| 53 | export TEST_ENV="docker" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 54 | export PROJECT=clamp |
| 55 | source ${DOCKER_COMPOSE_DIR}/start-acm-replica.sh --start --replicas=2 |
| 56 | echo "Waiting a minute for the replicas to be started..." |
| 57 | sleep 60 |
| 58 | # checking on apex-pdp status because acm-r replicas only start after apex-pdp is running |
| 59 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${APEX_PORT} |
| 60 | apex_healthcheck |
| 61 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${ACM_PORT} |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 62 | } |
| 63 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 64 | function setup_api() { |
| 65 | export ROBOT_FILES="api-test.robot api-slas.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 66 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh api --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 67 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 68 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${API_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 69 | } |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 70 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 71 | function setup_pap() { |
| 72 | export ROBOT_FILES="pap-test.robot pap-slas.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 73 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh apex-pdp --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 74 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 75 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${PAP_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | function setup_apex() { |
| 79 | export ROBOT_FILES="apex-pdp-test.robot apex-slas.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 80 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh apex-pdp --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 81 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 82 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${PAP_PORT} |
| 83 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${APEX_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 84 | apex_healthcheck |
| 85 | } |
| 86 | |
| 87 | function setup_apex_medium() { |
| 88 | export SUITES="apex-slas-3.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 89 | export APEX_REPLICA_TEARDOWN=true |
| 90 | source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --start --replicas=3 |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 91 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 92 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${PAP_PORT} |
| 93 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${APEX_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 94 | apex_healthcheck |
| 95 | } |
| 96 | |
| 97 | function setup_apex_large() { |
| 98 | export ROBOT_FILES="apex-slas-10.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 99 | export APEX_REPLICA_TEARDOWN=true |
| 100 | source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --start --replicas=10 |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 101 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 102 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${PAP_PORT} |
| 103 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${APEX_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 104 | apex_healthcheck |
| 105 | } |
| 106 | |
| 107 | function apex_healthcheck() { |
| 108 | sleep 20 |
| 109 | |
| 110 | healthy=false |
| 111 | |
| 112 | while [ $healthy = false ] |
| 113 | do |
| 114 | msg=`curl -s -k --user 'policyadmin:zb!XztG34' http://localhost:${APEX_PORT}/policy/apex-pdp/v1/healthcheck` |
| 115 | echo "${msg}" | grep -q true |
| 116 | if [ "${?}" -eq 0 ] |
| 117 | then |
| 118 | healthy=true |
| 119 | break |
| 120 | fi |
| 121 | sleep 10s |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 122 | done |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 123 | } |
| 124 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 125 | function setup_drools_apps() { |
rameshiyer27 | 630801c | 2024-10-01 15:19:25 +0100 | [diff] [blame] | 126 | export ROBOT_FILES="drools-applications-test.robot drools-applications-slas.robot" |
| 127 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh drools-applications --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 128 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 129 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${PAP_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 130 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 131 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${DROOLS_APPS_PORT} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 132 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 133 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${DROOLS_APPS_TELEMETRY_PORT} |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 134 | } |
| 135 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 136 | function setup_xacml_pdp() { |
rameshiyer27 | 630801c | 2024-10-01 15:19:25 +0100 | [diff] [blame] | 137 | export ROBOT_FILES="xacml-pdp-test.robot xacml-pdp-slas.robot" |
| 138 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh xacml-pdp --grafana |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 139 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 140 | bash ${SCRIPTS}/wait_for_rest.sh localhost "${XACML_PORT}" |
adheli.tavares | daecbb9 | 2024-07-19 13:50:04 +0100 | [diff] [blame] | 141 | } |
| 142 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 143 | function setup_drools_pdp() { |
| 144 | export ROBOT_FILES="drools-pdp-test.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 145 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh drools-pdp |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 146 | sleep 30 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 147 | bash ${SCRIPTS}/wait_for_rest.sh localhost ${DROOLS_TELEMETRY_PORT} |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 148 | } |
| 149 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 150 | function setup_distribution() { |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 151 | zip -F ${CSAR_DIR}/sample_csar_with_apex_policy.csar --out ${CSAR_DIR}/csar_temp.csar -q |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 152 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 153 | # Remake temp directory |
| 154 | sudo rm -rf /tmp/distribution |
| 155 | sudo mkdir /tmp/distribution |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 156 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 157 | export ROBOT_FILES="distribution-test.robot" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 158 | source ${DOCKER_COMPOSE_DIR}/start-compose.sh distribution |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 159 | sleep 10 |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 160 | bash ${SCRIPTS}/wait_for_rest.sh localhost "${DIST_PORT}" |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 161 | } |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 162 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 163 | function build_robot_image() { |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 164 | bash ${SCRIPTS}/build-csit-docker-image.sh |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 165 | cd ${WORKSPACE} |
| 166 | } |
| 167 | |
| 168 | function run_robot() { |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 169 | docker compose -f ${DOCKER_COMPOSE_DIR}/compose.yaml up csit-tests |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 170 | export RC=$? |
| 171 | } |
| 172 | |
| 173 | function set_project_config() { |
| 174 | echo "Setting project configuration for: $PROJECT" |
| 175 | case $PROJECT in |
| 176 | |
| 177 | clamp | policy-clamp) |
| 178 | setup_clamp |
| 179 | ;; |
| 180 | |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 181 | clamp-replica | policy-clamp-replica) |
| 182 | setup_clamp_replica |
| 183 | ;; |
| 184 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 185 | api | policy-api) |
| 186 | setup_api |
| 187 | ;; |
| 188 | |
| 189 | pap | policy-pap) |
| 190 | setup_pap |
| 191 | ;; |
| 192 | |
| 193 | apex-pdp | policy-apex-pdp) |
| 194 | setup_apex |
| 195 | ;; |
| 196 | |
| 197 | apex-pdp-postgres | policy-apex-pdp-postgres) |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 198 | setup_apex |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 199 | ;; |
| 200 | |
| 201 | apex-pdp-medium | policy-apex-pdp-medium) |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 202 | setup_apex_medium |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 203 | ;; |
| 204 | |
| 205 | apex-pdp-large | policy-apex-pdp-large) |
rameshiyer27 | f851a5e | 2024-07-02 09:16:56 +0000 | [diff] [blame] | 206 | setup_apex_large |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 207 | ;; |
| 208 | |
| 209 | xacml-pdp | policy-xacml-pdp) |
| 210 | setup_xacml_pdp |
| 211 | ;; |
| 212 | |
| 213 | drools-pdp | policy-drools-pdp) |
| 214 | setup_drools_pdp |
| 215 | ;; |
| 216 | |
| 217 | drools-applications | policy-drools-applications | drools-apps | policy-drools-apps) |
| 218 | setup_drools_apps |
| 219 | ;; |
| 220 | |
| 221 | distribution | policy-distribution) |
| 222 | setup_distribution |
| 223 | ;; |
| 224 | |
| 225 | *) |
| 226 | echo "Unknown project supplied. No test will run." |
| 227 | exit 1 |
| 228 | ;; |
| 229 | esac |
| 230 | } |
| 231 | |
| 232 | # even with forced finish, clean up docker containers |
| 233 | function on_exit(){ |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 234 | rm -rf ${CSAR_DIR}/csar_temp.csar |
| 235 | |
| 236 | # teardown of compose containers for acm-replicas doesn't work with normal stop-compose script |
| 237 | if [ "${ACM_REPLICA_TEARDOWN}" = true ]; then |
| 238 | source ${DOCKER_COMPOSE_DIR}/start-acm-replica.sh --stop --replicas=2 |
| 239 | elif [ "${APEX_REPLICA_TEARDOWN}" = true ]; then |
| 240 | source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --stop --replicas=2 |
| 241 | else |
| 242 | source ${DOCKER_COMPOSE_DIR}/stop-compose.sh ${PROJECT} |
| 243 | fi |
| 244 | |
| 245 | mv ${DOCKER_COMPOSE_DIR}/*.log ${ROBOT_LOG_DIR} |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 246 | exit $RC |
| 247 | } |
| 248 | |
| 249 | # ensure that teardown and other finalizing steps are always executed |
| 250 | trap on_exit EXIT |
| 251 | |
| 252 | # setup all directories used for test resources |
Jim Hahn | 3486a92 | 2021-05-10 15:36:30 -0400 | [diff] [blame] | 253 | if [ -z "${WORKSPACE}" ]; then |
adheli.tavares | 1f339f8 | 2023-02-17 15:14:07 +0000 | [diff] [blame] | 254 | WORKSPACE=$(git rev-parse --show-toplevel) |
| 255 | export WORKSPACE |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 256 | fi |
| 257 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 258 | export GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' "${WORKSPACE}"/.gitreview) |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 259 | export PROJECT="${1}" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 260 | export ROBOT_LOG_DIR="${WORKSPACE}/csit/archives/${PROJECT}" |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 261 | export SCRIPTS="${WORKSPACE}/csit/resources/scripts" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 262 | export CSAR_DIR="${WORKSPACE}/csit/resources/tests/data/csar" |
| 263 | export DOCKER_COMPOSE_DIR="${WORKSPACE}/compose" |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 264 | export ROBOT_FILES="" |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 265 | export ACM_REPLICA_TEARDOWN=false |
| 266 | export APEX_REPLICA_TEARDOWN=false |
Jim Hahn | 3486a92 | 2021-05-10 15:36:30 -0400 | [diff] [blame] | 267 | |
adheli.tavares | 1f339f8 | 2023-02-17 15:14:07 +0000 | [diff] [blame] | 268 | cd "${WORKSPACE}" |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 269 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 270 | # recreate the log folder with test results |
| 271 | sudo rm -rf ${ROBOT_LOG_DIR} |
| 272 | mkdir -p ${ROBOT_LOG_DIR} |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 273 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 274 | # log into nexus docker |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 275 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 276 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 277 | # based on $PROJECT var, setup robot test files and docker compose execution |
| 278 | compose_version=$(docker compose version) |
| 279 | |
| 280 | if [[ $compose_version == *"Docker Compose version"* ]]; then |
| 281 | echo $compose_version |
| 282 | else |
| 283 | echo "Docker Compose Plugin not installed. Installing now..." |
| 284 | sudo mkdir -p /usr/local/lib/docker/cli-plugins |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 285 | sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 286 | sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 287 | fi |
| 288 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 289 | set_project_config |
| 290 | |
| 291 | unset http_proxy https_proxy |
| 292 | |
| 293 | export ROBOT_FILES |
| 294 | |
adheli.tavares | f11e6d9 | 2024-08-01 14:18:34 +0100 | [diff] [blame] | 295 | # use a separate script to build a CSIT docker image, to isolate the test run |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 296 | if [ "${2}" == "--skip-build-csit" ]; then |
| 297 | echo "Skipping build csit robot image" |
| 298 | else |
| 299 | build_robot_image |
| 300 | fi |
| 301 | |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 302 | docker_stats | tee "${ROBOT_LOG_DIR}/_sysinfo-1-after-setup.txt" |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 303 | |
adheli.tavares | 80e382e | 2024-05-01 14:08:35 +0100 | [diff] [blame] | 304 | # start the CSIT container and run the tests |
| 305 | run_robot |
Taka Cho | 6d188af | 2021-01-11 16:48:33 -0500 | [diff] [blame] | 306 | |
adheli.tavares | d802fd9 | 2024-08-15 12:39:19 +0100 | [diff] [blame] | 307 | docker ps --format "table {{ .Image }}\t{{ .Names }}\t{{ .Status }}" |