summaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/test_dcae
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-08-21 19:17:07 -0500
committerVictor Morales <victor.morales@intel.com>2017-08-21 19:17:07 -0500
commit80ef0a4494b2b86c96efce2c2c16c26862e68444 (patch)
tree1d9133a30df9231c0714d0bb938b5a26957c4d0e /bootstrap/vagrant-onap/tests/test_dcae
parent9c0b46832ff031e337a13358eb83752c853aa1fc (diff)
Add DCAE UTs
This change adds the Unit Tests that verify the functionality of DCAE scripts and makes proper changes to refactor the lib/dcae source code. Change-Id: I0a6c000ddf1ff29bd094e8bc552e6bea5ef3e8ec Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-Id: INT-22
Diffstat (limited to 'bootstrap/vagrant-onap/tests/test_dcae')
-rw-r--r--bootstrap/vagrant-onap/tests/test_dcae110
1 files changed, 110 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/tests/test_dcae b/bootstrap/vagrant-onap/tests/test_dcae
new file mode 100644
index 000000000..104cadd12
--- /dev/null
+++ b/bootstrap/vagrant-onap/tests/test_dcae
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+source /var/onap_tests/_test_base
+source /var/onap/dcae
+
+covered_functions=(
+"clone_all_dcae_repos" "compile_all_dcae_repos" "get_dcae_images" "install_dcae"
+)
+
+# test_clone_all_dcae_repos() - Verifies that can retrieve DCAE repositories properly
+function test_clone_all_dcae_repos {
+ clone_all_dcae_repos
+
+ asserts_file_exist $dcae_src_folder/apod/README.md
+ asserts_file_exist $dcae_src_folder/apod/analytics/pom.xml
+ asserts_file_exist $dcae_src_folder/apod/buildtools/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/apod/cdap/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/collectors/README.md
+ asserts_file_exist $dcae_src_folder/collectors/ves/pom.xml
+ asserts_file_exist $dcae_src_folder/controller/pom.xml
+ asserts_file_exist $dcae_src_folder/controller/analytics/pom.xml
+ asserts_file_exist $dcae_src_folder/dcae-inventory/pom.xml
+ asserts_file_exist $dcae_src_folder/demo/pom.xml
+ asserts_file_exist $dcae_src_folder/demo/startup/README.md
+ asserts_file_exist $dcae_src_folder/demo/startup/aaf/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/demo/startup/controller/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/demo/startup/message-router/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/dmaapbc/pom.xml
+ asserts_file_exist $dcae_src_folder/operation/README.md
+ asserts_file_exist $dcae_src_folder/operation/utils/pom.xml
+ asserts_file_exist $dcae_src_folder/pgaas/LICENSE.txt
+ asserts_file_exist $dcae_src_folder/utils/README.md
+ asserts_file_exist $dcae_src_folder/utils/buildtools/LICENSE.txt
+}
+
+# test_compile_all_dcae_repos() - Verify that the DCAE source code is compiled properly
+function test_compile_all_dcae_repos {
+ clone_all_dcae_repos
+ compile_all_dcae_repos
+
+ asserts_file_exist $dcae_src_folder/collectors/ves/target/VESCollector-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/analytics/dcae-analytics-cdap-common-model/target/dcae-analytics-cdap-common-model-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-core-model/target/dcae-controller-core-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-core-utils/target/dcae-controller-core-utils-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-operation-utils/target/dcae-controller-operation-utils-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-platform-model/target/dcae-controller-platform-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-platform-server/target/dcae-controller-platform-server-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-manager/target/dcae-controller-service-dmaap-drsub-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service/dcae-controller-service-dmaap-drsub/dcae-controller-service-dmaap-drsub-model/target/dcae-controller-service-dmaap-drsub-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-manager/target/dcae-controller-service-standardeventcollector-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service/dcae-controller-service-standardeventcollector/dcae-controller-service-standardeventcollector-model/target/dcae-controller-service-standardeventcollector-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service/dcae-controller-service-storage-postgres-model/target/dcae-controller-service-storage-postgres-model-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-cdap/dcae-controller-service-cdap-adaptor/target/dcae-controller-service-cdap-adaptor-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-manager/target/dcae-controller-service-cdap-cluster-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-cdap/dcae-controller-service-cdap-cluster/dcae-controller-service-cdap-cluster-model/target/dcae-controller-service-cdap-cluster-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-cdap/dcae-controller-service-cdap-model/target/dcae-controller-service-cdap-model-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/target/dcae-controller-service-common-docker-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-model/target/dcae-controller-service-common-docker-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/target/dcae-controller-service-docker-adaptor-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-docker-host/dcae-controller-service-docker-host-manager/target/dcae-controller-service-docker-host-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-docker-host/dcae-controller-service-docker-host-model/target/dcae-controller-service-docker-host-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-docker/dcae-controller-service-docker-model/target/dcae-controller-service-docker-model-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-manager/target/dcae-controller-service-common-vm-manager-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-vm/dcae-controller-service-common-vm/dcae-controller-service-common-vm-model/target/dcae-controller-service-common-vm-model-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/target/dcae-controller-service-vm-adaptor-1.1.0-SNAPSHOT.jar
+ asserts_file_exist $dcae_src_folder/controller/dcae-controller-service-vm/dcae-controller-service-vm-model/target/dcae-controller-service-vm-model-1.1.0-SNAPSHOT.jar
+
+ asserts_file_exist $dcae_src_folder/dcae-inventory/target/dcae-inventory-1.1.0.jar
+
+ asserts_file_exist $dcae_src_folder/demo/dcae-demo-controller/target/dcae-demo-controller-1.1.0-SNAPSHOT-runtime.zip
+
+ asserts_file_exist $dcae_src_folder/dmaapbc/target/dcae_dmaapbc.jar
+
+ asserts_file_exist $dcae_src_folder/operation/utils/operation-utils/target/operation-utils-1.1.0-SNAPSHOT.jar
+}
+
+# test_get_dcae_images() - Function that verifies DCAE images are retrieved properly
+function test_get_dcae_images {
+ clone_all_dcae_repos
+ compile_all_dcae_repos
+ get_dcae_images
+
+ asserts_image openecomp/dcae-dmaapbc
+ #asserts_image dcae/orch-dispatcher
+ asserts_image dcae-controller
+ asserts_image dcae-inventory
+}
+
+# test_install_dcae() - Function that verifies that DCAE services are up and running
+function test_install_dcae {
+ clone_all_dcae_repos
+ compile_all_dcae_repos
+ get_dcae_images
+ install_dcae
+
+ dcae_image=`docker images | grep dcae-controller | awk '{print $1 ":" $2}'`
+ asserts_image_running $dcae_image
+}
+
+if [ "$1" != '*' ]; then
+ unset covered_functions
+ covered_functions=$1
+fi
+main "${covered_functions[@]}"