Shashank Kumar Shankar | 9911e68 | 2017-08-17 15:43:17 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/portal |
| 5 | |
| 6 | covered_functions=( |
| 7 | "clone_all_portal_repos" |
| 8 | "compile_all_portal_repos" |
| 9 | "get_portal_images" |
| 10 | "install_portal" |
| 11 | ) |
| 12 | |
| 13 | # test_clone_all_portal_repos() - Verify cloning of Portal source code |
| 14 | function test_clone_all_portal_repos { |
| 15 | clone_all_portal_repos |
| 16 | |
Victor Morales | d618edd | 2017-09-18 14:57:12 -0700 | [diff] [blame] | 17 | asserts_file_exist $portal_src_folder/pom.xml |
| 18 | asserts_file_exist $portal_src_folder/ecompsdkos/LICENSE.txt |
| 19 | asserts_file_exist $portal_src_folder/dmaapbc/pom.xml |
| 20 | asserts_file_exist $portal_src_folder/sdk/LICENSE.txt |
Shashank Kumar Shankar | 9911e68 | 2017-08-17 15:43:17 -0700 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | # test_compile_all_portal_repos() - Verify compiling of Portal source code |
| 24 | function test_compile_all_portal_repos { |
| 25 | clone_all_portal_repos |
| 26 | compile_all_portal_repos |
| 27 | |
Victor Morales | d618edd | 2017-09-18 14:57:12 -0700 | [diff] [blame] | 28 | asserts_file_exist $portal_src_folder/ecomp-portal-BE-common/target/ecompportal-be-common.war |
| 29 | asserts_file_exist $portal_src_folder/ecomp-portal-BE-common-test/target/ecomp-portal-BE-common-test.jar |
| 30 | asserts_file_exist $portal_src_folder/ecomp-portal-BE-os/target/ecompportal-be-os.war |
Shashank Kumar Shankar | 9911e68 | 2017-08-17 15:43:17 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | # test_get_portal_images() - Verify that Portal Docker images are retrieved or built properly |
| 34 | function test_get_portal_images { |
| 35 | clone_all_portal_repos |
| 36 | get_portal_images |
| 37 | |
| 38 | asserts_image portal-db |
| 39 | asserts_image portal-wms |
| 40 | asserts_image portal-apps |
| 41 | asserts_image mariadb |
| 42 | } |
| 43 | |
| 44 | # test_install_portal() - Verify installation of Portal services |
| 45 | function test_install_portal { |
| 46 | clone_all_portal_repos |
| 47 | install_mariadb |
| 48 | install_portal |
| 49 | |
| 50 | asserts_image_running portal-db |
| 51 | asserts_image_running portal-wms |
| 52 | asserts_image_running portal-apps |
| 53 | } |
| 54 | |
| 55 | if [ "$1" != '*' ]; then |
| 56 | unset covered_functions |
| 57 | covered_functions=$1 |
| 58 | fi |
| 59 | main "${covered_functions[@]}" |