Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/msb |
| 5 | |
| 6 | covered_functions=( |
| 7 | "clone_all_msb_repos" "compile_all_msb_repos" "get_msb_images" "install_msb" |
| 8 | ) |
| 9 | |
| 10 | # test_clone_all_msb_repos() - Verify the source code retrieve of Microservice Bus project |
| 11 | function test_clone_all_msb_repos { |
| 12 | clone_repos "msb" |
| 13 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 14 | asserts_file_exist ${src_folders[msb]}/apigateway/pom.xml |
| 15 | asserts_file_exist ${src_folders[msb]}/discovery/pom.xml |
| 16 | asserts_file_exist ${src_folders[msb]}/java-sdk/pom.xml |
| 17 | asserts_file_exist ${src_folders[msb]}/swagger-sdk/pom.xml |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | # test_compile_all_msb_repos() - Verify the correct compilation of MSB project |
| 21 | function test_compile_all_msb_repos { |
| 22 | clone_repos "msb" |
| 23 | compile_repos "msb" |
| 24 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 25 | asserts_file_exist ${src_folders[msb]}/apigateway/apiroute/apiroute-service/target/original-apiroute-service-1.1.0-SNAPSHOT.jar |
| 26 | asserts_file_exist ${src_folders[msb]}/apigateway/apiroute/apiroute-standalone/target/apiroute-1.1.0-SNAPSHOT.zip |
| 27 | asserts_file_exist ${src_folders[msb]}/discovery/discovery-ui/target/discovery-ui-1.1.0-SNAPSHOT.jar |
| 28 | asserts_file_exist ${src_folders[msb]}/discovery/sdclient/discovery-service/target/original-discovery-service-1.1.0-SNAPSHOT.jar |
| 29 | asserts_file_exist ${src_folders[msb]}/java-sdk/target/msb-java-sdk-1.1.0-SNAPSHOT.jar |
| 30 | asserts_file_exist ${src_folders[msb]}/swagger-sdk/target/swagger-sdk-1.1.0-SNAPSHOT.jar |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | # test_get_msb_images() - Verify the creation of MSB Docker images |
| 34 | function test_get_msb_images { |
| 35 | clone_repos "msb" |
| 36 | get_msb_images |
| 37 | |
| 38 | for image in base apigateway discovery; do |
Victor Morales | 5d21f64 | 2017-12-07 11:54:59 -0800 | [diff] [blame] | 39 | asserts_image $nexus_docker_repo/onap/msb/msb_$image |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 40 | done |
| 41 | } |
| 42 | |
| 43 | # test_install_msb - Verify the execution of MSB Docker images |
| 44 | function test_install_msb { |
| 45 | clone_repos "msb" |
| 46 | get_msb_images |
| 47 | install_msb |
| 48 | |
| 49 | for image in apigateway discovery; do |
Victor Morales | 5d21f64 | 2017-12-07 11:54:59 -0800 | [diff] [blame] | 50 | asserts_image_running $nexus_docker_repo/onap/msb/msb_$image |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 51 | done |
| 52 | |
| 53 | asserts_http_status_code "http://127.0.0.1:10081/api/microservices/v1/services" |
| 54 | asserts_http_status_code "http://127.0.0.1/api/aai/v8/cloud-infrastructure/cloud-regions" |
| 55 | } |
| 56 | |
| 57 | if [ "$1" != '*' ]; then |
| 58 | unset covered_functions |
| 59 | covered_functions=$1 |
| 60 | fi |
| 61 | main "${covered_functions[@]}" |