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" |
Victor Morales | be84471 | 2018-01-22 10:07:28 -0800 | [diff] [blame] | 8 | "install_hadoop" "install_haproxy" "clone_all_aai_repos" "compile_aai_repos" "setup_titan" "install_hbase" |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 9 | ) |
| 10 | |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 11 | # test_install_hadoop() - Verify that Hadoop is downloaded and started properly |
| 12 | function test_install_hadoop { |
| 13 | install_hadoop |
| 14 | |
| 15 | asserts_file_exist /opt/hadoop/current/titan-1.0.0-hadoop1/bin/titan.sh |
| 16 | asserts_java_process Elasticsearch |
| 17 | asserts_java_process GremlinServer |
| 18 | asserts_java_process CassandraDaemon |
| 19 | } |
| 20 | |
| 21 | # test_install_haproxy() - Verify that HAProxy is installed properly |
| 22 | function test_install_haproxy { |
| 23 | install_haproxy |
| 24 | |
| 25 | asserts_installed_package haproxy |
| 26 | asserts_process haproxy |
| 27 | } |
| 28 | |
| 29 | # test_clone_all_aai_repos() - Verify that all the AAI Repos are cloned |
| 30 | function test_clone_all_aai_repos { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 31 | clone_repos "aai" |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 32 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 33 | asserts_file_exist ${src_folders[aai]}/aai-common/pom.xml |
| 34 | asserts_file_exist ${src_folders[aai]}/aai-config/cookbooks/aai-resources/runlist-aai-resources.json |
| 35 | asserts_file_exist ${src_folders[aai]}/aai-data/environments/solo.json |
| 36 | asserts_file_exist ${src_folders[aai]}/aai-service/pom.xml |
| 37 | asserts_file_exist ${src_folders[aai]}/babel/README.md |
| 38 | asserts_file_exist ${src_folders[aai]}/champ/pom.xml |
| 39 | asserts_file_exist ${src_folders[aai]}/data-router/pom.xml |
| 40 | asserts_file_exist ${src_folders[aai]}/esr-gui/pom.xml |
| 41 | asserts_file_exist ${src_folders[aai]}/esr-server/pom.xml |
| 42 | asserts_file_exist ${src_folders[aai]}/gizmo/pom.xml |
| 43 | asserts_file_exist ${src_folders[aai]}/logging-service/pom.xml |
| 44 | asserts_file_exist ${src_folders[aai]}/model-loader/pom.xml |
| 45 | asserts_file_exist ${src_folders[aai]}/resources/pom.xml |
| 46 | asserts_file_exist ${src_folders[aai]}/rest-client/pom.xml |
| 47 | asserts_file_exist ${src_folders[aai]}/router-core/pom.xml |
| 48 | asserts_file_exist ${src_folders[aai]}/search-data-service/pom.xml |
| 49 | asserts_file_exist ${src_folders[aai]}/sparky-be/pom.xml |
| 50 | asserts_file_exist ${src_folders[aai]}/sparky-fe/pom.xml |
| 51 | asserts_file_exist ${src_folders[aai]}/test-config/docker-compose-app.yml |
| 52 | asserts_file_exist ${src_folders[aai]}/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 { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 57 | clone_repos "aai" |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 58 | compile_aai_repos |
| 59 | |
Victor Morales | 51e61ce | 2017-10-12 10:56:35 -0700 | [diff] [blame] | 60 | for common in annotations auth core schema utils; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 61 | asserts_file_exist ${src_folders[aai]}/aai-common/aai-$common/target/aai-$common-1.1.0-SNAPSHOT.jar |
Victor Morales | 51e61ce | 2017-10-12 10:56:35 -0700 | [diff] [blame] | 62 | done |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 63 | |
Victor Morales | 51e61ce | 2017-10-12 10:56:35 -0700 | [diff] [blame] | 64 | for service in common-logging eelf-logging logging-api; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 65 | asserts_file_exist ${src_folders[aai]}/logging-service/$service/target/$service-1.1.0-SNAPSHOT.jar |
Victor Morales | 51e61ce | 2017-10-12 10:56:35 -0700 | [diff] [blame] | 66 | done |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 67 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 68 | asserts_file_exist ${src_folders[aai]}/resources/aai-resources/target/aai-resources.jar |
| 69 | asserts_file_exist ${src_folders[aai]}/traversal/aai-traversal/target/traversal.jar |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | # test_setup_titan() - Verify that Titan Cassandra DB is up and running |
| 73 | function test_setup_titan { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 74 | clone_repos "aai" |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 75 | install_hadoop |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 76 | setup_titan |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 77 | |
| 78 | # TODO(electrocucaracha): Validate the DB creation |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | # test_start_aai_microservices() - Verify that AAI Resources and Traversal images works |
| 82 | function test_start_aai_microservices { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 83 | clone_repos "aai" |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 84 | start_aai_microservices |
Victor Morales | 7ae05a4 | 2017-08-22 14:39:00 -0500 | [diff] [blame] | 85 | |
| 86 | # TODO(electrocucaracha): Investigate how to run AAI microservices in background |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | # test_install_hbase() - Verify that AAI HBase service is up and running properly |
| 90 | function test_install_hbase { |
| 91 | install_hbase |
| 92 | |
| 93 | asserts_image_running aai-hbase-${hbase_version} |
| 94 | } |
| 95 | |
Victor Morales | 158c18c | 2017-08-06 11:23:15 -0500 | [diff] [blame] | 96 | if [ "$1" != '*' ]; then |
| 97 | unset covered_functions |
| 98 | covered_functions=$1 |
| 99 | fi |
| 100 | main "${covered_functions[@]}" |