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 { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 12 | clone_repos "vid" |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 13 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 14 | asserts_file_exist ${src_folders[vid]}/pom.xml |
| 15 | asserts_file_exist ${src_folders[vid]}/asdcclient/pom.xml |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | # test_compile_all_vid_repos() - Verifies that VID source code is compiled properly |
| 19 | function test_compile_all_vid_repos { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 20 | clone_repos "vid" |
| 21 | compile_repos "vid" |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 22 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 23 | asserts_file_exist ${src_folders[vid]}/asdcclient/target/asdcclient-1.0.2-SNAPSHOT.jar |
| 24 | asserts_file_exist ${src_folders[vid]}/epsdk-app-onap/target/vid.war |
| 25 | asserts_file_exist ${src_folders[vid]}/vid-app-common/target/vid-common.war |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | # test_get_vid_images() - Verifies that VID Docker images are built properly |
| 29 | function test_get_vid_images { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 30 | clone_repos "vid" |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 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 { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 39 | clone_repos "vid" |
Victor Morales | 7ba7647 | 2017-08-23 15:19:36 -0500 | [diff] [blame] | 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[@]}" |