blob: e8bb246066193e1849a343cd51a7ce730c2ffa6b [file] [log] [blame]
Victor Morales9d205bc2017-12-01 17:52:07 -08001#!/bin/bash
2
3source /var/onap_tests/_test_base
4source /var/onap/msb
5
6covered_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
11function test_clone_all_msb_repos {
12 clone_repos "msb"
13
14 asserts_file_exist $msb_src_folder/apigateway/pom.xml
15 asserts_file_exist $msb_src_folder/discovery/pom.xml
16 asserts_file_exist $msb_src_folder/java-sdk/pom.xml
17 asserts_file_exist $msb_src_folder/swagger-sdk/pom.xml
18}
19
20# test_compile_all_msb_repos() - Verify the correct compilation of MSB project
21function test_compile_all_msb_repos {
22 clone_repos "msb"
23 compile_repos "msb"
24
25 asserts_file_exist $msb_src_folder/apigateway/apiroute/apiroute-service/target/original-apiroute-service-1.1.0-SNAPSHOT.jar
26 asserts_file_exist $msb_src_folder/apigateway/apiroute/apiroute-standalone/target/apiroute-1.1.0-SNAPSHOT.zip
27 asserts_file_exist $msb_src_folder/discovery/discovery-ui/target/discovery-ui-1.1.0-SNAPSHOT.jar
28 asserts_file_exist $msb_src_folder/discovery/sdclient/discovery-service/target/original-discovery-service-1.1.0-SNAPSHOT.jar
29 asserts_file_exist $msb_src_folder/java-sdk/target/msb-java-sdk-1.1.0-SNAPSHOT.jar
30 asserts_file_exist $msb_src_folder/swagger-sdk/target/swagger-sdk-1.1.0-SNAPSHOT.jar
31}
32
33# test_get_msb_images() - Verify the creation of MSB Docker images
34function test_get_msb_images {
35 clone_repos "msb"
36 get_msb_images
37
38 for image in base apigateway discovery; do
Victor Morales5d21f642017-12-07 11:54:59 -080039 asserts_image $nexus_docker_repo/onap/msb/msb_$image
Victor Morales9d205bc2017-12-01 17:52:07 -080040 done
41}
42
43# test_install_msb - Verify the execution of MSB Docker images
44function test_install_msb {
45 clone_repos "msb"
46 get_msb_images
47 install_msb
48
49 for image in apigateway discovery; do
Victor Morales5d21f642017-12-07 11:54:59 -080050 asserts_image_running $nexus_docker_repo/onap/msb/msb_$image
Victor Morales9d205bc2017-12-01 17:52:07 -080051 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
57if [ "$1" != '*' ]; then
58 unset covered_functions
59 covered_functions=$1
60fi
61main "${covered_functions[@]}"