blob: 67657803e0b3ded4c3ba301f93e222172f5c9d8c [file] [log] [blame]
Victor Moralese7467002017-08-30 14:50:43 -05001#!/bin/bash
2
3source /var/onap_tests/_test_base
Victor Moralesdbe2e0b2017-09-20 09:55:45 -07004source /var/onap/sdc
Victor Moralese7467002017-08-30 14:50:43 -05005
6covered_functions=(
7"clone_all_sdc_repos" "compile_all_sdc_repos" "get_sdc_images" "install_sdc"
8)
9
10# test_clone_all_sdc_repos() - Verifies the retrieval of SDC source code repos
11function test_clone_all_sdc_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080012 clone_repos "sdc"
Victor Moralese7467002017-08-30 14:50:43 -050013
Victor Morales54646642017-12-08 11:57:42 -080014 asserts_file_exist ${src_folders[sdc]}/pom.xml
15 asserts_file_exist ${src_folders[sdc]}/sdc-os-chef/pom.xml
16 asserts_file_exist ${src_folders[sdc]}/jtosca/pom.xml
17 asserts_file_exist ${src_folders[sdc]}/sdc-distribution-client/pom.xml
18 asserts_file_exist ${src_folders[sdc]}/sdc-titan-cassandra/pom.xml
19 asserts_file_exist ${src_folders[sdc]}/sdc-tosca/pom.xml
20 asserts_file_exist ${src_folders[sdc]}/sdc_common/pom.xml
Victor Moralese7467002017-08-30 14:50:43 -050021}
22
23# test_compile_all_sdc_repos() - Verifies the correct compilation of SDC repositories
24function test_compile_all_sdc_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080025 clone_repos "sdc"
26 compile_repos "sdc"
Victor Moralese7467002017-08-30 14:50:43 -050027
Victor Morales54646642017-12-08 11:57:42 -080028 #asserts_file_exist ${src_folders[sdc]}/jtosca/target/jtosca-1.1.10-SNAPSHOT.jar
29 #asserts_file_exist ${src_folders[sdc]}/sdc-distribution-client/sdc-distribution-ci/target/sdc-distribution-ci-1.1.*-SNAPSHOT.jar
30 #asserts_file_exist ${src_folders[sdc]}/sdc-distribution-client/sdc-distribution-client/target/sdc-distribution-client-1.1.*-SNAPSHOT.jar
31 #asserts_file_exist ${src_folders[sdc]}/sdc-titan-cassandra/target/jamm-0.3.0.jar
32 #asserts_file_exist ${src_folders[sdc]}/sdc-tosca/target/sdc-tosca-1.1.*-SNAPSHOT.jar
Victor Moralese7467002017-08-30 14:50:43 -050033
Victor Moralesf1f1ba52017-11-20 16:38:28 -080034 #for dirc in logging sdc-artifact-generator; do
35 for dirc in logging; do
Victor Moralese7467002017-08-30 14:50:43 -050036 name="openecomp-$dirc"
37 for module in api core; do
38 fullname="$name-$module"
Victor Morales54646642017-12-08 11:57:42 -080039 asserts_file_exist ${src_folders[sdc]}/sdc_common/$name-lib/$fullname/target/$fullname-1.1.0-SNAPSHOT.jar
Victor Moralese7467002017-08-30 14:50:43 -050040 done
41 done
42}
43
44# test_get_sdc_images() - Verifies the correct retrieval of SDC Docker images
45function test_get_sdc_images {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080046 clone_repos "sdc"
Victor Moralese7467002017-08-30 14:50:43 -050047 get_sdc_images
48
Victor Moralesdbe2e0b2017-09-20 09:55:45 -070049 for image in sanity elasticsearch cassandra kibana frontend backend; do
50 asserts_image openecomp/base_sdc-$image
Victor Moralese7467002017-08-30 14:50:43 -050051 done
52}
53
54# test_install_sdc() - Verifies that SDC services are up and running
55function test_install_sdc {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080056 clone_repos "sdc"
Victor Moralese7467002017-08-30 14:50:43 -050057 get_sdc_images
58 install_sdc
59
Victor Moralesdbe2e0b2017-09-20 09:55:45 -070060 for image in elasticsearch cassandra kibana frontend backend; do
61 asserts_image_running openecomp/base_sdc-$image
Victor Moralese7467002017-08-30 14:50:43 -050062 done
63}
64
65if [ "$1" != '*' ]; then
66 unset covered_functions
67 covered_functions=$1
68fi
69main "${covered_functions[@]}"