Merge "Part 1: Refactor CPS Delta code to utility class"
[cps.git] / csit / plans / cps / setup.sh
1 #!/bin/bash
2 #
3 # Copyright 2016-2017 Huawei Technologies Co., Ltd.
4 # Modifications copyright (c) 2017 AT&T Intellectual Property
5 # Modifications copyright (c) 2020-2021 Samsung Electronics Co., Ltd.
6 # Modifications Copyright (C) 2021 Pantheon.tech
7 # Modifications Copyright (C) 2021 Bell Canada.
8 # Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
9 #
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13 #
14 #     http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 #
22 # Branched from ccsdk/distribution to this repository Feb 23, 2021
23 #
24
25 ###################### setup env ############################
26 # Set env variables for docker compose
27 export LOCAL_IP=localhost
28
29 source $WORKSPACE/plans/cps/test.properties
30 export $(cut -d= -f1 $WORKSPACE/plans/cps/test.properties)
31
32 ###################### setup cps-and-ncmp with dmi-services ############################
33 cd $CPS_HOME/docker-compose
34
35 # Start default docker-compose and dmi-services, and wait for all containers to be healthy.
36 # Note: Since -f flag is used for dmi-services.yml, default docker-compose file should also be binded with -f flag,
37 # otherwise cps base services won't be running!
38 docker-compose -f docker-compose.yml -f dmi-services.yml up -d --quiet-pull --wait || exit 1
39
40 ###################### ROBOT Configurations ##########################
41 # Pass variables required for Robot test suites in ROBOT_VARIABLES.
42 ROBOT_VARIABLES="\
43 -v CPS_CORE_HOST:$CPS_CORE_HOST \
44 -v CPS_CORE_PORT:$CPS_CORE_PORT \
45 -v DMI_HOST:$DMI_HOST \
46 -v DMI_PORT:$DMI_PORT \
47 -v DMI_CSIT_STUB_HOST:$DMI_DEMO_STUB_HOST \
48 -v DMI_CSIT_STUB_PORT:$DMI_DEMO_STUB_PORT \
49 -v DATADIR_CPS_CORE:$WORKSPACE/data/cps-core \
50 -v DATADIR_NCMP:$WORKSPACE/data/ncmp \
51 -v DATADIR_SUBS_NOTIFICATION:$WORKSPACE/data/subscription-notification"