diff options
-rw-r--r-- | sdnvpn/lib/utils.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/run_sdnvpn_tests.py | 24 |
2 files changed, 16 insertions, 12 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py index 6743e2f..e241d79 100644 --- a/sdnvpn/lib/utils.py +++ b/sdnvpn/lib/utils.py @@ -213,7 +213,9 @@ def get_installerHandler(): installer_ip = get_installer_ip() if installer_type not in ["fuel", "apex"]: - raise ValueError("%s is not supported" % installer_type) + logger.warn("installer type %s is neither fuel nor apex." + "returning None for installer handler" % installer_type) + return None else: if installer_type in ["apex"]: developHandler = DeploymentFactory.get_handler( diff --git a/sdnvpn/test/functest/run_sdnvpn_tests.py b/sdnvpn/test/functest/run_sdnvpn_tests.py index 140256d..dce54e8 100644 --- a/sdnvpn/test/functest/run_sdnvpn_tests.py +++ b/sdnvpn/test/functest/run_sdnvpn_tests.py @@ -12,23 +12,21 @@ import importlib import logging import os import sys -import time import traceback import yaml -from functest.core import testcase +from functest.core import feature as base from sdnvpn.lib import config as sdnvpn_config from sdnvpn.lib.gather_logs import gather_logs COMMON_CONFIG = sdnvpn_config.CommonConfig() -class SdnvpnFunctest(testcase.TestCase): +class SdnvpnFunctest(base.Feature): __logger = logging.getLogger(__name__) - def run(self): - self.start_time = time.time() + def execute(self): cmd_line = "neutron quota-update --subnet -1 --network -1 --port -1" self.__logger.info("Setting subnet/net quota to unlimited : %s" @@ -82,10 +80,14 @@ class SdnvpnFunctest(testcase.TestCase): if status == "FAIL": overall_status = "FAIL" - self.stop_time = time.time() - try: - gather_logs('overall') + installer_type = str(os.environ['INSTALLER_TYPE'].lower()) + 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) except Exception as ex: self.__logger.error(('Something went wrong in the Log gathering.' 'Ex: %s, Trace: %s') @@ -93,13 +95,13 @@ class SdnvpnFunctest(testcase.TestCase): if overall_status == "PASS": self.result = 100 - return testcase.TestCase.EX_OK + return base.Feature.EX_OK - return testcase.TestCase.EX_RUN_ERROR + return base.Feature.EX_RUN_ERROR if __name__ == '__main__': logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s' '- %(levelname)s - %(message)s') SDNVPN = SdnvpnFunctest() - sys.exit(SDNVPN.run()) + sys.exit(SDNVPN.execute()) |