Refactor and Improve SDNC UTs
This change refactor the lib/sdnc script and add some unit tests to
the SDNC component.
Change-Id: Ia389c0e8e78de2eef1b41075a0701b013f9bc925
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-102
diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc
index 8bf6ae6..3326321 100755
--- a/bootstrap/vagrant-onap/lib/sdnc
+++ b/bootstrap/vagrant-onap/lib/sdnc
@@ -3,7 +3,6 @@
set -o xtrace
source /var/onap/functions
-source /var/onap/asserts
src_folder=$git_src_folder/openecomp/sdnc
sdnc_repos=("core" "adaptors" "northbound" "plugins" "oam")
@@ -25,41 +24,35 @@
done
}
-# _build_sdnc_images() - Builds SDNC images from source code
-function _build_sdnc_images {
- local folder=$1
+# build_sdnc_images() - Builds SDNC images from source code
+function build_sdnc_images {
+ local folder=${1:-$src_folder/oam}
- build_docker_image $folder/installation/ubuntu
- asserts_image openecomp/ubuntu-sdnc-image
-
- build_docker_image $folder/installation/sdnc
- asserts_image openecomp/sdnc-image
-
- build_docker_image $folder/installation/admportal
- asserts_image openecomp/admportal-sdnc-image
-
- build_docker_image $folder/installation/dgbuilder
- asserts_image openecomp/dgbuilder-sdnc-image
+ install_package unzip
+ clone_repo sdnc/oam $src_folder/oam
+ # The OAM code depends on all the SDNC repos which should be downloaded and compiled first
+ if [[ "$compile_repo" == "False" ]]; then
+ compile_src $src_folder/oam/
+ fi
+ for dirc in ubuntu sdnc admportal dgbuilder; do
+ build_docker_image $folder/installation/$dirc
+ done
}
# get_sdnc_images() - Build or retrieve necessary images
function get_sdnc_images {
if [[ "$build_image" == "True" ]]; then
- # The OAM code depends on all the SDNC repos which should be downloaded and compiled first
- if [[ "$compile_repo" == "False" ]]; then
- compile_all_sdnc_repos
- fi
- _build_sdnc_images $src_folder/oam
+ build_sdnc_images
else
pull_openecomp_image sdnc-image openecomp/sdnc-image:latest
pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest
pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
fi
+ pull_docker_image mysql/mysql-server:5.6
}
# install_sdnc() - Download and install SDNC services from source code
function install_sdnc {
- install_package unzip
clone_repo sdnc/oam $src_folder/oam
pushd $src_folder/oam/installation/src/main/yaml
install_docker_compose