aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-08-18 20:53:42 -0500
committerVictor Morales <victor.morales@intel.com>2017-08-18 20:53:42 -0500
commit65deef2dae9d22cbd8c1d08c6e88151a8661159c (patch)
treec08376dc57ac2630531c1560132e0c678eef73d6 /bootstrap/vagrant-onap/lib
parent9c47b8a0659920547f439c1060e7a408948a4096 (diff)
Create UTs for APPC
It was created the Unit Tests for APPC which modified the code of SDNC. Change-Id: Ica033e8a94f545e148f321c388bee981abadc4af Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-Id: INT-24
Diffstat (limited to 'bootstrap/vagrant-onap/lib')
-rwxr-xr-xbootstrap/vagrant-onap/lib/appc49
-rwxr-xr-xbootstrap/vagrant-onap/lib/sdnc26
2 files changed, 39 insertions, 36 deletions
diff --git a/bootstrap/vagrant-onap/lib/appc b/bootstrap/vagrant-onap/lib/appc
index 8ad73561f..a0959c67a 100755
--- a/bootstrap/vagrant-onap/lib/appc
+++ b/bootstrap/vagrant-onap/lib/appc
@@ -3,44 +3,41 @@
set -o xtrace
source /var/onap/sdnc
-source /var/onap/asserts
+source /var/onap/functions
+
+appc_src_folder=$git_src_folder/appc
# clone_all_appc_repos() - Function that clones APPC source repo.
function clone_all_appc_repos {
- local src_folder=/opt/appc
-
- clone_repo appc $src_folder
- clone_repo appc/deployment $src_folder/deployment
+ clone_repo appc $appc_src_folder
+ clone_repo appc/deployment $appc_src_folder/deployment
}
# compile_all_appc_repos() - Function that compiles APPC source repo.
function compile_all_appc_repos {
- local src_folder=/opt/appc
-
- compile_src $src_folder
- compile_src $src_folder/deployment
+ compile_src $appc_src_folder
+ compile_src $appc_src_folder/deployment
}
-# install_appc() - Function that clones and installs the APPC services from source code
-function install_appc {
- install_package unzip
- local src_folder=/opt/appc
-
- clone_all_appc_repos
- if [[ "$compile_repo" == "True" ]]; then
- compile_all_appc_repos
- fi
+# _build_appc_images() - Function that creates APPC images from source code.
+function _build_appc_images {
+ get_sdnc_images
+ build_docker_image $appc_src_folder/deployment/installation/appc docker
+}
+# get_appc_images() - Function that gets or build APPC docker images
+function get_appc_images {
if [[ "$build_image" == "True" ]]; then
- clone_repo sdnc/oam /opt/sdnc/oam
- build_sdnc_images /opt/sdnc/oam
- build_docker_image $src_folder/deployment/installation/appc docker
- asserts_image openecomp/appc-image
+ _build_appc_images
else
pull_openecomp_image appc-image openecomp/appc-image:latest
pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
fi
- pushd $src_folder/deployment
+}
+
+# install_appc() - Function that clones and installs the APPC services from source code
+function install_appc {
+ pushd $appc_src_folder/deployment/docker-compose
install_docker_compose
/opt/docker/docker-compose up -d
popd
@@ -48,5 +45,11 @@ function install_appc {
# init_appc() - Function that initialize APPC services
function init_appc {
+ clone_all_appc_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_appc_repos
+ fi
+
+ get_appc_images
install_appc
}
diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc
index 332632138..9a3f9b032 100755
--- a/bootstrap/vagrant-onap/lib/sdnc
+++ b/bootstrap/vagrant-onap/lib/sdnc
@@ -4,13 +4,13 @@ set -o xtrace
source /var/onap/functions
-src_folder=$git_src_folder/openecomp/sdnc
+sdnc_src_folder=$git_src_folder/openecomp/sdnc
sdnc_repos=("core" "adaptors" "northbound" "plugins" "oam")
# clone_all_sdnc_repos() - Function that clones SDNC source repo.
function clone_all_sdnc_repos {
for dirc in ${sdnc_repos[@]}; do
- clone_repo sdnc/$dirc $src_folder/$dirc
+ clone_repo sdnc/$dirc $sdnc_src_folder/$dirc
done
}
@@ -18,21 +18,21 @@ function clone_all_sdnc_repos {
function compile_all_sdnc_repos {
for dirc in ${sdnc_repos[@]}; do
if [[ "$dirc" == "core" ]]; then
- compile_src $src_folder/core/rootpom
+ compile_src $sdnc_src_folder/core/rootpom
fi
- compile_src $src_folder/$dirc
+ compile_src $sdnc_src_folder/$dirc
done
}
-# build_sdnc_images() - Builds SDNC images from source code
-function build_sdnc_images {
- local folder=${1:-$src_folder/oam}
+# _build_sdnc_images() - Builds SDNC images from source code
+function _build_sdnc_images {
+ local folder=$sdnc_src_folder/oam
install_package unzip
- clone_repo sdnc/oam $src_folder/oam
+ clone_repo sdnc/oam $folder
# 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/
+ if [[ "$compile_repo" != "True" ]]; then
+ compile_src $folder
fi
for dirc in ubuntu sdnc admportal dgbuilder; do
build_docker_image $folder/installation/$dirc
@@ -42,7 +42,7 @@ function build_sdnc_images {
# get_sdnc_images() - Build or retrieve necessary images
function get_sdnc_images {
if [[ "$build_image" == "True" ]]; then
- build_sdnc_images
+ _build_sdnc_images
else
pull_openecomp_image sdnc-image openecomp/sdnc-image:latest
pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest
@@ -53,8 +53,8 @@ function get_sdnc_images {
# install_sdnc() - Download and install SDNC services from source code
function install_sdnc {
- clone_repo sdnc/oam $src_folder/oam
- pushd $src_folder/oam/installation/src/main/yaml
+ clone_repo sdnc/oam $sdnc_src_folder/oam
+ pushd $sdnc_src_folder/oam/installation/src/main/yaml
install_docker_compose
/opt/docker/docker-compose up -d
popd