summaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/robot
blob: 588da6c1e045671e7294c7be912d1467ea024bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

source /var/onap/functions

robot_src_folder=$git_src_folder/testsuite
robot_repos=("testsuite" "testsuite/heatbridge" "testsuite/properties" \
"testsuite/python-testing-utils")

# _setup_ete_folder() - Create and copy ete folder structure
function _setup_ete_folder {
    mkdir -p /opt/eteshare/config

    cp $robot_src_folder/integration_* /opt/eteshare/config
    cp $robot_src_folder/vm_config2robot.sh /opt/eteshare/config
    cp $robot_src_folder/ete.sh /opt
    cp $robot_src_folder/demo.sh /opt

    chmod +x /opt/ete.sh
    chmod +x /opt/demo.sh
}

# get_robot_images() - Pull or build the Robot Docker images
function get_robot_images {
    pull_openecomp_image testsuite
}

# install_robot() - Run Robot services
function install_robot {
    docker rm -f openecompete_container
    run_docker_image -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version
}

# init_robot() - Function that initialize Robot services
function init_robot {
    if [[ "$clone_repo" == "True" ]]; then
        clone_repos "robot" "testsuite"
        _setup_ete_folder
        if [[ "$compile_repo" == "True" ]]; then
            compile_repos "robot"
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_robot_images
        if [[ "$skip_install" == "False" ]]; then
            install_robot
        fi
    fi
}