blob: 79a415242aa7a8a8754e78d310da1d0a39cf8bae [file] [log] [blame]
Victor Morales7ba76472017-08-23 15:19:36 -05001#!/bin/bash
2
3source /var/onap_tests/_test_base
4source /var/onap/vid
5
6covered_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
11function test_clone_all_vid_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080012 clone_repos "vid"
Victor Morales7ba76472017-08-23 15:19:36 -050013
Victor Morales54646642017-12-08 11:57:42 -080014 asserts_file_exist ${src_folders[vid]}/pom.xml
15 asserts_file_exist ${src_folders[vid]}/asdcclient/pom.xml
Victor Morales7ba76472017-08-23 15:19:36 -050016}
17
18# test_compile_all_vid_repos() - Verifies that VID source code is compiled properly
19function test_compile_all_vid_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080020 clone_repos "vid"
21 compile_repos "vid"
Victor Morales7ba76472017-08-23 15:19:36 -050022
Victor Morales54646642017-12-08 11:57:42 -080023 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 Morales7ba76472017-08-23 15:19:36 -050026}
27
28# test_get_vid_images() - Verifies that VID Docker images are built properly
29function test_get_vid_images {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080030 clone_repos "vid"
Victor Morales7ba76472017-08-23 15:19:36 -050031 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
38function test_install_vid {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080039 clone_repos "vid"
Victor Morales7ba76472017-08-23 15:19:36 -050040 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
47if [ "$1" != '*' ]; then
48 unset covered_functions
49 covered_functions=$1
50fi
51main "${covered_functions[@]}"