blob: d9b841757f43e223c04b5bfc0dba346e1dce7d03 [file] [log] [blame]
Victor Morales89ce3212017-06-16 18:32:48 -05001#!/bin/bash
2
Victor Morales0f94b4a2017-09-01 18:42:40 -05003source /var/onap/functions
4
Victor Moralesf1f1ba52017-11-20 16:38:28 -08005testsuite_src_folder=$git_src_folder/testsuite
6testsuite_repos=("testsuite" "testsuite/heatbridge" "testsuite/properties" \
7"testsuite/python-testing-utils")
Victor Morales0f94b4a2017-09-01 18:42:40 -05008
9# _setup_ete_folder() - Create and copy ete folder structure
10function _setup_ete_folder {
Victor Morales89ce3212017-06-16 18:32:48 -050011 mkdir -p /opt/eteshare/config
12
Victor Moralesf1f1ba52017-11-20 16:38:28 -080013 cp $testsuite_src_folder/integration_* /opt/eteshare/config
14 cp $testsuite_src_folder/vm_config2robot.sh /opt/eteshare/config
15 cp $testsuite_src_folder/ete.sh /opt
16 cp $testsuite_src_folder/demo.sh /opt
Victor Morales89ce3212017-06-16 18:32:48 -050017
18 chmod +x /opt/ete.sh
19 chmod +x /opt/demo.sh
20}
21
Victor Morales0f94b4a2017-09-01 18:42:40 -050022# get_robot_images() - Pull or build the Robot Docker images
23function get_robot_images {
Victor Morales89ce3212017-06-16 18:32:48 -050024 pull_openecomp_image testsuite
Victor Morales0f94b4a2017-09-01 18:42:40 -050025}
26
27# install_robot() - Run Robot services
28function install_robot {
Victor Morales89ce3212017-06-16 18:32:48 -050029 docker rm -f openecompete_container
30 docker run -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version
31}
32
33# init_robot() - Function that initialize Robot services
34function init_robot {
Victor Morales0f94b4a2017-09-01 18:42:40 -050035 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080036 clone_repos "testsuite"
Victor Morales0f94b4a2017-09-01 18:42:40 -050037 _setup_ete_folder
38 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080039 compile_repos "testsuite"
Victor Morales0f94b4a2017-09-01 18:42:40 -050040 fi
41 fi
Victor Morales6a919972017-09-28 18:29:54 -070042
43 if [[ "$skip_get_images" == "False" ]]; then
44 get_robot_images
45 if [[ "$skip_install" == "False" ]]; then
46 install_robot
47 fi
48 fi
Victor Morales89ce3212017-06-16 18:32:48 -050049}