Merge "Lifted requirements.pip one level up to meet the basic structure of OpenStack...
authorMorgan Richomme <morgan.richomme@orange.com>
Mon, 28 Nov 2016 16:34:17 +0000 (16:34 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 28 Nov 2016 16:34:17 +0000 (16:34 +0000)
76 files changed:
functest/ci/config_functest.yaml
functest/ci/exec_test.sh
functest/ci/testcases.yaml
functest/opnfv_tests/features/domino.py
functest/opnfv_tests/features/sdnvpn.py
functest/opnfv_tests/openstack/__init__.py [moved from functest/opnfv_tests/Controllers/ODL/__init__.py with 100% similarity]
functest/opnfv_tests/openstack/examples/create_instance_and_ip.py [moved from functest/opnfv_tests/OpenStack/examples/create_instance_and_ip.py with 100% similarity]
functest/opnfv_tests/openstack/healthcheck/healthcheck.sh [moved from functest/opnfv_tests/OpenStack/healthcheck/healthcheck.sh with 100% similarity]
functest/opnfv_tests/openstack/rally/blacklist.txt [moved from functest/opnfv_tests/OpenStack/rally/blacklist.txt with 100% similarity]
functest/opnfv_tests/openstack/rally/macro/macro.yaml [moved from functest/opnfv_tests/OpenStack/rally/macro/macro.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/run_rally-cert.py [moved from functest/opnfv_tests/OpenStack/rally/run_rally-cert.py with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/full/opnfv-cinder.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/full/opnfv-heat.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/full/opnfv-heat.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/full/opnfv-neutron.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/full/opnfv-neutron.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/full/opnfv-nova.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/full/opnfv-nova.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-authenticate.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-authenticate.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-glance.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-glance.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-keystone.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-keystone.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-quotas.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-quotas.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-requests.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-requests.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/opnfv-vm.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/opnfv-vm.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/sanity/opnfv-cinder.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/sanity/opnfv-cinder.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/sanity/opnfv-heat.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/sanity/opnfv-heat.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/sanity/opnfv-neutron.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/sanity/opnfv-neutron.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/sanity/opnfv-nova.yaml [moved from functest/opnfv_tests/OpenStack/rally/scenario/sanity/opnfv-nova.yaml with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/support/instance_dd_test.sh [moved from functest/opnfv_tests/OpenStack/rally/scenario/support/instance_dd_test.sh with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/autoscaling_policy.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/autoscaling_policy.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/default.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/default.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/random_strings.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/random_strings.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/resource_group.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/resource_group.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/server_with_ports.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/server_with_ports.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/server_with_volume.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/server_with_volume.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_autoscaling_policy_inplace.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_autoscaling_policy_inplace.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_random_strings_add.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_random_strings_add.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_random_strings_delete.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_random_strings_delete.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_random_strings_replace.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_random_strings_replace.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_resource_group_increase.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_resource_group_increase.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/scenario/templates/updated_resource_group_reduce.yaml.template [moved from functest/opnfv_tests/OpenStack/rally/scenario/templates/updated_resource_group_reduce.yaml.template with 100% similarity]
functest/opnfv_tests/openstack/rally/task.yaml [moved from functest/opnfv_tests/OpenStack/rally/task.yaml with 100% similarity]
functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt [moved from functest/opnfv_tests/OpenStack/tempest/custom_tests/blacklist.txt with 100% similarity]
functest/opnfv_tests/openstack/tempest/custom_tests/defcore_req.txt [moved from functest/opnfv_tests/OpenStack/tempest/custom_tests/defcore_req.txt with 100% similarity]
functest/opnfv_tests/openstack/tempest/gen_tempest_conf.py [moved from functest/opnfv_tests/OpenStack/tempest/gen_tempest_conf.py with 100% similarity]
functest/opnfv_tests/openstack/tempest/run_tempest.py [moved from functest/opnfv_tests/OpenStack/tempest/run_tempest.py with 100% similarity]
functest/opnfv_tests/openstack/vping/__init__.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/__init__.py with 100% similarity]
functest/opnfv_tests/openstack/vping/ping.sh [moved from functest/opnfv_tests/OpenStack/vPing/ping.sh with 100% similarity]
functest/opnfv_tests/openstack/vping/vping_base.py [moved from functest/opnfv_tests/OpenStack/vPing/vping_base.py with 100% similarity]
functest/opnfv_tests/openstack/vping/vping_ssh.py [moved from functest/opnfv_tests/OpenStack/vPing/vping_ssh.py with 99% similarity]
functest/opnfv_tests/openstack/vping/vping_userdata.py [moved from functest/opnfv_tests/OpenStack/vPing/vping_userdata.py with 100% similarity]
functest/opnfv_tests/sdn/__init__.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/adapters/__init__.py with 100% similarity]
functest/opnfv_tests/sdn/odl/__init__.py [moved from functest/opnfv_tests/Controllers/__init__.py with 100% similarity]
functest/opnfv_tests/sdn/odl/odl.py [moved from functest/opnfv_tests/Controllers/ODL/OpenDaylightTesting.py with 97% similarity]
functest/opnfv_tests/sdn/onos/sfc/README.md [moved from functest/opnfv_tests/Controllers/ONOS/Sfc/README.md with 100% similarity]
functest/opnfv_tests/sdn/onos/sfc/sfc.py [moved from functest/opnfv_tests/Controllers/ONOS/Sfc/Sfc.py with 99% similarity]
functest/opnfv_tests/sdn/onos/sfc/sfc_onos.py [moved from functest/opnfv_tests/Controllers/ONOS/Sfc/Sfc_fun.py with 99% similarity]
functest/opnfv_tests/sdn/onos/teston/Readme.txt [moved from functest/opnfv_tests/Controllers/ONOS/Teston/Readme.txt with 100% similarity]
functest/opnfv_tests/sdn/onos/teston/__init__.py [moved from functest/opnfv_tests/OpenStack/__init__.py with 100% similarity]
functest/opnfv_tests/sdn/onos/teston/adapters/__init__.py [moved from functest/opnfv_tests/OpenStack/vPing/__init__.py with 100% similarity]
functest/opnfv_tests/sdn/onos/teston/adapters/client.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/adapters/client.py with 95% similarity]
functest/opnfv_tests/sdn/onos/teston/adapters/connection.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/adapters/connection.py with 98% similarity]
functest/opnfv_tests/sdn/onos/teston/adapters/environment.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/adapters/environment.py with 98% similarity]
functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/adapters/foundation.py with 97% similarity]
functest/opnfv_tests/sdn/onos/teston/dependencies/onos [moved from functest/opnfv_tests/Controllers/ONOS/Teston/dependencies/onos with 100% similarity]
functest/opnfv_tests/sdn/onos/teston/log/gitignore [moved from functest/opnfv_tests/Controllers/ONOS/Teston/log/gitignore with 100% similarity]
functest/opnfv_tests/sdn/onos/teston/onos.py [moved from functest/opnfv_tests/Controllers/ONOS/Teston/onosfunctest.py with 100% similarity]
functest/opnfv_tests/vnf/__init__.py [new file with mode: 0644]
functest/opnfv_tests/vnf/ims/clearwater.py [moved from functest/opnfv_tests/vnf/vIMS/clearwater.py with 99% similarity]
functest/opnfv_tests/vnf/ims/create_venv.sh [moved from functest/opnfv_tests/vnf/vIMS/create_venv.sh with 100% similarity]
functest/opnfv_tests/vnf/ims/orchestrator.py [moved from functest/opnfv_tests/vnf/vIMS/orchestrator.py with 99% similarity]
functest/opnfv_tests/vnf/ims/requirements.pip [moved from functest/opnfv_tests/vnf/vIMS/requirements.pip with 100% similarity]
functest/opnfv_tests/vnf/ims/vims.py [moved from functest/opnfv_tests/vnf/vIMS/vIMS.py with 98% similarity]
functest/opnfv_tests/vnf/rnc/__init__.py [new file with mode: 0644]
functest/opnfv_tests/vnf/rnc/parser.py [new file with mode: 0644]
functest/opnfv_tests/vnf/vRNC/parser.py [deleted file]
functest/tests/unit/odl/test_odl.py
functest/utils/functest_constants.py
run_unit_tests.sh

index a19139c..c75afda 100755 (executable)
@@ -1,13 +1,13 @@
 general:\r
     directories:\r
         # Relative to the path where the repo is cloned:\r
-        dir_vping:         functest/opnfv_tests/OpenStack/vPing\r
-        dir_odl:           functest/opnfv_tests/Controllers/ODL\r
-        dir_rally:         functest/opnfv_tests/OpenStack/rally\r
-        dir_tempest_cases: functest/opnfv_tests/OpenStack/tempest/custom_tests\r
-        dir_vIMS:          functest/opnfv_tests/vnf/vIMS\r
-        dir_onos:          functest/opnfv_tests/Controllers/ONOS/Teston\r
-        dir_onos_sfc:      functest/opnfv_tests/Controllers/ONOS/Sfc\r
+        dir_vping:         functest/opnfv_tests/openstack/vping\r
+        dir_odl:           functest/opnfv_tests/sdn/odl\r
+        dir_rally:         functest/opnfv_tests/openstack/rally\r
+        dir_tempest_cases: functest/opnfv_tests/openstack/tempest/custom_tests\r
+        dir_vIMS:          functest/opnfv_tests/vnf/ims\r
+        dir_onos:          functest/opnfv_tests/sdn/onos/teston\r
+        dir_onos_sfc:      functest/opnfv_tests/sdn/onos/sfc\r
 \r
         # Absolute path\r
         dir_home:           /home/opnfv\r
index cc885c4..913ce08 100644 (file)
@@ -82,40 +82,40 @@ function run_test(){
 
     case $test_name in
         "healthcheck")
-            ${FUNCTEST_TEST_DIR}/OpenStack/healthcheck/healthcheck.sh
+            ${FUNCTEST_TEST_DIR}/openstack/healthcheck/healthcheck.sh
         ;;
         "odl")
             odl_tests
             [[ "$report" == "-r" ]] && args=-p
-            ${FUNCTEST_TEST_DIR}/Controllers/ODL/OpenDaylightTesting.py \
+            ${FUNCTEST_TEST_DIR}/sdn/odl/odl.py \
                 --keystoneip $keystone_ip --neutronip $neutron_ip \
                 --osusername ${OS_USERNAME} --ostenantname ${OS_TENANT_NAME} \
                 --ospassword ${OS_PASSWORD} \
                 --odlip $odl_ip --odlwebport $odl_port ${args}
         ;;
         "tempest_smoke_serial")
-            python ${FUNCTEST_TEST_DIR}/OpenStack/tempest/run_tempest.py \
+            python ${FUNCTEST_TEST_DIR}/openstack/tempest/run_tempest.py \
                 $clean_flag -s -m smoke $report
         ;;
         "tempest_full_parallel")
-            python ${FUNCTEST_TEST_DIR}/OpenStack/tempest/run_tempest.py \
+            python ${FUNCTEST_TEST_DIR}/openstack/tempest/run_tempest.py \
                 $serial_flag $clean_flag -m full $report
         ;;
         "vims")
-            python ${FUNCTEST_TEST_DIR}/vnf/vIMS/vIMS.py $clean_flag $report
+            python ${FUNCTEST_TEST_DIR}/vnf/ims/vims.py $clean_flag $report
         ;;
         "rally_full")
-            python ${FUNCTEST_TEST_DIR}/OpenStack/rally/run_rally-cert.py $clean_flag all $report
+            python ${FUNCTEST_TEST_DIR}/openstack/rally/run_rally-cert.py $clean_flag all $report
         ;;
         "rally_sanity")
-            python ${FUNCTEST_TEST_DIR}/OpenStack/rally/run_rally-cert.py \
+            python ${FUNCTEST_TEST_DIR}/openstack/rally/run_rally-cert.py \
                 $clean_flag --sanity all $report
         ;;
         "onos")
-            python ${FUNCTEST_TEST_DIR}/Controllers/ONOS/Teston/onosfunctest.py
+            python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py
         ;;
         "onos_sfc")
-            python ${FUNCTEST_TEST_DIR}/Controllers/ONOS/Teston/onosfunctest.py -t sfc
+            python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py -t sfc
         ;;
         "promise")
             python ${FUNCTEST_TEST_DIR}/features/promise.py $report
@@ -141,10 +141,10 @@ function run_test(){
             python ${REPOS_DIR}/moon/tests/run_tests.py $report
         ;;
         "multisite")
-            python ${FUNCTEST_TEST_DIR}/OpenStack/tempest/gen_tempest_conf.py
-            python ${FUNCTEST_TEST_DIR}/OpenStack/tempest/run_tempest.py \
+            python ${FUNCTEST_TEST_DIR}/openstack/tempest/gen_tempest_conf.py
+            python ${FUNCTEST_TEST_DIR}/openstack/tempest/run_tempest.py \
                 $clean_flag -s -m feature_multisite $report \
-                -c ${FUNCTEST_TEST_DIR}/OpenStack/tempest/tempest_multisite.conf
+                -c ${FUNCTEST_TEST_DIR}/openstack/tempest/tempest_multisite.conf
         ;;
         "odl-sfc")
             ODL_SFC_DIR=${REPOS_DIR}/sfc/tests/functest/odl-sfc
@@ -153,9 +153,6 @@ function run_test(){
             source ${ODL_SFC_DIR}/tackerc
             python ${ODL_SFC_DIR}/sfc.py $report
         ;;
-        "parser")
-            python ${FUNCTEST_TEST_DIR}/vnf/vRNC/parser.py $report
-        ;;
         *)
             echo "The test case '${test_name}' does not exist."
             exit 1
index a5ddcf2..ffdfa51 100755 (executable)
@@ -24,7 +24,7 @@ tiers:
         order: 1
         ci_loop: '(daily)|(weekly)'
         description : >-
-            Set of basic Functional tests to validate the OpenStack deployment.
+            Set of basic Functional tests to validate the OPNFV scenarios.
         testcases:
             -
                 name: vping_ssh
@@ -38,7 +38,7 @@ tiers:
                     installer: ''
                     scenario: '^((?!bgpvpn|odl_l3).)*$'
                 run:
-                    module: 'functest.opnfv_tests.OpenStack.vPing.vping_ssh'
+                    module: 'functest.opnfv_tests.openstack.vping.vping_ssh'
                     class: 'VPingSSH'
 
             -
@@ -52,7 +52,7 @@ tiers:
                     installer: ''
                     scenario: '^((?!lxd).)*$'
                 run:
-                    module: 'functest.opnfv_tests.OpenStack.vPing.vping_userdata'
+                    module: 'functest.opnfv_tests.openstack.vping.vping_userdata'
                     class: 'VPingUserdata'
 
             -
@@ -79,14 +79,6 @@ tiers:
                     installer: ''
                     scenario: '^((?!bgpvpn).)*$'
 
-    -
-        name: sdn_suites
-        order: 2
-        ci_loop: '(daily)|(weekly)'
-        description : >-
-            Test suites corresponding to the different
-            SDN Controllers existing in OPNFV.
-        testcases:
             -
                 name: odl
                 criteria: 'success_rate == 100%'
@@ -99,8 +91,8 @@ tiers:
                     installer: ''
                     scenario: 'odl'
                 run:
-                    module: 'functest.opnfv_tests.Controllers.ODL.OpenDaylightTesting'
-                    class: 'ODLTestCases'
+                    module: 'functest.opnfv_tests.sdn.odl.odl'
+                    class: 'ODLTests'
 
             -
                 name: onos
@@ -116,7 +108,7 @@ tiers:
 
     -
         name: features
-        order: 3
+        order: 2
         ci_loop: '(daily)|(weekly)'
         description : >-
             Test suites from feature projects
@@ -153,7 +145,7 @@ tiers:
                     scenario: 'bgpvpn'
                 run:
                     module: 'functest.opnfv_tests.features.sdnvpn'
-                    class: 'SDNVPN'
+                    class: 'SdnVpnTests'
 
             -
                 name: security_scan
@@ -203,7 +195,7 @@ tiers:
                     scenario: ''
                 run:
                     module: 'functest.opnfv_tests.features.domino'
-                    class: 'DominoCases'
+                    class: 'DominoTests'
             -
                 name: odl-sfc
                 criteria: 'status == "PASS"'
@@ -231,10 +223,12 @@ tiers:
                 dependencies:
                     installer: 'fuel'
                     scenario: '^((?!bgpvpn|noha).)*$'
-
+                run:
+                    module: 'functest.opnfv_tests.vnf.rnc.parser'
+                    class: 'Parser'
     -
         name: openstack
-        order: 4
+        order: 3
         ci_loop: 'weekly'
         description : >-
             Extensive testing of OpenStack API.
@@ -264,7 +258,7 @@ tiers:
 
     -
         name: vnf
-        order: 5
+        order: 4
         ci_loop: 'weekly'
         description : >-
             Collection of VNF test cases.
index 2deeb4c..942b474 100755 (executable)
@@ -15,6 +15,7 @@
 # 0.4: refactoring to match Test abstraction class
 
 import argparse
+import os
 import sys
 import time
 
@@ -24,19 +25,19 @@ import functest.utils.functest_utils as ft_utils
 import functest.utils.functest_constants as ft_constants
 
 
-class DominoCases(TestCasesBase.TestCasesBase):
-    DOMINO_REPO = ft_constants.DOMINO_REPO
-    RESULTS_DIR = ft_constants.FUNCTEST_RESULTS_DIR
+class DominoTests(TestCasesBase.TestCasesBase):
     logger = ft_logger.Logger("domino").getLogger()
 
     def __init__(self):
-        super(DominoCases, self).__init__()
+        super(DominoTests, self).__init__()
         self.project_name = "domino"
         self.case_name = "domino-multinode"
 
     def main(self, **kwargs):
-        cmd = 'cd %s && ./tests/run_multinode.sh' % self.DOMINO_REPO
-        log_file = self.RESULTS_DIR + "/domino.log"
+        cmd = ('cd %s && ./tests/run_multinode.sh' %
+               ft_constants.DOMINO_REPO_DIR)
+        log_file = os.path.join(
+            ft_constants.FUNCTEST_RESULTS_DIR, "domino.log")
         start_time = time.time()
 
         ret = ft_utils.execute_command(cmd,
@@ -72,7 +73,7 @@ if __name__ == '__main__':
                         help="Create json result file",
                         action="store_true")
     args = vars(parser.parse_args())
-    domino = DominoCases()
+    domino = DominoTests()
     try:
         result = domino.main(**args)
         if result != TestCasesBase.TestCasesBase.EX_OK:
index efc67b0..567b5fb 100644 (file)
@@ -20,21 +20,21 @@ import functest.utils.functest_logger as ft_logger
 import functest.utils.functest_utils as ft_utils
 
 
-class SDNVPN(TestCasesBase.TestCasesBase):
-    SDNVPN_REPO = ft_constants.SDNVPN_REPO_DIR
-    SDNVPN_REPO_TESTS = os.path.join(SDNVPN_REPO, "tests/functest")
-    RESULTS_DIR = ft_constants.FUNCTEST_RESULTS_DIR
+class SdnVpnTests(TestCasesBase.TestCasesBase):
+    SDNVPN_REPO_TESTS = os.path.join(
+        ft_constants.SDNVPN_REPO_DIR, "tests/functest")
     logger = ft_logger.Logger("sdnvpn").getLogger()
 
     def __init__(self):
-        super(SDNVPN, self).__init__()
+        super(SdnVpnTests, self).__init__()
         self.project_name = "sdnvpn"
         self.case_name = "bgpvpn"
 
     def main(self, **kwargs):
         os.chdir(self.SDNVPN_REPO_TESTS)
         cmd = 'run_tests.py'
-        log_file = os.path.join(self.RESULTS_DIR, "sdnvpn.log")
+        log_file = os.path.join(
+            ft_constants.FUNCTEST_RESULTS_DIR, "sdnvpn.log")
         start_time = time.time()
 
         ret = ft_utils.execute_command(cmd,
@@ -69,7 +69,7 @@ if __name__ == '__main__':
                         help="Create json result file",
                         action="store_true")
     args = vars(parser.parse_args())
-    sdnvpn = SDNVPN()
+    sdnvpn = SdnVpnTests()
     try:
         result = sdnvpn.main(**args)
         if result != TestCasesBase.TestCasesBase.EX_OK:
@@ -120,7 +120,7 @@ class VPingSSH(vping_base.VPingBase):
         self.logger.info("Trying to transfer ping.sh to %s..." % floatip)
         scp = SCPClient(ssh.get_transport())
 
-        ping_script = os.path.join(self.repo + "ping.sh")
+        ping_script = os.path.join(self.repo, "ping.sh")
         try:
             scp.put(ping_script, "~/")
         except:
similarity index 97%
rename from functest/opnfv_tests/Controllers/ODL/OpenDaylightTesting.py
rename to functest/opnfv_tests/sdn/odl/odl.py
index 0ddb58c..c3fcb24 100755 (executable)
@@ -47,7 +47,7 @@ class ODLResultVisitor(ResultVisitor):
         return self._data
 
 
-class ODLTestCases(TestCasesBase.TestCasesBase):
+class ODLTests(TestCasesBase.TestCasesBase):
 
     repos = ft_constants.REPOS_DIR
     odl_test_repo = os.path.join(repos, "odl_test")
@@ -89,6 +89,7 @@ class ODLTestCases(TestCasesBase.TestCasesBase):
         self.details = {}
         self.details['description'] = result.suite.name
         self.details['tests'] = visitor.get_data()
+        return self.criteria
 
     def main(self, **kwargs):
         dirs = [self.basic_suite_dir, self.neutron_suite_dir]
@@ -127,8 +128,10 @@ class ODLTestCases(TestCasesBase.TestCasesBase):
                 self.logger.info("\n" + stdout.read())
             self.logger.info("ODL results were successfully generated")
             try:
-                self.parse_results()
+                test_res = self.parse_results()
                 self.logger.info("ODL results were successfully parsed")
+                if test_res is not "PASS":
+                    return self.EX_RUN_ERROR
             except RobotError as e:
                 self.logger.error("Run tests before publishing: %s" %
                                   e.message)
@@ -227,7 +230,7 @@ if __name__ == '__main__':
                         action='store_true')
 
     args = vars(parser.parse_args())
-    odl = ODLTestCases()
+    odl = ODLTests()
     try:
         result = odl.main(**args)
         if result != TestCasesBase.TestCasesBase.EX_OK:
similarity index 99%
rename from functest/opnfv_tests/Controllers/ONOS/Sfc/Sfc.py
rename to functest/opnfv_tests/sdn/onos/sfc/sfc.py
index e3f0804..2241227 100755 (executable)
 import time
 import functest.utils.functest_logger as ft_logger
 import functest.utils.functest_utils as ft_utils
-from Sfc_fun import Sfc_fun
+from sfc_onos import SfcOnos
 
 logger = ft_logger.Logger("sfc").getLogger()
-Sfc_obj = Sfc_fun()
+Sfc_obj = SfcOnos()
 
 OK = 200
 CREATED = 201
@@ -16,7 +16,7 @@ ACCEPTED = 202
 NO_CONTENT = 204
 
 
-class Sfc_fun:
+class SfcOnos:
     """Defines all the def function of SFC."""
 
     def __init__(self):
@@ -15,17 +15,17 @@ import pexpect
 import requests
 import time
 
-from environment import environment
+from environment import Environment
 import functest.utils.functest_logger as ft_logger
 
 
-class client(environment):
+class Client(Environment):
 
     logger = ft_logger.Logger("client").getLogger()
 
     def __init__(self):
-        environment.__init__(self)
-        self.loginfo = environment()
+        Environment.__init__(self)
+        self.loginfo = Environment()
         self.testcase = ''
 
     def RunScript(self, handle, testname, timeout=300):
@@ -17,17 +17,17 @@ import os
 import pexpect
 import re
 
-from foundation import foundation
+from foundation import Foundation
 import functest.utils.functest_logger as ft_logger
 
 
-class connection(foundation):
+class Connection(Foundation):
 
     logger = ft_logger.Logger("connection").getLogger()
 
     def __init__(self):
-        foundation.__init__(self)
-        self.loginfo = foundation()
+        Foundation.__init__(self)
+        self.loginfo = Foundation()
 
     def AddKnownHost(self, handle, ipaddr, username, password):
         """
@@ -22,17 +22,17 @@ import os
 import sys
 import time
 
-from connection import connection
+from connection import Connection
 import functest.utils.functest_logger as ft_logger
 
 
-class environment(connection):
+class Environment(Connection):
 
     logger = ft_logger.Logger("environment").getLogger()
 
     def __init__(self):
-        connection.__init__(self)
-        self.loginfo = connection()
+        Connection.__init__(self)
+        self.loginfo = Connection()
         self.masterhandle = ''
         self.home = ''
 
@@ -21,13 +21,13 @@ import functest.utils.functest_constants as ft_constants
 import functest.utils.functest_utils as ft_utils
 
 
-class foundation:
+class Foundation:
 
     def __init__(self):
 
         # currentpath = os.getcwd()
         currentpath = \
-            ft_constants.FUNCTEST_TEST_DIR + '/Controllers/ONOS/Teston/CI'
+            ft_constants.FUNCTEST_TEST_DIR + '/sdn/onos/teston/ci'
         self.cipath = currentpath
         self.logdir = os.path.join(currentpath, 'log')
         self.workhome = currentpath[0: currentpath.rfind('opnfv_tests') - 1]
diff --git a/functest/opnfv_tests/vnf/__init__.py b/functest/opnfv_tests/vnf/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
similarity index 99%
rename from functest/opnfv_tests/vnf/vIMS/clearwater.py
rename to functest/opnfv_tests/vnf/ims/clearwater.py
index 7236f4f..eb0abac 100644 (file)
@@ -12,7 +12,7 @@
 ########################################################################
 
 
-class clearwater:
+class Clearwater:
 
     def __init__(self, inputs={}, orchestrator=None, logger=None):
         self.config = inputs
similarity index 99%
rename from functest/opnfv_tests/vnf/vIMS/orchestrator.py
rename to functest/opnfv_tests/vnf/ims/orchestrator.py
index 61157a4..5f84df0 100644 (file)
@@ -21,7 +21,7 @@ from git import Repo
 import functest.utils.functest_logger as ft_logger
 
 
-class orchestrator:
+class Orchestrator:
 
     def __init__(self, testcase_dir, inputs={}):
         self.testcase_dir = testcase_dir
similarity index 98%
rename from functest/opnfv_tests/vnf/vIMS/vIMS.py
rename to functest/opnfv_tests/vnf/ims/vims.py
index 4cc8ce3..fe888b6 100755 (executable)
@@ -27,8 +27,8 @@ from neutronclient.v2_0 import client as ntclient
 import functest.utils.functest_logger as ft_logger
 import functest.utils.functest_utils as ft_utils
 import functest.utils.openstack_utils as os_utils
-from clearwater import clearwater
-from orchestrator import orchestrator
+from clearwater import Clearwater
+from orchestrator import Orchestrator
 import functest.utils.functest_constants as ft_constants
 
 pp = pprint.PrettyPrinter(indent=4)
@@ -49,7 +49,7 @@ logger = ft_logger.Logger("vIMS").getLogger()
 
 
 # Cloudify parameters
-VIMS_DIR = os.path.join(ft_constants.FUNCTEST_TEST_DIR, 'vnf/vIMS/')
+VIMS_DIR = os.path.join(ft_constants.FUNCTEST_TEST_DIR, 'vnf/ims/')
 VIMS_DATA_DIR = ft_constants.VIMS_DATA_DIR
 VIMS_TEST_DIR = ft_constants.VIMS_TEST_DIR
 VIMS_TENANT_NAME = ft_constants.VIMS_TENANT_NAME
@@ -328,7 +328,7 @@ def main():
     public_auth_url = keystone.service_catalog.url_for(
         service_type='identity', endpoint_type='publicURL')
 
-    cfy = orchestrator(VIMS_DATA_DIR, CFY_INPUTS)
+    cfy = Orchestrator(VIMS_DATA_DIR, CFY_INPUTS)
 
     cfy.set_credentials(username=ks_creds['username'], password=ks_creds[
                         'password'], tenant_name=ks_creds['tenant_name'],
@@ -413,7 +413,7 @@ def main():
 
     # ############### CLEARWATER INITIALISATION ################
 
-    cw = clearwater(CW_INPUTS, cfy, logger)
+    cw = Clearwater(CW_INPUTS, cfy, logger)
 
     logger.info("Collect flavor id for all clearwater vm")
     nova = nvclient.Client("2", **nv_creds)
diff --git a/functest/opnfv_tests/vnf/rnc/__init__.py b/functest/opnfv_tests/vnf/rnc/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/functest/opnfv_tests/vnf/rnc/parser.py b/functest/opnfv_tests/vnf/rnc/parser.py
new file mode 100644 (file)
index 0000000..f653220
--- /dev/null
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+#
+# Copyright 2016 ZTE Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import os
+import sys
+import time
+
+import argparse
+
+import functest.core.TestCasesBase as base
+import functest.utils.functest_constants as ft_constants
+import functest.utils.functest_logger as ft_logger
+import functest.utils.functest_utils as ft_utils
+
+
+class Parser(base.TestCasesBase):
+
+    def __init__(self):
+        super(Parser, self).__init__()
+        self.project_name = "parser"
+        self.case_name = "parser-basics"
+        self.logger = ft_logger.Logger("parser").getLogger()
+        self.log_file = os.path.join(
+            ft_constants.FUNCTEST_RESULTS_DIR,  "parser.log")
+
+    def run(self, **kwargs):
+        cmd = 'cd %s/tests && ./functest_run.sh' % ft_constants.PARSER_REPO_DIR
+
+        self.start_time = time.time()
+        ret = ft_utils.execute_command(cmd,
+                                       info=True,
+                                       output_file=self.log_file)
+        self.stop_time = time.time()
+
+        self.criteria, details = ft_utils.check_test_result(self.project_name,
+                                                            ret,
+                                                            self.start_time,
+                                                            self.stop_time)
+
+        ft_utils.logger_test_results(self.project_name,
+                                     self.case_name,
+                                     self.criteria,
+                                     details)
+
+        return ret
+
+    @staticmethod
+    def get_conf(parameter):
+        return ft_utils.get_functest_config(parameter)
+
+
+if __name__ == '__main__':
+    args_parser = argparse.ArgumentParser()
+    args_parser.add_argument("-r", "--report",
+                             help="Create json result file",
+                             action="store_true")
+    args = vars(args_parser.parse_args())
+    parser = Parser()
+    try:
+        result = parser.run(**args)
+        if result != base.TestCasesBase.EX_OK:
+            sys.exit(result)
+        if args['report']:
+            sys.exit(parser.push_to_db())
+    except Exception:
+        sys.exit(base.TestCasesBase.EX_RUN_ERROR)
diff --git a/functest/opnfv_tests/vnf/vRNC/parser.py b/functest/opnfv_tests/vnf/vRNC/parser.py
deleted file mode 100755 (executable)
index 33d4d50..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2016 ZTE Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-import argparse
-import time
-
-import functest.utils.functest_logger as ft_logger
-import functest.utils.functest_utils as functest_utils
-import functest.utils.functest_constants as ft_constants
-
-parser = argparse.ArgumentParser()
-parser.add_argument("-r", "--report",
-                    help="Create json result file",
-                    action="store_true")
-args = parser.parse_args()
-
-PARSER_REPO = ft_constants.PARSER_REPO
-RESULTS_DIR = ft_constants.FUNCTEST_RESULTS_DIR
-
-logger = ft_logger.Logger("parser").getLogger()
-
-
-def main():
-    project = 'parser'
-    case_name = 'parser-basics'
-    cmd = 'cd %s/tests && ./functest_run.sh' % PARSER_REPO
-
-    start_time = time.time()
-    log_file = RESULTS_DIR + "/parser.log"
-    ret = functest_utils.execute_command(cmd,
-                                         info=True,
-                                         output_file=log_file)
-    stop_time = time.time()
-
-    status, details = functest_utils.check_test_result(project,
-                                                       ret,
-                                                       start_time,
-                                                       stop_time)
-
-    functest_utils.logger_test_results(project,
-                                       case_name,
-                                       status,
-                                       details)
-
-    if args.report:
-        logger.debug("Report Parser Results to DB......")
-        functest_utils.push_results_to_db(project,
-                                          case_name,
-                                          start_time,
-                                          stop_time,
-                                          status,
-                                          details)
-    exit(ret)
-
-
-if __name__ == '__main__':
-    main()
index 065298d..46707e8 100644 (file)
@@ -16,11 +16,11 @@ import unittest
 from robot.errors import RobotError
 
 from functest.core import TestCasesBase
-from functest.opnfv_tests.Controllers.ODL import OpenDaylightTesting
+from functest.opnfv_tests.sdn.odl import odl
 from functest.utils import functest_constants as ft_constants
 
 
-class ODLTestCasesTesting(unittest.TestCase):
+class ODLTesting(unittest.TestCase):
 
     logging.disable(logging.CRITICAL)
 
@@ -39,7 +39,7 @@ class ODLTestCasesTesting(unittest.TestCase):
         ft_constants.OS_USERNAME = self._os_username
         ft_constants.OS_PASSWORD = self._os_password
         ft_constants.OS_TENANT_NAME = self._os_tenantname
-        self.test = OpenDaylightTesting.ODLTestCases()
+        self.test = odl.ODLTests()
 
     @mock.patch('fileinput.input', side_effect=Exception())
     def test_set_robotframework_vars_failed(self, *args):
@@ -53,9 +53,9 @@ class ODLTestCasesTesting(unittest.TestCase):
     def _fake_url_for(cls, service_type='identity', **kwargs):
         if service_type == 'identity':
             return "http://{}:5000/v2.0".format(
-                ODLTestCasesTesting._keystone_ip)
+                ODLTesting._keystone_ip)
         elif service_type == 'network':
-            return "http://{}:9696".format(ODLTestCasesTesting._neutron_ip)
+            return "http://{}:9696".format(ODLTesting._neutron_ip)
         else:
             return None
 
@@ -85,7 +85,7 @@ class ODLTestCasesTesting(unittest.TestCase):
     def _test_main(self, status, *args):
         kwargs = self._get_main_kwargs()
         self.assertEqual(self.test.main(**kwargs), status)
-        odl_res_dir = OpenDaylightTesting.ODLTestCases.res_dir
+        odl_res_dir = odl.ODLTests.res_dir
         if len(args) > 0:
             args[0].assert_called_once_with(odl_res_dir)
         if len(args) > 1:
@@ -99,8 +99,8 @@ class ODLTestCasesTesting(unittest.TestCase):
                         'RESTCONFPORT:{}'.format(self._odl_restconfport)]
             output_file = os.path.join(odl_res_dir, 'output.xml')
             args[1].assert_called_once_with(
-                OpenDaylightTesting.ODLTestCases.basic_suite_dir,
-                OpenDaylightTesting.ODLTestCases.neutron_suite_dir,
+                odl.ODLTests.basic_suite_dir,
+                odl.ODLTests.neutron_suite_dir,
                 log='NONE',
                 output=output_file,
                 report='NONE',
@@ -200,7 +200,8 @@ class ODLTestCasesTesting(unittest.TestCase):
     def test_main(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results',
+                                  return_value="PASS"):
             self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
 
     @mock.patch('os.remove')
@@ -209,7 +210,8 @@ class ODLTestCasesTesting(unittest.TestCase):
     def test_main_makedirs_oserror17(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results',
+                                  return_value="PASS"):
             self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
 
     @mock.patch('os.remove')
@@ -218,7 +220,8 @@ class ODLTestCasesTesting(unittest.TestCase):
     def test_main_testcases_in_failure(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results',
+                                  return_value="PASS"):
             self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
 
     @mock.patch('os.remove', side_effect=OSError)
@@ -227,7 +230,8 @@ class ODLTestCasesTesting(unittest.TestCase):
     def test_main_remove_oserror(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results',
+                                  return_value="PASS"):
             self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
 
     def _test_run_missing_env_var(self, var):
index 81763cb..a686b19 100644 (file)
@@ -90,12 +90,12 @@ OPENSTACK_CREDS = \
 OPENSTACK_SNAPSHOT_FILE = \
     get_value('general.openstack.snapshot_file', 'OPENSTACK_SNAPSHOT_FILE')
 
-DOMINO_REPO = \
-    get_value('general.directories.dir_repo_domino', 'DOMINO_REPO')
-SDNVPN_REPO = \
-    get_value('general.directories.dir_repo_sdnvpn', 'SDNVPN_REPO')
-SFC_REPO = \
-    get_value('general.directories.dir_repo_sfc', 'SFC_REPO')
+DOMINO_REPO_DIR = \
+    get_value('general.directories.dir_repo_domino', 'DOMINO_REPO_DIR')
+SDNVPN_REPO_DIR = \
+    get_value('general.directories.dir_repo_sdnvpn', 'SDNVPN_REPO_DIR')
+SFC_REPO_DIR = \
+    get_value('general.directories.dir_repo_sfc', 'SFC_REPO_DIR')
 
 ONOS_SFC_IMAGE_NAME = \
     get_value('onos_sfc.image_name', 'ONOS_SFC_IMAGE_NAME')
@@ -283,5 +283,5 @@ CW_INPUTS = \
     get_value('vIMS.clearwater.inputs', 'CW_INPUTS')
 CW_REQUIERMENTS = \
     get_value('vIMS.clearwater.requierments', 'CW_REQUIERMENTS')
-PARSER_REPO = \
-    get_value('general.directories.dir_repo_parser', 'PARSER_REPO')
+PARSER_REPO_DIR = \
+    get_value('general.directories.dir_repo_parser', 'PARSER_REPO_DIR')
index a274403..a8ce54c 100755 (executable)
@@ -56,7 +56,7 @@ nosetests --with-xunit \
          --with-coverage \
          --cover-erase \
          --cover-package=functest.core.TestCasesBase \
-         --cover-package=functest.opnfv_tests.Controllers.ODL.OpenDaylightTesting \
+         --cover-package=functest.opnfv_tests.sdn.odl.odl \
          --cover-xml \
          --cover-html \
          functest/tests/unit