Victor Morales | 80ef0a4 | 2017-08-21 19:17:07 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/dcae |
| 5 | |
| 6 | covered_functions=( |
| 7 | "clone_all_dcae_repos" "compile_all_dcae_repos" "get_dcae_images" "install_dcae" |
| 8 | ) |
| 9 | |
| 10 | # test_clone_all_dcae_repos() - Verifies that can retrieve DCAE repositories properly |
| 11 | function test_clone_all_dcae_repos { |
| 12 | clone_all_dcae_repos |
| 13 | |
| 14 | asserts_file_exist $dcae_src_folder/apod/README.md |
| 15 | asserts_file_exist $dcae_src_folder/apod/analytics/pom.xml |
| 16 | asserts_file_exist $dcae_src_folder/apod/buildtools/LICENSE.txt |
| 17 | asserts_file_exist $dcae_src_folder/apod/cdap/LICENSE.txt |
| 18 | asserts_file_exist $dcae_src_folder/collectors/README.md |
| 19 | asserts_file_exist $dcae_src_folder/collectors/ves/pom.xml |
| 20 | asserts_file_exist $dcae_src_folder/controller/pom.xml |
| 21 | asserts_file_exist $dcae_src_folder/controller/analytics/pom.xml |
| 22 | asserts_file_exist $dcae_src_folder/dcae-inventory/pom.xml |
| 23 | asserts_file_exist $dcae_src_folder/demo/pom.xml |
| 24 | asserts_file_exist $dcae_src_folder/demo/startup/README.md |
| 25 | asserts_file_exist $dcae_src_folder/demo/startup/aaf/LICENSE.txt |
| 26 | asserts_file_exist $dcae_src_folder/demo/startup/controller/LICENSE.txt |
| 27 | asserts_file_exist $dcae_src_folder/demo/startup/message-router/LICENSE.txt |
| 28 | asserts_file_exist $dcae_src_folder/dmaapbc/pom.xml |
| 29 | asserts_file_exist $dcae_src_folder/operation/README.md |
| 30 | asserts_file_exist $dcae_src_folder/operation/utils/pom.xml |
| 31 | asserts_file_exist $dcae_src_folder/pgaas/LICENSE.txt |
| 32 | asserts_file_exist $dcae_src_folder/utils/README.md |
| 33 | asserts_file_exist $dcae_src_folder/utils/buildtools/LICENSE.txt |
| 34 | } |
| 35 | |
| 36 | # test_compile_all_dcae_repos() - Verify that the DCAE source code is compiled properly |
| 37 | function test_compile_all_dcae_repos { |
| 38 | clone_all_dcae_repos |
| 39 | compile_all_dcae_repos |
| 40 | |
| 41 | asserts_file_exist $dcae_src_folder/collectors/ves/target/VESCollector-1.1.0-SNAPSHOT.jar |
| 42 | |
| 43 | asserts_file_exist $dcae_src_folder/controller/analytics/dcae-analytics-cdap-common-model/target/dcae-analytics-cdap-common-model-1.1.0-SNAPSHOT.jar |
| 44 | |
| 45 | asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-core-model/target/dcae-controller-core-model-1.1.0-SNAPSHOT.jar |
| 46 | asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-core-utils/target/dcae-controller-core-utils-1.1.0-SNAPSHOT.jar |
| 47 | asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-operation-utils/target/dcae-controller-operation-utils-1.1.0-SNAPSHOT.jar |
| 48 | asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-platform-model/target/dcae-controller-platform-model-1.1.0-SNAPSHOT.jar |
| 49 | asserts_file_exist $dcae_src_folder/controller/dcae-controller-core/dcae-controller-platform-server/target/dcae-controller-platform-server-1.1.0-SNAPSHOT.jar |
| 50 | |
| 51 | 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 |
| 52 | 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 |
| 53 | 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 |
| 54 | 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 |
| 55 | 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 |
| 56 | |
| 57 | 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 |
| 58 | 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 |
| 59 | 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 |
| 60 | 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 |
| 61 | |
| 62 | 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 |
| 63 | 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 |
| 64 | 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 |
| 65 | 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 |
| 66 | 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 |
| 67 | 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 |
| 68 | |
| 69 | 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 |
| 70 | 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 |
| 71 | 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 |
| 72 | 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 |
| 73 | |
| 74 | asserts_file_exist $dcae_src_folder/dcae-inventory/target/dcae-inventory-1.1.0.jar |
| 75 | |
| 76 | asserts_file_exist $dcae_src_folder/demo/dcae-demo-controller/target/dcae-demo-controller-1.1.0-SNAPSHOT-runtime.zip |
| 77 | |
| 78 | asserts_file_exist $dcae_src_folder/dmaapbc/target/dcae_dmaapbc.jar |
| 79 | |
| 80 | asserts_file_exist $dcae_src_folder/operation/utils/operation-utils/target/operation-utils-1.1.0-SNAPSHOT.jar |
| 81 | } |
| 82 | |
| 83 | # test_get_dcae_images() - Function that verifies DCAE images are retrieved properly |
| 84 | function test_get_dcae_images { |
| 85 | clone_all_dcae_repos |
| 86 | compile_all_dcae_repos |
| 87 | get_dcae_images |
| 88 | |
| 89 | asserts_image openecomp/dcae-dmaapbc |
| 90 | #asserts_image dcae/orch-dispatcher |
| 91 | asserts_image dcae-controller |
| 92 | asserts_image dcae-inventory |
| 93 | } |
| 94 | |
| 95 | # test_install_dcae() - Function that verifies that DCAE services are up and running |
| 96 | function test_install_dcae { |
| 97 | clone_all_dcae_repos |
| 98 | compile_all_dcae_repos |
| 99 | get_dcae_images |
| 100 | install_dcae |
| 101 | |
| 102 | dcae_image=`docker images | grep dcae-controller | awk '{print $1 ":" $2}'` |
| 103 | asserts_image_running $dcae_image |
| 104 | } |
| 105 | |
| 106 | if [ "$1" != '*' ]; then |
| 107 | unset covered_functions |
| 108 | covered_functions=$1 |
| 109 | fi |
| 110 | main "${covered_functions[@]}" |