Merge "Fix robot failures in kubernetes CSITs"
[policy/docker.git] / helm / run-test.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 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END======================================================
20
21
22 ROBOT_FILE=$1
23 echo "Invoking the robot tests from: $1"
24
25 export DATA=/opt/robotworkspace/models/models-examples/src/main/resources/policies
26 export NODETEMPLATES=/opt/robotworkspace/models/models-examples/src/main/resources/nodetemplates
27 export POLICY_RUNTIME_ACM_IP=policy-clamp-runtime-acm
28 export POLICY_API_IP=policy-api
29 export POLICY_PAP_IP=policy-pap
30 export APEX_IP=policy-apex-pdp
31 export DMAAP_IP=message-router
32
33
34 export ROBOT_VARIABLES=
35 ROBOT_VARIABLES="-v DATA:$DATA -v NODETEMPLATES:$NODETEMPLATES -v POLICY_RUNTIME_ACM_IP:$POLICY_RUNTIME_ACM_IP -v POLICY_API_IP:$POLICY_API_IP
36 -v POLICY_PAP_IP:$POLICY_PAP_IP -v APEX_IP:$APEX_IP -v DMAAP_IP:$DMAAP_IP"
37
38 echo "Run Robot test"
39 echo ROBOT_VARIABLES="${ROBOT_VARIABLES}"
40 echo "Starting Robot test suites ..."
41 python3 -m robot.run $ROBOT_VARIABLES $1
42 RESULT=$?
43 echo "RESULT: ${RESULT}"