Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/vid |
| 5 | |
| 6 | covered_functions=( |
| 7 | "clone_all_vid_repos" "compile_all_vid_repos" "get_vid_images" "install_vid" |
| 8 | ) |
| 9 | |
| 10 | # test_clone_all_vid_repos() - Verifies that VID repositories are retrieved properly |
| 11 | function test_clone_all_vid_repos { |
| 12 | clone_all_vid_repos |
| 13 | |
| 14 | asserts_file_exist $vid_src_folder/pom.xml |
| 15 | asserts_file_exist $vid_src_folder/asdcclient/pom.xml |
| 16 | } |
| 17 | |
| 18 | # test_compile_all_vid_repos() - Verifies that VID source code is compiled properly |
| 19 | function test_compile_all_vid_repos { |
| 20 | clone_all_vid_repos |
| 21 | compile_all_vid_repos |
| 22 | |
| 23 | asserts_file_exist $vid_src_folder/asdcclient/target/asdcclient-1.0.2-SNAPSHOT.jar |
| 24 | asserts_file_exist $vid_src_folder/epsdk-app-onap/target/vid.war |
| 25 | asserts_file_exist $vid_src_folder/vid-app-common/target/vid-common.war |
| 26 | } |
| 27 | |
| 28 | # test_get_vid_images() - Verifies that VID Docker images are built properly |
| 29 | function test_get_vid_images { |
| 30 | clone_all_vid_repos |
| 31 | get_vid_images |
| 32 | |
| 33 | asserts_image openecomp/vid |
| 34 | asserts_image mariadb:10 |
| 35 | } |
| 36 | |
| 37 | # test_install_vid() - Verifies taht VID services are up and running |
| 38 | function test_install_vid { |
| 39 | clone_all_vid_repos |
| 40 | get_vid_images |
| 41 | install_vid |
| 42 | |
| 43 | vid_image=`docker images | grep vid | grep latest| awk '{print $1 ":" $2}'` |
| 44 | asserts_image_running $vid_image |
| 45 | } |
| 46 | |
| 47 | if [ "$1" != '*' ]; then |
| 48 | unset covered_functions |
| 49 | covered_functions=$1 |
| 50 | fi |
| 51 | main "${covered_functions[@]}" |