From cf26999de441d3e915ee011ddfa31a2bb1b1af15 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Wed, 18 Oct 2017 09:29:55 -0700 Subject: Fix proxy usage for docker external The process that retrieves Docker images hosted externally was missing a step in its configuration. This change fix the configuration and unblock the pending Unit Tests. Change-Id: I5a6b39086eb806bab5bb2667092a154e230d33ef Signed-off-by: Victor Morales Issue-ID: INT-227 --- bootstrap/vagrant-onap/tests/_test_base | 3 +++ bootstrap/vagrant-onap/tests/test_aai | 5 ----- bootstrap/vagrant-onap/tests/test_functions | 30 ++++++++++++++--------------- 3 files changed, 18 insertions(+), 20 deletions(-) (limited to 'bootstrap/vagrant-onap/tests') diff --git a/bootstrap/vagrant-onap/tests/_test_base b/bootstrap/vagrant-onap/tests/_test_base index 155de98bb..7d0415a44 100644 --- a/bootstrap/vagrant-onap/tests/_test_base +++ b/bootstrap/vagrant-onap/tests/_test_base @@ -15,6 +15,9 @@ function main { echo "ok $((i+1)) - test_${covered_functions[$i]}" # Teardown process + if ! is_package_installed docker-ce; then + docker images -q | xargs docker rmi -f + fi dpkg --get-selections > installed-software_new sort -o installed-software_new installed-software_new apt-get purge -y -qq $(comm -3 installed-software installed-software_new | awk '{print $1}') diff --git a/bootstrap/vagrant-onap/tests/test_aai b/bootstrap/vagrant-onap/tests/test_aai index 79d26c83d..10777d678 100644 --- a/bootstrap/vagrant-onap/tests/test_aai +++ b/bootstrap/vagrant-onap/tests/test_aai @@ -8,11 +8,6 @@ covered_functions=( "install_hadoop" "install_haproxy" "clone_all_aai_repos" "compile_aai_repos" "setup_titan" "install_hbase" "install_ajsc_aai" "install_model_loader" ) -# TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings -if [ -z $http_proxy ] & [ -z $https_proxy ]; then - covered_functions=(${covered_functions[@]} "install_hbase") -fi - # test_install_hadoop() - Verify that Hadoop is downloaded and started properly function test_install_hadoop { install_hadoop diff --git a/bootstrap/vagrant-onap/tests/test_functions b/bootstrap/vagrant-onap/tests/test_functions index 17a66313a..ee7358a84 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" ) -# 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,6 @@ 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 } if [ "$1" != '*' ]; then -- cgit 1.2.3-korg