Add SLA Validations for Apex-PDP
[policy/docker.git] / csit / resources / scripts / setup-apex-pdp-large.sh
1 #!/bin/bash
2 #
3 # ===========LICENSE_START====================================================
4 #  Copyright (C) 2023 Nordix Foundation.
5 # ============================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=====================================================
18 #
19
20 export PROJECT="apex-pdp"
21 source "${SCRIPTS}"/node-templates.sh
22
23 source "${WORKSPACE}"/compose/start-multiple-pdp.sh 10
24
25 sleep 10
26 unset http_proxy https_proxy
27
28 # wait for the app to start up
29 bash "${SCRIPTS}"/wait_for_rest.sh localhost ${PAP_PORT}
30 bash "${SCRIPTS}"/wait_for_rest.sh localhost ${APEX_PORT}
31
32 sleep 20
33
34 healthy=false
35
36 while [ $healthy = false ]
37 do
38     msg=`curl -s -k --user 'policyadmin:zb!XztG34' http://localhost:${APEX_PORT}/policy/apex-pdp/v1/healthcheck`
39     echo "${msg}" | grep -q true
40     if [ "${?}" -eq 0 ]
41     then
42         healthy=true
43         break
44     fi
45     sleep 10s
46 done
47
48 export DMAAP_IP="localhost:${DMAAP_PORT}"
49 export SUITES="apex-slas-10.robot"
50
51 ROBOT_VARIABLES="-v POLICY_PAP_IP:localhost:${PAP_PORT} -v POLICY_API_IP:localhost:${API_PORT}
52 -v PROMETHEUS_IP:localhost:${PROMETHEUS_PORT} -v DATA:${DATA} -v NODETEMPLATES:${NODETEMPLATES}
53 -v APEX_IP:localhost:${APEX_PORT} -v DMAAP_IP:${DMAAP_IP}
54 -v APEX_EVENTS_IP:localhost:${APEX_PORT}"