summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-08-18 18:43:59 +0000
committerGerrit Code Review <gerrit@onap.org>2017-08-18 18:43:59 +0000
commit7506955e42a3218122b83c673803b65ae301ea7e (patch)
tree64bc768f09a9224c24f007a744f272695143fa7a /bootstrap
parentd907b91d857f52aa06f8bc00ac8edd4e834e2fab (diff)
parentf0e62392a1016b93007326880e945ee694ea8505 (diff)
Merge "Refactor and complete MR UTs"
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/vagrant-onap/lib/mr21
-rw-r--r--bootstrap/vagrant-onap/tests/test_mr26
2 files changed, 35 insertions, 12 deletions
diff --git a/bootstrap/vagrant-onap/lib/mr b/bootstrap/vagrant-onap/lib/mr
index 869994d2d..76b27b1ea 100755
--- a/bootstrap/vagrant-onap/lib/mr
+++ b/bootstrap/vagrant-onap/lib/mr
@@ -3,23 +3,32 @@
set -o xtrace
source /var/onap/functions
-source /var/onap/asserts
src_folder=$git_src_folder/dcae/message-router
-# install_message_router() - Downloads and configure message router source code
-function _install_message_router {
+# clone_mr_repos() - Function that clones the Message Router repositories
+function clone_mr_repos {
clone_repo dcae/demo/startup/message-router $src_folder
- pushd $src_folder
+}
+
+# get_mr_images() - Function that retrieves the Message Router Docker images
+function get_mr_images {
pull_docker_image attos/dmaap
pull_docker_image wurstmeister/zookeeper
+}
+
+# install_message_router() - Downloads and configure message router source code
+function install_message_router {
install_docker_compose
+
+ pushd $src_folder
bash deploy.sh
- asserts_image dockerfiles_kafka
popd
}
# init_mr() - Function that initialize Message Router services
function init_mr {
- _install_message_router
+ clone_mr_repos
+ get_mr_images
+ install_message_router
}
diff --git a/bootstrap/vagrant-onap/tests/test_mr b/bootstrap/vagrant-onap/tests/test_mr
index 6fad08311..d8db84940 100644
--- a/bootstrap/vagrant-onap/tests/test_mr
+++ b/bootstrap/vagrant-onap/tests/test_mr
@@ -4,19 +4,33 @@ source /var/onap_tests/_test_base
source /var/onap/mr
covered_functions=(
-"init_mr"
+"clone_mr_repos" "get_mr_images" "install_message_router"
)
-# test_init_mr() - Verify the built and start of Message Router services
-function test_init_mr {
- init_mr
+# test_clone_mr_repos() - Verify that Message Router repositories are cloned properly
+function test_clone_mr_repos {
+ clone_mr_repos
+
+ asserts_file_exist $src_folder/deploy.sh
+}
+
+# test_get_mr_images() - Verify that Message Router Docker images are retrieved
+function test_get_mr_images {
+ get_mr_images
- asserts_image dockerfiles_kafka
- asserts_image anapsix/alpine-java
asserts_image attos/dmaap
asserts_image wurstmeister/zookeeper
}
+# test_install_message_router() - Verify the built and start of Message Router services
+function test_install_message_router {
+ clone_mr_repos
+ get_mr_images
+ install_message_router
+
+ asserts_image_running dockerfiles_kafka
+}
+
if [ "$1" != '*' ]; then
unset covered_functions
covered_functions=$1