Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/aai |
| 5 | |
| 6 | covered_functions=( |
Victor Morales | e9d066a | 2017-09-13 08:20:36 -0700 | [diff] [blame] | 7 | #"install_hadoop" "install_haproxy" "clone_all_aai_repos" "compile_aai_repos" "setup_titan" "start_aai_microservices" "install_hbase" "install_ajsc_aai" "install_model_loader" |
| 8 | "install_hadoop" "install_haproxy" "clone_all_aai_repos" "compile_aai_repos" "setup_titan" "install_hbase" "install_ajsc_aai" "install_model_loader" |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 9 | ) |
| 10 | |
| 11 | # TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings |
| 12 | if [ -z $http_proxy ] & [ -z $https_proxy ]; then |
| 13 | covered_functions=(${covered_functions[@]} "install_hbase") |
| 14 | fi |
| 15 | |
| 16 | # test_install_hadoop() - Verify that Hadoop is downloaded and started properly |
| 17 | function test_install_hadoop { |
| 18 | install_hadoop |
| 19 | |
| 20 | asserts_file_exist /opt/hadoop/current/titan-1.0.0-hadoop1/bin/titan.sh |
| 21 | asserts_java_process Elasticsearch |
| 22 | asserts_java_process GremlinServer |
| 23 | asserts_java_process CassandraDaemon |
| 24 | } |
| 25 | |
| 26 | # test_install_haproxy() - Verify that HAProxy is installed properly |
| 27 | function test_install_haproxy { |
| 28 | install_haproxy |
| 29 | |
| 30 | asserts_installed_package haproxy |
| 31 | asserts_process haproxy |
| 32 | } |
| 33 | |
| 34 | # test_clone_all_aai_repos() - Verify that all the AAI Repos are cloned |
| 35 | function test_clone_all_aai_repos { |
| 36 | clone_all_aai_repos |
| 37 | |
Victor Morales | 8e08c87 | 2017-08-21 16:15:57 -0500 | [diff] [blame] | 38 | asserts_file_exist $aai_src_folder/aai-common/pom.xml |
| 39 | asserts_file_exist $aai_src_folder/aai-config/cookbooks/aai-resources/runlist-aai-resources.json |
| 40 | asserts_file_exist $aai_src_folder/aai-data/environments/solo.json |
| 41 | asserts_file_exist $aai_src_folder/aai-service/pom.xml |
| 42 | asserts_file_exist $aai_src_folder/data-router/pom.xml |
| 43 | asserts_file_exist $aai_src_folder/logging-service/pom.xml |
| 44 | asserts_file_exist $aai_src_folder/model-loader/pom.xml |
| 45 | asserts_file_exist $aai_src_folder/resources/pom.xml |
| 46 | asserts_file_exist $aai_src_folder/rest-client/pom.xml |
| 47 | asserts_file_exist $aai_src_folder/router-core/pom.xml |
| 48 | asserts_file_exist $aai_src_folder/search-data-service/pom.xml |
| 49 | asserts_file_exist $aai_src_folder/sparky-be/pom.xml |
| 50 | asserts_file_exist $aai_src_folder/sparky-fe/pom.xml |
| 51 | asserts_file_exist $aai_src_folder/test-config/docker-compose-app.yml |
| 52 | asserts_file_exist $aai_src_folder/traversal/pom.xml |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | # test_compile_aai_repos() - Verify that all the AAI Repositories complile properly |
| 56 | function test_compile_aai_repos { |
| 57 | clone_all_aai_repos |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 58 | compile_aai_repos |
| 59 | |
Victor Morales | 8e08c87 | 2017-08-21 16:15:57 -0500 | [diff] [blame] | 60 | asserts_file_exist $aai_src_folder/aai-common/aai-annotations/target/aai-annotations-1.1.0-SNAPSHOT.jar |
| 61 | asserts_file_exist $aai_src_folder/aai-common/aai-auth/target/aai-auth-1.1.0-SNAPSHOT.jar |
| 62 | asserts_file_exist $aai_src_folder/aai-common/aai-core/target/aai-core-1.1.0-SNAPSHOT.jar |
| 63 | asserts_file_exist $aai_src_folder/aai-common/aai-schema/target/aai-schema-1.1.0-SNAPSHOT.jar |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 64 | |
Victor Morales | 8e08c87 | 2017-08-21 16:15:57 -0500 | [diff] [blame] | 65 | asserts_file_exist $aai_src_folder/logging-service/common-logging/target/common-logging-1.1.0-SNAPSHOT.jar |
| 66 | asserts_file_exist $aai_src_folder/logging-service/eelf-logging/target/eelf-logging-1.1.0-SNAPSHOT.jar |
| 67 | asserts_file_exist $aai_src_folder/logging-service/logging-api/target/logging-api-1.1.0-SNAPSHOT.jar |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 68 | |
Victor Morales | 8e08c87 | 2017-08-21 16:15:57 -0500 | [diff] [blame] | 69 | asserts_file_exist $aai_src_folder/resources/aai-resources/target/aai-resources.jar |
Victor Morales | 8e08c87 | 2017-08-21 16:15:57 -0500 | [diff] [blame] | 70 | asserts_file_exist $aai_src_folder/traversal/aai-traversal/target/traversal.jar |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | # test_setup_titan() - Verify that Titan Cassandra DB is up and running |
| 74 | function test_setup_titan { |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 75 | clone_all_aai_repos |
| 76 | install_hadoop |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 77 | setup_titan |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 78 | |
| 79 | # TODO(electrocucaracha): Validate the DB creation |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | # test_start_aai_microservices() - Verify that AAI Resources and Traversal images works |
| 83 | function test_start_aai_microservices { |
| 84 | clone_all_aai_repos |
| 85 | start_aai_microservices |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 86 | |
| 87 | # TODO(electrocucaracha): Investigate how to run AAI microservices in background |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | # test_install_hbase() - Verify that AAI HBase service is up and running properly |
| 91 | function test_install_hbase { |
| 92 | install_hbase |
| 93 | |
| 94 | asserts_image_running aai-hbase-${hbase_version} |
| 95 | } |
| 96 | |
| 97 | # test_install_ajsc_aai() - Verify that AJSC AAI service is up and running properly |
| 98 | function test_install_ajsc_aai { |
| 99 | clone_all_aai_repos |
| 100 | install_ajsc_aai |
| 101 | |
| 102 | asserts_image_running openecomp/ajsc-aai |
| 103 | } |
| 104 | |
| 105 | # test_install_model_loader() - Verify that Model AAI service is up and running properly |
| 106 | function test_install_model_loader { |
| 107 | clone_all_aai_repos |
| 108 | install_model_loader |
| 109 | |
| 110 | asserts_image openecomp/model-loader |
| 111 | } |
| 112 | |
| 113 | if [ "$1" != '*' ]; then |
| 114 | unset covered_functions |
| 115 | covered_functions=$1 |
| 116 | fi |
| 117 | main "${covered_functions[@]}" |