blob: a60145fbf8228c1585a96081a4ce34b4dee0c9a9 [file] [log] [blame]
Victor Moralesdd074802017-07-26 16:06:35 -05001#!/bin/bash
2
3source /var/onap_tests/_test_base
4source /var/onap/sdnc
5
6covered_functions=(
Victor Moralesdbdc30a2017-08-17 11:50:42 -05007"clone_all_sdnc_repos" "compile_all_sdnc_repos" "get_sdnc_images" "install_sdnc"
Victor Moralesdd074802017-07-26 16:06:35 -05008)
9
10# test_clone_all_sdnc_repos() - Verify the source code retrieve of SDNC project
11function test_clone_all_sdnc_repos {
12 clone_all_sdnc_repos
13
Victor Morales65deef22017-08-18 20:53:42 -050014 asserts_file_exist $sdnc_src_folder/core/pom.xml
15 asserts_file_exist $sdnc_src_folder/adaptors/pom.xml
16 asserts_file_exist $sdnc_src_folder/northbound/pom.xml
17 asserts_file_exist $sdnc_src_folder/plugins/pom.xml
18 asserts_file_exist $sdnc_src_folder/oam/pom.xml
Victor Moralesdd074802017-07-26 16:06:35 -050019}
20
21# test_compile_all_sdnc_repos() - Verify the correct compilation of SDNC projects
22function test_compile_all_sdnc_repos {
23 clone_all_sdnc_repos
24 compile_all_sdnc_repos
25
Victor Moralesdbdc30a2017-08-17 11:50:42 -050026 for adaptor in aai-service mdsal-resource resource-assignment sql-resource; do
Victor Morales65deef22017-08-18 20:53:42 -050027 asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/features/target/$adaptor-features-1.1.2-SNAPSHOT.jar
28 asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/installer/target/sdnc-$adaptor-1.1.2-SNAPSHOT-installer.zip
29 asserts_file_exist $sdnc_src_folder/adaptors/$adaptor/provider/target/$adaptor-provider-1.1.2-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050030 done
31
Victor Morales65deef22017-08-18 20:53:42 -050032 asserts_file_exist $sdnc_src_folder/core/dblib/provider/target/dblib-provider-1.1.2-SNAPSHOT.jar
33 asserts_file_exist $sdnc_src_folder/core/rootpom/target/rootpom-1.1.0-site_en.xml
34 asserts_file_exist $sdnc_src_folder/core/target/sdnc-core-1.1.2-SNAPSHOT-site.xml
Victor Moralesdbdc30a2017-08-17 11:50:42 -050035
36 for component in asdcApi dataChange vnfapi vnftools; do
Victor Morales65deef22017-08-18 20:53:42 -050037 asserts_file_exist $sdnc_src_folder/northbound/$component/features/target/$component-features-1.1.2-SNAPSHOT.jar
38 asserts_file_exist $sdnc_src_folder/northbound/$component/installer/target/sdnc-$component-1.1.2-SNAPSHOT-installer.zip
Victor Moralesdbdc30a2017-08-17 11:50:42 -050039 if [[ "$component" != "vnftools" ]]; then
Victor Morales65deef22017-08-18 20:53:42 -050040 asserts_file_exist $sdnc_src_folder/northbound/$component/model/target/$component-model-1.1.2-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050041 fi
Victor Morales65deef22017-08-18 20:53:42 -050042 asserts_file_exist $sdnc_src_folder/northbound/$component/provider/target/$component-provider-1.1.2-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050043 done
Victor Morales65deef22017-08-18 20:53:42 -050044 asserts_file_exist $sdnc_src_folder/northbound/dmaap-listener/target/dmaap-listener-1.1.2-SNAPSHOT.jar
45 asserts_file_exist $sdnc_src_folder/northbound/ueb-listener/target/ueb-listener-1.1.2-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050046
Victor Morales65deef22017-08-18 20:53:42 -050047 asserts_file_exist $sdnc_src_folder/oam/admportal/target/admportal.1.1.2-SNAPSHOT.zip
48 asserts_file_exist $sdnc_src_folder/oam/dgbuilder/target/dgbuilder.1.1.2-SNAPSHOT.zip
49 asserts_file_exist $sdnc_src_folder/oam/platform-logic/installer/target/platform-logic-installer-1.1.2-SNAPSHOT.zip
Victor Moralesdbdc30a2017-08-17 11:50:42 -050050
51 for plugin in properties-node restapi-call-node; do
Victor Morales65deef22017-08-18 20:53:42 -050052 asserts_file_exist $sdnc_src_folder/plugins/$plugin/features/target/$plugin-features-1.1.2-SNAPSHOT.jar
53 asserts_file_exist $sdnc_src_folder/plugins/$plugin/installer/target/sdnc-$plugin-1.1.2-SNAPSHOT-installer.zip
54 asserts_file_exist $sdnc_src_folder/plugins/$plugin/provider/target/$plugin-provider-1.1.2-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050055 done
Victor Moralesdd074802017-07-26 16:06:35 -050056}
57
58# test_get_sdnc_images() - Verify that the SDNC images are created or retrieved
59function test_get_sdnc_images {
60 clone_all_sdnc_repos
61 get_sdnc_images
62
63 asserts_image openecomp/sdnc-image
64 asserts_image openecomp/admportal-sdnc-image
65 asserts_image openecomp/dgbuilder-sdnc-image
Victor Moralesdbdc30a2017-08-17 11:50:42 -050066 asserts_image mysql/mysql-server:5.6
67}
68
69# test_install_sdnc() - Verify that the SDNC Docker containers are up and running
70function test_install_sdnc {
71 clone_all_sdnc_repos
72 get_sdnc_images
73 install_sdnc
74
75 asserts_image_running openecomp/dgbuilder-sdnc-image
76 asserts_image_running openecomp/admportal-sdnc-image
77 asserts_image_running openecomp/sdnc-image
78 asserts_image_running mysql/mysql-server:5.6
Victor Moralesdd074802017-07-26 16:06:35 -050079}
80
81if [ "$1" != '*' ]; then
82 unset covered_functions
83 covered_functions=$1
84fi
85main "${covered_functions[@]}"