diff options
Diffstat (limited to 'bootstrap/vagrant-onap/tests/test_functions')
-rw-r--r-- | bootstrap/vagrant-onap/tests/test_functions | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/bootstrap/vagrant-onap/tests/test_functions b/bootstrap/vagrant-onap/tests/test_functions index 17a66313a..8043ebbd7 100644 --- a/bootstrap/vagrant-onap/tests/test_functions +++ b/bootstrap/vagrant-onap/tests/test_functions @@ -7,14 +7,10 @@ covered_functions=( "create_configuration_files" "clone_repo" "install_dev_tools" "configure_bind" "install_java" "install_maven" "install_nodejs" "install_python" "install_docker" "pull_docker_image" "install_docker_compose" "configure_service" -"start_ODL" "compile_src" "build_docker_image" +"start_ODL" "compile_src" "build_docker_image" "docker_openecomp_login" +"pull_openecomp_image" "pull_onap_image" "coverity_repos" ) -# TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings -if [ -z $http_proxy ] & [ -z $https_proxy ]; then - covered_functions=(${covered_functions[@]} "docker_openecomp_login" "pull_openecomp_image") -fi - # test_create_configuration_files() - Verify the creation of a configuration files function test_create_configuration_files { create_configuration_files @@ -33,14 +29,22 @@ function test_docker_openecomp_login { docker_openecomp_login } -# test_pull_openecomp_image() - Verify the addition of a OpenECOMP container image +# test_pull_openecomp_image() - Verify the OpenECOMP container image pulling process function test_pull_openecomp_image { - pull_openecomp_image portalapps ep:1610-1 + local image_name=portal-apps + unset docker_version + pull_openecomp_image $image_name - asserts_installed_package docker-ce - asserts_image ep:1610-1 + asserts_image $nexus_docker_repo/openecomp/$image_name +} - docker rmi -f ep:1610-1 +# test_pull_onap_image() - Verify the ONAP cointainer pulling process +function test_pull_onap_image { + local image_name=portal-apps + unset docker_version + pull_onap_image $image_name + + asserts_image $nexus_docker_repo/onap/$image_name } # test_clone_repo() - Verify cloning and pulling source code from repositories @@ -117,8 +121,6 @@ function test_pull_docker_image { pull_docker_image $image asserts_image $image - - docker rmi -f $image } # test_install_docker_compose() - Verify the correct installation of Docker Compose tool @@ -161,8 +163,32 @@ function test_build_docker_image { build_docker_image $git_src_folder/ccsdk/distribution/ubuntu docker asserts_image onap/ccsdk-ubuntu-image +} - docker rmi -f onap/ccsdk-ubuntu-image +# test_coverity_repos() - Verify that all the repos are covered by scripts +function test_coverity_repos { + # Get repositories list from source code files + repos_list=() + for module in $( stat -c "%F %n" /var/onap/* | grep -v "_\|functions\|commons\|files" | cut -d' ' -f 3-); do + source $module + module_repo_list=$(eval echo \${$(basename $module)_repos[@]}) + repos_list=(${repos_list[@]} ${module_repo_list[@]}) + done + + pushd /var/onap_tests/ + cp projects.txt remaining_projects.txt + for covered_repo in "${repos_list[@]}"; do + sed -i "/$covered_repo/d" remaining_projects.txt + done + + threshold=75 + num_projects=$(wc -l < projects.txt) + num_remaining_projects=$(wc -l < remaining_projects.txt) + coverage=`echo "scale=2; 100-($num_remaining_projects/$num_projects*100)" | bc | cut -d . -f 1` + if [ $coverage -lt $threshold ]; then + raise_error "There are repositories that are not covered by scripts" + fi + popd } if [ "$1" != '*' ]; then |