blob: 10777d678372334ca17bb44e864e6602d74ca5c1 [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
Victor Morales158c18c2017-08-06 11:23:15 -050011# test_install_hadoop() - Verify that Hadoop is downloaded and started properly
12function 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
22function 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
30function test_clone_all_aai_repos {
31 clone_all_aai_repos
32
Victor Morales8e08c872017-08-21 16:15:57 -050033 asserts_file_exist $aai_src_folder/aai-common/pom.xml
34 asserts_file_exist $aai_src_folder/aai-config/cookbooks/aai-resources/runlist-aai-resources.json
35 asserts_file_exist $aai_src_folder/aai-data/environments/solo.json
36 asserts_file_exist $aai_src_folder/aai-service/pom.xml
Victor Morales51e61ce2017-10-12 10:56:35 -070037 asserts_file_exist $aai_src_folder/babel/README.md
38 asserts_file_exist $aai_src_folder/champ/pom.xml
Victor Morales8e08c872017-08-21 16:15:57 -050039 asserts_file_exist $aai_src_folder/data-router/pom.xml
Victor Morales51e61ce2017-10-12 10:56:35 -070040 asserts_file_exist $aai_src_folder/esr-gui/pom.xml
41 asserts_file_exist $aai_src_folder/esr-server/pom.xml
42 asserts_file_exist $aai_src_folder/gizmo/pom.xml
Victor Morales8e08c872017-08-21 16:15:57 -050043 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 Morales158c18c2017-08-06 11:23:15 -050053}
54
55# test_compile_aai_repos() - Verify that all the AAI Repositories complile properly
56function test_compile_aai_repos {
57 clone_all_aai_repos
Victor Morales158c18c2017-08-06 11:23:15 -050058 compile_aai_repos
59
Victor Morales51e61ce2017-10-12 10:56:35 -070060 for common in annotations auth core schema utils; do
61 asserts_file_exist $aai_src_folder/aai-common/aai-$common/target/aai-$common-1.1.0-SNAPSHOT.jar
62 done
Victor Morales158c18c2017-08-06 11:23:15 -050063
Victor Morales51e61ce2017-10-12 10:56:35 -070064 for service in common-logging eelf-logging logging-api; do
65 asserts_file_exist $aai_src_folder/logging-service/$service/target/$service-1.1.0-SNAPSHOT.jar
66 done
Victor Morales158c18c2017-08-06 11:23:15 -050067
Victor Morales8e08c872017-08-21 16:15:57 -050068 asserts_file_exist $aai_src_folder/resources/aai-resources/target/aai-resources.jar
Victor Morales8e08c872017-08-21 16:15:57 -050069 asserts_file_exist $aai_src_folder/traversal/aai-traversal/target/traversal.jar
Victor Morales158c18c2017-08-06 11:23:15 -050070}
71
72# test_setup_titan() - Verify that Titan Cassandra DB is up and running
73function test_setup_titan {
Victor Morales7ae05a42017-08-22 14:39:00 -050074 clone_all_aai_repos
75 install_hadoop
Victor Morales158c18c2017-08-06 11:23:15 -050076 setup_titan
Victor Morales7ae05a42017-08-22 14:39:00 -050077
78 # TODO(electrocucaracha): Validate the DB creation
Victor Morales158c18c2017-08-06 11:23:15 -050079}
80
81# test_start_aai_microservices() - Verify that AAI Resources and Traversal images works
82function test_start_aai_microservices {
83 clone_all_aai_repos
84 start_aai_microservices
Victor Morales7ae05a42017-08-22 14:39:00 -050085
86 # TODO(electrocucaracha): Investigate how to run AAI microservices in background
Victor Morales158c18c2017-08-06 11:23:15 -050087}
88
89# test_install_hbase() - Verify that AAI HBase service is up and running properly
90function test_install_hbase {
91 install_hbase
92
93 asserts_image_running aai-hbase-${hbase_version}
94}
95
96# test_install_ajsc_aai() - Verify that AJSC AAI service is up and running properly
97function test_install_ajsc_aai {
98 clone_all_aai_repos
99 install_ajsc_aai
100
101 asserts_image_running openecomp/ajsc-aai
102}
103
104# test_install_model_loader() - Verify that Model AAI service is up and running properly
105function test_install_model_loader {
106 clone_all_aai_repos
107 install_model_loader
108
109 asserts_image openecomp/model-loader
110}
111
112if [ "$1" != '*' ]; then
113 unset covered_functions
114 covered_functions=$1
115fi
116main "${covered_functions[@]}"