Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/sdnc |
| 5 | |
| 6 | covered_functions=( |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 7 | "clone_all_sdnc_repos" "compile_all_sdnc_repos" "get_sdnc_images" "install_sdnc" |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | # test_clone_all_sdnc_repos() - Verify the source code retrieve of SDNC project |
| 11 | function test_clone_all_sdnc_repos { |
| 12 | clone_all_sdnc_repos |
| 13 | |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 14 | asserts_file_exist $sdnc_src_folder/core/pom.xml |
| 15 | asserts_file_exist $sdnc_src_folder/adaptors/pom.xml |
| 16 | asserts_file_exist $sdnc_src_folder/northbound/pom.xml |
| 17 | asserts_file_exist $sdnc_src_folder/plugins/pom.xml |
| 18 | asserts_file_exist $sdnc_src_folder/oam/pom.xml |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | # test_compile_all_sdnc_repos() - Verify the correct compilation of SDNC projects |
| 22 | function test_compile_all_sdnc_repos { |
| 23 | clone_all_sdnc_repos |
| 24 | compile_all_sdnc_repos |
| 25 | |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 26 | for adaptor in aai-service mdsal-resource resource-assignment sql-resource; do |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 27 | asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/features/target/$adaptor-features-1.1.2-SNAPSHOT.jar |
| 28 | asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/installer/target/sdnc-$adaptor-1.1.2-SNAPSHOT-installer.zip |
| 29 | asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/provider/target/$adaptor-provider-1.1.2-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 30 | done |
| 31 | |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 32 | asserts_file_exist $sdnc_src_folder/core/dblib/provider/target/dblib-provider-1.1.2-SNAPSHOT.jar |
| 33 | asserts_file_exist $sdnc_src_folder/core/rootpom/target/rootpom-1.1.0-site_en.xml |
| 34 | asserts_file_exist $sdnc_src_folder/core/target/sdnc-core-1.1.2-SNAPSHOT-site.xml |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 35 | |
| 36 | for component in asdcApi dataChange vnfapi vnftools; do |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 37 | asserts_file_exist $sdnc_src_folder/northbound/$component/features/target/$component-features-1.1.2-SNAPSHOT.jar |
| 38 | asserts_file_exist $sdnc_src_folder/northbound/$component/installer/target/sdnc-$component-1.1.2-SNAPSHOT-installer.zip |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 39 | if [[ "$component" != "vnftools" ]]; then |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 40 | asserts_file_exist $sdnc_src_folder/northbound/$component/model/target/$component-model-1.1.2-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 41 | fi |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 42 | asserts_file_exist $sdnc_src_folder/northbound/$component/provider/target/$component-provider-1.1.2-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 43 | done |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 44 | asserts_file_exist $sdnc_src_folder/northbound/dmaap-listener/target/dmaap-listener-1.1.2-SNAPSHOT.jar |
| 45 | asserts_file_exist $sdnc_src_folder/northbound/ueb-listener/target/ueb-listener-1.1.2-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 46 | |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 47 | asserts_file_exist $sdnc_src_folder/oam/admportal/target/admportal.1.1.2-SNAPSHOT.zip |
| 48 | asserts_file_exist $sdnc_src_folder/oam/dgbuilder/target/dgbuilder.1.1.2-SNAPSHOT.zip |
| 49 | asserts_file_exist $sdnc_src_folder/oam/platform-logic/installer/target/platform-logic-installer-1.1.2-SNAPSHOT.zip |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 50 | |
| 51 | for plugin in properties-node restapi-call-node; do |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 52 | asserts_file_exist $sdnc_src_folder/plugins/$plugin/features/target/$plugin-features-1.1.2-SNAPSHOT.jar |
| 53 | asserts_file_exist $sdnc_src_folder/plugins/$plugin/installer/target/sdnc-$plugin-1.1.2-SNAPSHOT-installer.zip |
| 54 | asserts_file_exist $sdnc_src_folder/plugins/$plugin/provider/target/$plugin-provider-1.1.2-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 55 | done |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | # test_get_sdnc_images() - Verify that the SDNC images are created or retrieved |
| 59 | function test_get_sdnc_images { |
| 60 | clone_all_sdnc_repos |
| 61 | get_sdnc_images |
| 62 | |
| 63 | asserts_image openecomp/sdnc-image |
| 64 | asserts_image openecomp/admportal-sdnc-image |
| 65 | asserts_image openecomp/dgbuilder-sdnc-image |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 66 | asserts_image mysql/mysql-server:5.6 |
| 67 | } |
| 68 | |
| 69 | # test_install_sdnc() - Verify that the SDNC Docker containers are up and running |
| 70 | function test_install_sdnc { |
| 71 | clone_all_sdnc_repos |
| 72 | get_sdnc_images |
| 73 | install_sdnc |
| 74 | |
| 75 | asserts_image_running openecomp/dgbuilder-sdnc-image |
| 76 | asserts_image_running openecomp/admportal-sdnc-image |
| 77 | asserts_image_running openecomp/sdnc-image |
| 78 | asserts_image_running mysql/mysql-server:5.6 |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | if [ "$1" != '*' ]; then |
| 82 | unset covered_functions |
| 83 | covered_functions=$1 |
| 84 | fi |
| 85 | main "${covered_functions[@]}" |