From 5d21f64981e69f6a266da1ec30754de5d8d71e26 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Thu, 7 Dec 2017 11:54:59 -0800 Subject: Fix Robot UTs The way to clone robot source code repos was depending on the name of the project, but given that robot repos name has different name it was required to handle this exception. This change include Change-Id: If0f4b1cd7866944166b1e81ed417176049251370 Signed-off-by: Victor Morales Issue-ID: INT-19 --- bootstrap/vagrant-onap/Vagrantfile | 2 +- bootstrap/vagrant-onap/lib/functions | 5 +++-- bootstrap/vagrant-onap/lib/robot | 16 ++++++++-------- bootstrap/vagrant-onap/tests/test_msb | 4 ++-- bootstrap/vagrant-onap/tests/test_robot | 24 ++++++++++++------------ 5 files changed, 26 insertions(+), 25 deletions(-) (limited to 'bootstrap/vagrant-onap') diff --git a/bootstrap/vagrant-onap/Vagrantfile b/bootstrap/vagrant-onap/Vagrantfile index 68c6363bd..753e3565b 100644 --- a/bootstrap/vagrant-onap/Vagrantfile +++ b/bootstrap/vagrant-onap/Vagrantfile @@ -13,7 +13,7 @@ configuration = { 'nexus_password' => 'docker', 'dmaap_topic' => 'AUTO', 'artifacts_version' => '1.0.0', - 'docker_version' => '1.0-STAGING-latest', + 'docker_version' => 'latest', # Parameters for DCAE instantiation 'dcae_zone' => 'iad4', 'dcae_state' => 'vi', diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions index 907805e97..8d906dc68 100755 --- a/bootstrap/vagrant-onap/lib/functions +++ b/bootstrap/vagrant-onap/lib/functions @@ -70,13 +70,14 @@ function clone_repo { # clone_repos() - Function that clones source repositories for a given project function clone_repos { local project=$1 + local repo_name=${2:-$project} local name=${project}_repos[@] local src_name=${project}_src_folder local repos_list=("${!name}") - local dest_folder=${3:-${!src_name}} + local dest_folder=${!src_name} for repo in ${repos_list[@]}; do - clone_repo $repo $dest_folder${repo#*$project} + clone_repo $repo $dest_folder${repo#*$repo_name} done } diff --git a/bootstrap/vagrant-onap/lib/robot b/bootstrap/vagrant-onap/lib/robot index 374a2563c..588da6c1e 100755 --- a/bootstrap/vagrant-onap/lib/robot +++ b/bootstrap/vagrant-onap/lib/robot @@ -2,18 +2,18 @@ source /var/onap/functions -testsuite_src_folder=$git_src_folder/testsuite -testsuite_repos=("testsuite" "testsuite/heatbridge" "testsuite/properties" \ +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 $testsuite_src_folder/integration_* /opt/eteshare/config - cp $testsuite_src_folder/vm_config2robot.sh /opt/eteshare/config - cp $testsuite_src_folder/ete.sh /opt - cp $testsuite_src_folder/demo.sh /opt + 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 @@ -33,10 +33,10 @@ function install_robot { # init_robot() - Function that initialize Robot services function init_robot { if [[ "$clone_repo" == "True" ]]; then - clone_repos "testsuite" + clone_repos "robot" "testsuite" _setup_ete_folder if [[ "$compile_repo" == "True" ]]; then - compile_repos "testsuite" + compile_repos "robot" fi fi diff --git a/bootstrap/vagrant-onap/tests/test_msb b/bootstrap/vagrant-onap/tests/test_msb index d8784ce7b..e8bb24606 100755 --- a/bootstrap/vagrant-onap/tests/test_msb +++ b/bootstrap/vagrant-onap/tests/test_msb @@ -36,7 +36,7 @@ function test_get_msb_images { get_msb_images for image in base apigateway discovery; do - asserts_image nexus3.onap.org:10001/onap/msb/msb_$image + asserts_image $nexus_docker_repo/onap/msb/msb_$image done } @@ -47,7 +47,7 @@ function test_install_msb { install_msb for image in apigateway discovery; do - asserts_image_running nexus3.onap.org:10001/onap/msb/msb_$image + asserts_image_running $nexus_docker_repo/onap/msb/msb_$image done asserts_http_status_code "http://127.0.0.1:10081/api/microservices/v1/services" diff --git a/bootstrap/vagrant-onap/tests/test_robot b/bootstrap/vagrant-onap/tests/test_robot index 87ee100c1..dcaf7b286 100755 --- a/bootstrap/vagrant-onap/tests/test_robot +++ b/bootstrap/vagrant-onap/tests/test_robot @@ -9,36 +9,36 @@ covered_functions=( # test_clone_robot_repos() - Verify that Robot repositories are cloned properly function test_clone_robot_repos { - clone_repos "testsuite" + clone_repos "robot" "testsuite" - asserts_file_exist $testsuite_src_folder/LICENSE.TXT - asserts_file_exist $testsuite_src_folder/heatbridge/pom.xml - asserts_file_exist $testsuite_src_folder/properties/LICENSE.TXT - asserts_file_exist $testsuite_src_folder/python-testing-utils/LICENSE.TXT + asserts_file_exist $robot_src_folder/LICENSE.TXT + asserts_file_exist $robot_src_folder/heatbridge/pom.xml + asserts_file_exist $robot_src_folder/properties/LICENSE.TXT + asserts_file_exist $robot_src_folder/python-testing-utils/LICENSE.TXT } # test_compile_robot_repos() - Verify that Robot source code can be compiled properly function test_compile_robot_repos { - clone_repos "testsuite" - compile_repos "testsuite" + clone_repos "robot" "testsuite" + compile_repos "robot" #asserts_file_exist $testsuite_src_folder/heatbridge/target/maven-python/dist/heatbridge-0.3.0.dev0-py2-none-any.whl } # test_get_robot_images() - Verify that Robot Docker images are retrieved -function test_get_mr_images { +function test_get_robot_images { get_robot_images - asserts_image testsuite + asserts_image $nexus_docker_repo/openecomp/testsuite } # test_install_robot() - Verify the built and start of Robot services -function test_install_message_router { - clone_repos "robot" +function test_install_robot { + clone_repos "robot" "testsuite" get_robot_images install_robot - asserts_image_running testsuite + asserts_image_running $nexus_docker_repo/openecomp/testsuite } if [ "$1" != '*' ]; then -- cgit 1.2.3-korg