blob: 79d26c83d94941a9cc5adc9173bf0a3593f700df [file] [log] [blame]
Victor Morales158c18c2017-08-06 11:23:15 -05001#!/bin/bash
2
3source /var/onap_tests/_test_base
4source /var/onap/aai
5
6covered_functions=(
Victor Moralese9d066a2017-09-13 08:20:36 -07007#"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 Morales158c18c2017-08-06 11:23:15 -05009)
10
11# TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings
12if [ -z $http_proxy ] & [ -z $https_proxy ]; then
13 covered_functions=(${covered_functions[@]} "install_hbase")
14fi
15
16# test_install_hadoop() - Verify that Hadoop is downloaded and started properly
17function 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
27function 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
35function test_clone_all_aai_repos {
36 clone_all_aai_repos
37
Victor Morales8e08c872017-08-21 16:15:57 -050038 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
Victor Morales51e61ce2017-10-12 10:56:35 -070042 asserts_file_exist $aai_src_folder/babel/README.md
43 asserts_file_exist $aai_src_folder/champ/pom.xml
Victor Morales8e08c872017-08-21 16:15:57 -050044 asserts_file_exist $aai_src_folder/data-router/pom.xml
Victor Morales51e61ce2017-10-12 10:56:35 -070045 asserts_file_exist $aai_src_folder/esr-gui/pom.xml
46 asserts_file_exist $aai_src_folder/esr-server/pom.xml
47 asserts_file_exist $aai_src_folder/gizmo/pom.xml
Victor Morales8e08c872017-08-21 16:15:57 -050048 asserts_file_exist $aai_src_folder/logging-service/pom.xml
49 asserts_file_exist $aai_src_folder/model-loader/pom.xml
50 asserts_file_exist $aai_src_folder/resources/pom.xml
51 asserts_file_exist $aai_src_folder/rest-client/pom.xml
52 asserts_file_exist $aai_src_folder/router-core/pom.xml
53 asserts_file_exist $aai_src_folder/search-data-service/pom.xml
54 asserts_file_exist $aai_src_folder/sparky-be/pom.xml
55 asserts_file_exist $aai_src_folder/sparky-fe/pom.xml
56 asserts_file_exist $aai_src_folder/test-config/docker-compose-app.yml
57 asserts_file_exist $aai_src_folder/traversal/pom.xml
Victor Morales158c18c2017-08-06 11:23:15 -050058}
59
60# test_compile_aai_repos() - Verify that all the AAI Repositories complile properly
61function test_compile_aai_repos {
62 clone_all_aai_repos
Victor Morales158c18c2017-08-06 11:23:15 -050063 compile_aai_repos
64
Victor Morales51e61ce2017-10-12 10:56:35 -070065 for common in annotations auth core schema utils; do
66 asserts_file_exist $aai_src_folder/aai-common/aai-$common/target/aai-$common-1.1.0-SNAPSHOT.jar
67 done
Victor Morales158c18c2017-08-06 11:23:15 -050068
Victor Morales51e61ce2017-10-12 10:56:35 -070069 for service in common-logging eelf-logging logging-api; do
70 asserts_file_exist $aai_src_folder/logging-service/$service/target/$service-1.1.0-SNAPSHOT.jar
71 done
Victor Morales158c18c2017-08-06 11:23:15 -050072
Victor Morales8e08c872017-08-21 16:15:57 -050073 asserts_file_exist $aai_src_folder/resources/aai-resources/target/aai-resources.jar
Victor Morales8e08c872017-08-21 16:15:57 -050074 asserts_file_exist $aai_src_folder/traversal/aai-traversal/target/traversal.jar
Victor Morales158c18c2017-08-06 11:23:15 -050075}
76
77# test_setup_titan() - Verify that Titan Cassandra DB is up and running
78function test_setup_titan {
Victor Morales7ae05a42017-08-22 14:39:00 -050079 clone_all_aai_repos
80 install_hadoop
Victor Morales158c18c2017-08-06 11:23:15 -050081 setup_titan
Victor Morales7ae05a42017-08-22 14:39:00 -050082
83 # TODO(electrocucaracha): Validate the DB creation
Victor Morales158c18c2017-08-06 11:23:15 -050084}
85
86# test_start_aai_microservices() - Verify that AAI Resources and Traversal images works
87function test_start_aai_microservices {
88 clone_all_aai_repos
89 start_aai_microservices
Victor Morales7ae05a42017-08-22 14:39:00 -050090
91 # TODO(electrocucaracha): Investigate how to run AAI microservices in background
Victor Morales158c18c2017-08-06 11:23:15 -050092}
93
94# test_install_hbase() - Verify that AAI HBase service is up and running properly
95function test_install_hbase {
96 install_hbase
97
98 asserts_image_running aai-hbase-${hbase_version}
99}
100
101# test_install_ajsc_aai() - Verify that AJSC AAI service is up and running properly
102function test_install_ajsc_aai {
103 clone_all_aai_repos
104 install_ajsc_aai
105
106 asserts_image_running openecomp/ajsc-aai
107}
108
109# test_install_model_loader() - Verify that Model AAI service is up and running properly
110function test_install_model_loader {
111 clone_all_aai_repos
112 install_model_loader
113
114 asserts_image openecomp/model-loader
115}
116
117if [ "$1" != '*' ]; then
118 unset covered_functions
119 covered_functions=$1
120fi
121main "${covered_functions[@]}"