aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests
diff options
context:
space:
mode:
authorShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2017-08-17 15:43:17 -0700
committerVictor Morales <victor.morales@intel.com>2017-08-29 17:30:07 -0500
commit9911e6810d1e419be93aca41f7de937c7b2c817b (patch)
tree13272b1c9181e4a73cba9a64dd01576bc3c7bf1a /bootstrap/vagrant-onap/tests
parent9b890140774f555d4d71be2b8874875bb6944d4a (diff)
Add UTs for Portal script
This patch adds Unit Test for checking Portal installation. Issue-Id: INT-21 Change-Id: I8cb93db08134e9cc96400476a7d1f19d4c789e0c Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
Diffstat (limited to 'bootstrap/vagrant-onap/tests')
-rw-r--r--bootstrap/vagrant-onap/tests/test_portal59
1 files changed, 59 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/tests/test_portal b/bootstrap/vagrant-onap/tests/test_portal
new file mode 100644
index 000000000..d586b73f5
--- /dev/null
+++ b/bootstrap/vagrant-onap/tests/test_portal
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+source /var/onap_tests/_test_base
+source /var/onap/portal
+
+covered_functions=(
+"clone_all_portal_repos"
+"compile_all_portal_repos"
+"get_portal_images"
+"install_portal"
+)
+
+# test_clone_all_portal_repos() - Verify cloning of Portal source code
+function test_clone_all_portal_repos {
+ clone_all_portal_repos
+
+ asserts_file_exist $policy_src_folder/pom.xml
+ asserts_file_exist $policy_src_folder/ecompsdkos/LICENSE.txt
+ asserts_file_exist $policy_src_folder/dmaapbc/pom.xml
+ asserts_file_exist $policy_src_folder/sdk/LICENSE.txt
+}
+
+# test_compile_all_portal_repos() - Verify compiling of Portal source code
+function test_compile_all_portal_repos {
+ clone_all_portal_repos
+ compile_all_portal_repos
+
+ asserts_file_exist $policy_src_folder/ecomp-portal-BE-common/target/ecompportal-be-common.war
+ asserts_file_exist $policy_src_folder/ecomp-portal-BE-common-test/target/ecomp-portal-BE-common-test.jar
+ asserts_file_exist $policy_src_folder/ecomp-portal-BE-os/target/ecompportal-be-os.war
+}
+
+# test_get_portal_images() - Verify that Portal Docker images are retrieved or built properly
+function test_get_portal_images {
+ clone_all_portal_repos
+ get_portal_images
+
+ asserts_image portal-db
+ asserts_image portal-wms
+ asserts_image portal-apps
+ asserts_image mariadb
+}
+
+# test_install_portal() - Verify installation of Portal services
+function test_install_portal {
+ clone_all_portal_repos
+ install_mariadb
+ install_portal
+
+ asserts_image_running portal-db
+ asserts_image_running portal-wms
+ asserts_image_running portal-apps
+}
+
+if [ "$1" != '*' ]; then
+ unset covered_functions
+ covered_functions=$1
+fi
+main "${covered_functions[@]}"