Merge "Fix for sdc csit sanity test"
[integration.git] / bootstrap / vagrant-onap / tests / test_aai
1 #!/bin/bash
2
3 source /var/onap_tests/_test_base
4 source /var/onap/aai
5
6 covered_functions=(
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"
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
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/babel/README.md
43     asserts_file_exist $aai_src_folder/champ/pom.xml
44     asserts_file_exist $aai_src_folder/data-router/pom.xml
45     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
48     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
58 }
59
60 # test_compile_aai_repos() - Verify that all the AAI Repositories complile properly
61 function test_compile_aai_repos {
62     clone_all_aai_repos
63     compile_aai_repos
64
65     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
68
69     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
72
73     asserts_file_exist $aai_src_folder/resources/aai-resources/target/aai-resources.jar
74     asserts_file_exist $aai_src_folder/traversal/aai-traversal/target/traversal.jar
75 }
76
77 # test_setup_titan() - Verify that Titan Cassandra DB is up and running
78 function test_setup_titan {
79     clone_all_aai_repos
80     install_hadoop
81     setup_titan
82
83     # TODO(electrocucaracha): Validate the DB creation
84 }
85
86 # test_start_aai_microservices() - Verify that AAI Resources and Traversal images works
87 function test_start_aai_microservices {
88     clone_all_aai_repos
89     start_aai_microservices
90
91     # TODO(electrocucaracha): Investigate how to run AAI microservices in background
92 }
93
94 # test_install_hbase() - Verify that AAI HBase service is up and running properly
95 function 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
102 function 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
110 function test_install_model_loader {
111     clone_all_aai_repos
112     install_model_loader
113
114     asserts_image openecomp/model-loader
115 }
116
117 if [ "$1" != '*' ]; then
118     unset covered_functions
119     covered_functions=$1
120 fi
121 main "${covered_functions[@]}"