Refactor VFC UTs 25/7925/1
authorVictor Morales <victor.morales@intel.com>
Thu, 17 Aug 2017 19:55:55 +0000 (14:55 -0500)
committerVictor Morales <victor.morales@intel.com>
Thu, 17 Aug 2017 20:01:11 +0000 (15:01 -0500)
It was refactored the Unit tests and functions of VFC scripts

Change-Id: I9e7ba61ace7830c62b52556922e0ec2b4d9efa91
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-105

bootstrap/vagrant-onap/lib/vfc
bootstrap/vagrant-onap/tests/test_vfc

index 90a73af..13e3015 100755 (executable)
@@ -3,8 +3,8 @@
 set -o xtrace
 
 source /var/onap/functions
-src_folder=$git_src_folder/vfc
 
+src_folder=$git_src_folder/vfc
 vfc_repos=("gvnfm/vnflcm" "gvnfm/vnfmgr" "gvnfm/vnfres" "nfvo/catalog" "nfvo/driver/ems" "nfvo/driver/sfc" \
             "nfvo/driver/vnfm/gvnfm" "nfvo/driver/vnfm/svnfm" "nfvo/lcm" "nfvo/resmanagement" "nfvo/wfengine")
 
@@ -44,17 +44,18 @@ function compile_all_vfc_repos {
 
 # install_vfc() - Download and install vfc service from source code
 function install_vfc {
-    clone_all_vfc_repos
-    if [[ "$compile_repo" == "False" ]]; then
-        compile_all_vfc_repos
-    fi
-
     # TODO(sshank): Add further installation steps if necessary.
+    echo ""
 }
 
 # init_vfc() - Function that initialize VF-C services
 function init_vfc {
-    install_python
     install_package libmysqlclient-dev
+
+    clone_all_vfc_repos
+    if [[ "$compile_repo" == "False" ]]; then
+        compile_all_vfc_repos
+    fi
+
     install_vfc
 }
index 2f71cf1..3382809 100644 (file)
@@ -4,7 +4,7 @@ source /var/onap_tests/_test_base
 source /var/onap/vfc
 
 covered_functions=(
-"clone_all_vfc_repos"
+"clone_all_vfc_repos" "compile_all_vfc_repos" "install_vfc"
 )
 
 # test_clone_all_vfc_repos() - Verify cloning and pulling source code from repositories
@@ -13,6 +13,21 @@ function test_clone_all_vfc_repos {
     echo ""
 }
 
+# test_compile_all_vfc_repos() - Verify that all the VFC modules are compiled properly
+function test_compile_all_vfc_repos {
+    clone_all_vfc_repos
+    compile_all_vfc_repos
+
+    # TODO(electrocucaracha): Add asserts_file_exist
+}
+
+# test_install_vfc() - Verify that the VFC are up and running
+function test_install_vfc {
+    install_vfc
+
+    # TODO(electrocucaracha): Add whatever asserts are needed
+}
+
 if [ "$1" != '*' ]; then
     unset covered_functions
     covered_functions=$1