blob: 7b54749dd36a7d6d80164adb33f043acf8142977 [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/adaptors/pom.xml
Victor Moralesf6c0bf12017-10-27 11:08:04 -070015 asserts_file_exist $sdnc_src_folder/architecture/docs/index.rst
Victor Moralesa81fafc2017-09-21 13:55:36 -070016 asserts_file_exist $sdnc_src_folder/core/pom.xml
Victor Moralesf6c0bf12017-10-27 11:08:04 -070017 asserts_file_exist $sdnc_src_folder/features/docs/index.rst
Victor Morales65deef22017-08-18 20:53:42 -050018 asserts_file_exist $sdnc_src_folder/northbound/pom.xml
Victor Morales65deef22017-08-18 20:53:42 -050019 asserts_file_exist $sdnc_src_folder/oam/pom.xml
Victor Moralesf6c0bf12017-10-27 11:08:04 -070020 asserts_file_exist $sdnc_src_folder/parent/docs/index.rst
Victor Moralesa81fafc2017-09-21 13:55:36 -070021 asserts_file_exist $sdnc_src_folder/plugins/pom.xml
Victor Moralesdd074802017-07-26 16:06:35 -050022}
23
24# test_compile_all_sdnc_repos() - Verify the correct compilation of SDNC projects
25function test_compile_all_sdnc_repos {
26 clone_all_sdnc_repos
27 compile_all_sdnc_repos
28
Victor Moralesa81fafc2017-09-21 13:55:36 -070029 for component in generic-resource-api vnfapi vnftools; do
Victor Moralesf6c0bf12017-10-27 11:08:04 -070030 if [[ "$component" == "vnfapi" ]]; then
31 asserts_file_exist $sdnc_src_folder/northbound/vnfapi/model/target/vnfapi-model-1.2.0-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050032 fi
Victor Moralesf6c0bf12017-10-27 11:08:04 -070033 asserts_file_exist $sdnc_src_folder/northbound/$component/installer/target/sdnc-$component-1.2.0-SNAPSHOT-installer.zip
34 asserts_file_exist $sdnc_src_folder/northbound/$component/features/target/$component-features-1.2.0-SNAPSHOT.jar
35 asserts_file_exist $sdnc_src_folder/northbound/$component/provider/target/$component-provider-1.2.0-SNAPSHOT.jar
Victor Moralesdbdc30a2017-08-17 11:50:42 -050036 done
Victor Moralesa81fafc2017-09-21 13:55:36 -070037 asserts_file_exist $sdnc_src_folder/oam/admportal/target/admportal.*-SNAPSHOT.zip
38 asserts_file_exist $sdnc_src_folder/oam/dgbuilder/target/dgbuilder.*-SNAPSHOT.zip
39 asserts_file_exist $sdnc_src_folder/oam/platform-logic/installer/target/platform-logic-installer-*-SNAPSHOT.zip
Victor Moralesdd074802017-07-26 16:06:35 -050040}
41
42# test_get_sdnc_images() - Verify that the SDNC images are created or retrieved
43function test_get_sdnc_images {
44 clone_all_sdnc_repos
45 get_sdnc_images
46
Victor Morales664e6e92017-09-14 12:11:23 -070047 asserts_image onap/sdnc-image
48 asserts_image onap/admportal-sdnc-image
49 asserts_image onap/dgbuilder-sdnc-image
Victor Moralesdbdc30a2017-08-17 11:50:42 -050050 asserts_image mysql/mysql-server:5.6
51}
52
53# test_install_sdnc() - Verify that the SDNC Docker containers are up and running
54function test_install_sdnc {
55 clone_all_sdnc_repos
56 get_sdnc_images
57 install_sdnc
58
Victor Morales664e6e92017-09-14 12:11:23 -070059 asserts_image_running onap/ccsdk-dgbuilder-image
60 asserts_image_running onap/admportal-sdnc-image
61 asserts_image_running onap/sdnc-image
Victor Moralesdbdc30a2017-08-17 11:50:42 -050062 asserts_image_running mysql/mysql-server:5.6
Victor Moralesdd074802017-07-26 16:06:35 -050063}
64
65if [ "$1" != '*' ]; then
66 unset covered_functions
67 covered_functions=$1
68fi
69main "${covered_functions[@]}"