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 { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 12 | clone_repos "sdnc" |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 13 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 14 | asserts_file_exist ${src_folders[sdnc]}/adaptors/pom.xml |
| 15 | #asserts_file_exist ${src_folders[sdnc]}/architecture/docs/index.rst |
| 16 | asserts_file_exist ${src_folders[sdnc]}/core/pom.xml |
| 17 | #asserts_file_exist ${src_folders[sdnc]}/features/docs/index.rst |
| 18 | asserts_file_exist ${src_folders[sdnc]}/northbound/pom.xml |
| 19 | asserts_file_exist ${src_folders[sdnc]}/oam/pom.xml |
| 20 | #asserts_file_exist ${src_folders[sdnc]}/parent/docs/index.rst |
| 21 | asserts_file_exist ${src_folders[sdnc]}/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 { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 26 | clone_repos "sdnc" |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 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 |
Victor Morales | f6c0bf1 | 2017-10-27 11:08:04 -0700 | [diff] [blame] | 30 | if [[ "$component" == "vnfapi" ]]; then |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 31 | asserts_file_exist ${src_folders[sdnc]}/northbound/vnfapi/model/target/vnfapi-model-1.2.0-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 32 | fi |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 33 | asserts_file_exist ${src_folders[sdnc]}/northbound/$component/installer/target/sdnc-$component-1.2.0-SNAPSHOT-installer.zip |
| 34 | asserts_file_exist ${src_folders[sdnc]}/northbound/$component/features/target/$component-features-1.2.0-SNAPSHOT.jar |
| 35 | asserts_file_exist ${src_folders[sdnc]}/northbound/$component/provider/target/$component-provider-1.2.0-SNAPSHOT.jar |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 36 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 37 | asserts_file_exist ${src_folders[sdnc]}/oam/admportal/target/admportal.*-SNAPSHOT.zip |
| 38 | asserts_file_exist ${src_folders[sdnc]}/oam/dgbuilder/target/dgbuilder.*-SNAPSHOT.zip |
| 39 | asserts_file_exist ${src_folders[sdnc]}/oam/platform-logic/installer/target/platform-logic-installer-*-SNAPSHOT.zip |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | # test_get_sdnc_images() - Verify that the SDNC images are created or retrieved |
| 43 | function test_get_sdnc_images { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 44 | clone_repos "sdnc" |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 45 | get_sdnc_images |
| 46 | |
Victor Morales | 664e6e9 | 2017-09-14 12:11:23 -0700 | [diff] [blame] | 47 | asserts_image onap/sdnc-image |
| 48 | asserts_image onap/admportal-sdnc-image |
| 49 | asserts_image onap/dgbuilder-sdnc-image |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 50 | asserts_image mysql/mysql-server:5.6 |
| 51 | } |
| 52 | |
| 53 | # test_install_sdnc() - Verify that the SDNC Docker containers are up and running |
| 54 | function test_install_sdnc { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 55 | clone_repos "sdnc" |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 56 | get_sdnc_images |
| 57 | install_sdnc |
| 58 | |
Victor Morales | 664e6e9 | 2017-09-14 12:11:23 -0700 | [diff] [blame] | 59 | asserts_image_running onap/ccsdk-dgbuilder-image |
| 60 | asserts_image_running onap/admportal-sdnc-image |
| 61 | asserts_image_running onap/sdnc-image |
Victor Morales | dbdc30a | 2017-08-17 11:50:42 -0500 | [diff] [blame] | 62 | asserts_image_running mysql/mysql-server:5.6 |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | if [ "$1" != '*' ]; then |
| 66 | unset covered_functions |
| 67 | covered_functions=$1 |
| 68 | fi |
| 69 | main "${covered_functions[@]}" |