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/adaptors/pom.xml |
Victor Morales | a81fafc | 2017-09-21 13:55:36 -0700 | [diff] [blame^] | 15 | # asserts_file_exist $sdnc_src_folder/architecture/pom.xml |
| 16 | asserts_file_exist $sdnc_src_folder/core/pom.xml |
| 17 | # asserts_file_exist $sdnc_src_folder/features/pom.xml |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 18 | asserts_file_exist $sdnc_src_folder/northbound/pom.xml |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 19 | asserts_file_exist $sdnc_src_folder/oam/pom.xml |
Victor Morales | a81fafc | 2017-09-21 13:55:36 -0700 | [diff] [blame^] | 20 | # asserts_file_exist $sdnc_src_folder/parent/pom.xml |
| 21 | asserts_file_exist $sdnc_src_folder/plugins/pom.xml |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | # test_compile_all_sdnc_repos() - Verify the correct compilation of SDNC projects |
| 25 | function test_compile_all_sdnc_repos { |
| 26 | clone_all_sdnc_repos |
| 27 | compile_all_sdnc_repos |
| 28 | |
Victor Morales | a81fafc | 2017-09-21 13:55:36 -0700 | [diff] [blame^] | 29 | for component in generic-resource-api vnfapi vnftools; do |
| 30 | if [[ "$component" != "generic-resource-api" ]]; then |
| 31 | if [[ "$component" == "vnfapi" ]]; then |
| 32 | asserts_file_exist $sdnc_src_folder/northbound/vnfapi/model/target/vnfapi-model-1.2.0-SNAPSHOT.jar |
| 33 | fi |
| 34 | asserts_file_exist $sdnc_src_folder/northbound/$component/installer/target/sdnc-$component-1.2.0-SNAPSHOT-installer.zip |
| 35 | asserts_file_exist $sdnc_src_folder/northbound/$component/features/target/$component-features-1.2.0-SNAPSHOT.jar |
| 36 | asserts_file_exist $sdnc_src_folder/northbound/$component/provider/target/$component-provider-1.2.0-SNAPSHOT.jar |
| 37 | else |
| 38 | asserts_file_exist $sdnc_src_folder/northbound/generic-resource-api/features/target/generic-resource-api.features-1.2.0-SNAPSHOT.jar |
| 39 | asserts_file_exist $sdnc_src_folder/northbound/generic-resource-api/installer/target/sdnc-generic-resources-api-1.2.0-SNAPSHOT-installer.zip |
| 40 | asserts_file_exist $sdnc_src_folder/northbound/generic-resource-api/model/target/generic-resource-api.model-1.2.0-SNAPSHOT.jar |
| 41 | asserts_file_exist $sdnc_src_folder/northbound/generic-resource-api/provider/target/generic-resource-api.provider-1.2.0-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 42 | fi |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 43 | done |
Victor Morales | a81fafc | 2017-09-21 13:55:36 -0700 | [diff] [blame^] | 44 | asserts_file_exist $sdnc_src_folder/oam/admportal/target/admportal.*-SNAPSHOT.zip |
| 45 | asserts_file_exist $sdnc_src_folder/oam/dgbuilder/target/dgbuilder.*-SNAPSHOT.zip |
| 46 | asserts_file_exist $sdnc_src_folder/oam/platform-logic/installer/target/platform-logic-installer-*-SNAPSHOT.zip |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | # test_get_sdnc_images() - Verify that the SDNC images are created or retrieved |
| 50 | function test_get_sdnc_images { |
| 51 | clone_all_sdnc_repos |
| 52 | get_sdnc_images |
| 53 | |
Victor Morales | 664e6e9 | 2017-09-14 12:11:23 -0700 | [diff] [blame] | 54 | asserts_image onap/sdnc-image |
| 55 | asserts_image onap/admportal-sdnc-image |
| 56 | asserts_image onap/dgbuilder-sdnc-image |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 57 | asserts_image mysql/mysql-server:5.6 |
| 58 | } |
| 59 | |
| 60 | # test_install_sdnc() - Verify that the SDNC Docker containers are up and running |
| 61 | function test_install_sdnc { |
| 62 | clone_all_sdnc_repos |
| 63 | get_sdnc_images |
| 64 | install_sdnc |
| 65 | |
Victor Morales | 664e6e9 | 2017-09-14 12:11:23 -0700 | [diff] [blame] | 66 | asserts_image_running onap/ccsdk-dgbuilder-image |
| 67 | asserts_image_running onap/admportal-sdnc-image |
| 68 | asserts_image_running onap/sdnc-image |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 69 | asserts_image_running mysql/mysql-server:5.6 |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | if [ "$1" != '*' ]; then |
| 73 | unset covered_functions |
| 74 | covered_functions=$1 |
| 75 | fi |
| 76 | main "${covered_functions[@]}" |