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