diff options
Diffstat (limited to 'sdnvpn/test')
-rw-r--r-- | sdnvpn/test/functest/run_sdnvpn_tests.py | 50 | ||||
-rw-r--r-- | sdnvpn/test/functest/run_tempest.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_1.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_10.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_11.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_12.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_13.py | 16 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_2.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_3.py | 8 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_4.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_7.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_8.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_9.py | 4 |
13 files changed, 65 insertions, 50 deletions
diff --git a/sdnvpn/test/functest/run_sdnvpn_tests.py b/sdnvpn/test/functest/run_sdnvpn_tests.py index 8e55b2d..e4d55f1 100644 --- a/sdnvpn/test/functest/run_sdnvpn_tests.py +++ b/sdnvpn/test/functest/run_sdnvpn_tests.py @@ -21,6 +21,7 @@ from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib.gather_logs import gather_logs from sdnvpn.lib import utils as test_utils +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() @@ -42,8 +43,8 @@ class SdnvpnFunctest(feature.Feature): neutron_quota['port'], neutron_quota['router']) instances_quota = test_utils.get_nova_instances_quota(nova_client) - self.logger.info("Setting net/subnet/port/router " - "quota to unlimited") + logger.info("Setting net/subnet/port/router " + "quota to unlimited") test_utils.update_nw_subnet_port_quota( neutron_client, tenant_id, @@ -55,13 +56,14 @@ class SdnvpnFunctest(feature.Feature): # Workaround for # https://jira.opnfv.org/projects/SDNVPN/issues/SDNVPN-115 - self.logger.info("Setting instances quota class to unlimited") + logger.info("Setting instances quota class to unlimited") test_utils.update_instance_quota_class( nova_client, COMMON_CONFIG.nova_instances_quota_class) # Clean up the stale floating ip's so that required # ip addresses are available for sdnvpn testcases + logger.info("Cleaning up the Floating IP Addresses") floating_ips = os_utils.get_floating_ips(neutron_client) if floating_ips is not None: for floating_ip in floating_ips: @@ -79,37 +81,37 @@ class SdnvpnFunctest(feature.Feature): test_descr = testcases[tc]['description'] title = ("Running '%s - %s'" % (test_name, test_descr)) - self.logger.info(title) - self.logger.info("%s\n" % ("=" * len(title))) + logger.info(title) + logger.info("%s\n" % ("=" * len(title))) try: - self.logger.info("Importing the testcase %s" % test_name) + logger.info("Importing the testcase %s" % test_name) t = importlib.import_module(test_name, package=None) - self.logger.info("Calling the testcase %s main method" - % test_name) + logger.info("Calling the testcase %s main method" + % test_name) result = t.main() - self.logger.info("Execution is complete for the" - " testcase %s" % test_name) + logger.info("Execution is complete for the" + " testcase %s" % test_name) except Exception as ex: result = -1 - self.logger.info("Caught Exception in %s: %s Trace: %s" - % (test_name, ex, - traceback.format_exc())) + logger.info("Caught Exception in %s: %s Trace: %s" + % (test_name, ex, + traceback.format_exc())) if result < 0: status = "FAIL" overall_status = "FAIL" - self.logger.info("Testcase %s failed" % test_name) + logger.info("Testcase %s failed" % test_name) else: status = result.get("status") self.details.update( {test_name: {'status': status, 'details': result.get("details")}}) - self.logger.info("Results of test case '%s - %s':\n%s\n" - % (test_name, test_descr, result)) + logger.info("Results of test case '%s - %s':\n%s\n" + % (test_name, test_descr, result)) if status == "FAIL": overall_status = "FAIL" - self.logger.info("Resetting subnet/net/port quota") + logger.info("Resetting subnet/net/port quota") test_utils.update_nw_subnet_port_quota(neutron_client, tenant_id, neutron_nw_quota, @@ -117,7 +119,7 @@ class SdnvpnFunctest(feature.Feature): neutron_port_quota, neutron_router_quota) - self.logger.info("Resetting instances quota class") + logger.info("Resetting instances quota class") test_utils.update_instance_quota_class(nova_client, instances_quota) try: @@ -125,13 +127,13 @@ class SdnvpnFunctest(feature.Feature): if installer_type in ["fuel", "apex"]: gather_logs('overall') else: - self.logger.info("Skipping log gathering because installer" - "type %s is neither fuel nor apex" % - installer_type) + logger.info("Skipping log gathering because installer" + "type %s is neither fuel nor apex" % + installer_type) except Exception as ex: - self.logger.error(('Something went wrong in the Log gathering.' - 'Ex: %s, Trace: %s') - % (ex, traceback.format_exc())) + logger.error(('Something went wrong in the Log gathering.' + 'Ex: %s, Trace: %s') + % (ex, traceback.format_exc())) if overall_status == "PASS": self.result = 100 diff --git a/sdnvpn/test/functest/run_tempest.py b/sdnvpn/test/functest/run_tempest.py index 68045fa..a1ef004 100644 --- a/sdnvpn/test/functest/run_tempest.py +++ b/sdnvpn/test/functest/run_tempest.py @@ -9,14 +9,14 @@ # # import ConfigParser +import logging import os import re import shutil import functest.opnfv_tests.openstack.tempest.conf_utils as tempest_utils -from sdnvpn.lib import logutil -logger = logutil.getLogger('sdnvpn-tempest') +logger = logging.getLogger('sdnvpn-tempest') def main(): diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py index b1f3dae..35e32b2 100644 --- a/sdnvpn/test/functest/testcase_1.py +++ b/sdnvpn/test/functest/testcase_1.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import sys from random import randint @@ -15,9 +16,8 @@ from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_10.py b/sdnvpn/test/functest/testcase_10.py index f776ecf..aebc146 100644 --- a/sdnvpn/test/functest/testcase_10.py +++ b/sdnvpn/test/functest/testcase_10.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import re import sys import time @@ -17,10 +18,8 @@ from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil - -logger = logutil.getLogger('__name__') +logger = logging.getLogger('__name__') std_out_lock = Lock() diff --git a/sdnvpn/test/functest/testcase_11.py b/sdnvpn/test/functest/testcase_11.py index 9c3dcaa..c597c4d 100644 --- a/sdnvpn/test/functest/testcase_11.py +++ b/sdnvpn/test/functest/testcase_11.py @@ -8,15 +8,15 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import sys from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_12.py b/sdnvpn/test/functest/testcase_12.py index 5c91775..3e13d69 100644 --- a/sdnvpn/test/functest/testcase_12.py +++ b/sdnvpn/test/functest/testcase_12.py @@ -8,15 +8,15 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import sys from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_13.py b/sdnvpn/test/functest/testcase_13.py index 1c1f985..8beb1db 100644 --- a/sdnvpn/test/functest/testcase_13.py +++ b/sdnvpn/test/functest/testcase_13.py @@ -8,6 +8,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging +import os import sys from random import randint @@ -15,9 +17,8 @@ from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( @@ -31,6 +32,17 @@ def main(): results.add_to_summary(2, "STATUS", "SUBTEST") results.add_to_summary(0, "=") + if not os.path.isfile(COMMON_CONFIG.ubuntu_image_path): + logger.info("Downloading image") + image_dest_path = '/'.join( + COMMON_CONFIG.ubuntu_image_path.split('/')[:-1]) + os_utils.download_url( + "http://artifacts.opnfv.org/sdnvpn/" + "ubuntu-16.04-server-cloudimg-amd64-disk1.img", + image_dest_path) + else: + logger.info("Using old image") + nova_client = os_utils.get_nova_client() neutron_client = os_utils.get_neutron_client() glance_client = os_utils.get_glance_client() diff --git a/sdnvpn/test/functest/testcase_2.py b/sdnvpn/test/functest/testcase_2.py index 250ac4f..ee74d8d 100644 --- a/sdnvpn/test/functest/testcase_2.py +++ b/sdnvpn/test/functest/testcase_2.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import sys from random import randint @@ -15,9 +16,8 @@ from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_3.py b/sdnvpn/test/functest/testcase_3.py index 4475fb8..95023c6 100644 --- a/sdnvpn/test/functest/testcase_3.py +++ b/sdnvpn/test/functest/testcase_3.py @@ -14,6 +14,7 @@ # - Add the functest Quagga as a neighbor # - Verify that the OpenDaylight and gateway Quagga peer +import logging import os import sys @@ -22,10 +23,9 @@ from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( @@ -140,10 +140,12 @@ def main(): # Taken from the sfc tests if not os.path.isfile(COMMON_CONFIG.ubuntu_image_path): logger.info("Downloading image") + image_dest_path = '/'.join( + COMMON_CONFIG.ubuntu_image_path.split('/')[:-1]) os_utils.download_url( "http://artifacts.opnfv.org/sdnvpn/" "ubuntu-16.04-server-cloudimg-amd64-disk1.img", - "/home/opnfv/functest/data/") + image_dest_path) else: logger.info("Using old image") diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py index c0100ce..9b11cc3 100644 --- a/sdnvpn/test/functest/testcase_4.py +++ b/sdnvpn/test/functest/testcase_4.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import sys from random import randint @@ -15,10 +16,9 @@ from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_7.py b/sdnvpn/test/functest/testcase_7.py index 6594045..ada45a5 100644 --- a/sdnvpn/test/functest/testcase_7.py +++ b/sdnvpn/test/functest/testcase_7.py @@ -18,16 +18,16 @@ network associated: - Assign a floating IP to a VM - Ping it """ +import logging import sys from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py index afdfef5..e667dba 100644 --- a/sdnvpn/test/functest/testcase_8.py +++ b/sdnvpn/test/functest/testcase_8.py @@ -16,16 +16,16 @@ # - Try to ping from one VM to the other # - Assign a floating IP to the VM in the router assoc network # - Ping it the floating ip +import logging import sys from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import openstack_utils as os_utils from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil -logger = logutil.getLogger(__name__) +logger = logging.getLogger(__name__) COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( diff --git a/sdnvpn/test/functest/testcase_9.py b/sdnvpn/test/functest/testcase_9.py index a4cfa5a..b77360d 100644 --- a/sdnvpn/test/functest/testcase_9.py +++ b/sdnvpn/test/functest/testcase_9.py @@ -13,18 +13,18 @@ # - Start a BGP router with OpenDaylight # - Add the functest Quagga as a neighbor # - Verify that the OpenDaylight and gateway Quagga peer +import logging import sys from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib import utils as test_utils from sdnvpn.lib.results import Results -from sdnvpn.lib import logutil COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig( "sdnvpn.test.functest.testcase_9") -logger = logutil.getLogger('__name__') +logger = logging.getLogger('__name__') def main(): |