summaryrefslogtreecommitdiffstats
path: root/testcases/Controllers/ONOS/Teston/adapters/foundation.py
diff options
context:
space:
mode:
Diffstat (limited to 'testcases/Controllers/ONOS/Teston/adapters/foundation.py')
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/foundation.py59
1 files changed, 26 insertions, 33 deletions
diff --git a/testcases/Controllers/ONOS/Teston/adapters/foundation.py b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
index 70c84ac02..5c42c35e8 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/foundation.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
@@ -17,8 +17,7 @@ import os
import re
import time
-import yaml
-from functest.utils.functest_utils import FUNCTEST_REPO as FUNCTEST_REPO
+import functest.utils.functest_utils as ft_utils
class foundation:
@@ -26,7 +25,7 @@ class foundation:
def __init__(self):
# currentpath = os.getcwd()
- REPO_PATH = FUNCTEST_REPO + '/'
+ REPO_PATH = ft_utils.FUNCTEST_REPO + '/'
currentpath = REPO_PATH + 'testcases/Controllers/ONOS/Teston/CI'
self.cipath = currentpath
self.logdir = os.path.join(currentpath, 'log')
@@ -49,42 +48,36 @@ class foundation:
filemode='w')
filelog = logging.FileHandler(self.logfilepath)
logging.getLogger('Functest').addHandler(filelog)
- print loginfo
logging.info(loginfo)
def getdefaultpara(self):
"""
Get Default Parameters value
"""
- with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
- functest_yaml = yaml.safe_load(f)
-
- self.Result_DB = str(functest_yaml.get("results").get("test_db_url"))
- self.masterusername = str(functest_yaml.get("ONOS").get("general").
- get('onosbench_username'))
- self.masterpassword = str(functest_yaml.get("ONOS").get("general").
- get("onosbench_password"))
- self.agentusername = str(functest_yaml.get("ONOS").get("general").
- get("onoscli_username"))
- self.agentpassword = str(functest_yaml.get("ONOS").get("general").
- get("onoscli_password"))
- self.runtimeout = functest_yaml.get("ONOS").get("general").get(
- "runtimeout")
- self.OCT = str(functest_yaml.get("ONOS").get("environment").get("OCT"))
- self.OC1 = str(functest_yaml.get("ONOS").get("environment").get("OC1"))
- self.OC2 = str(functest_yaml.get("ONOS").get("environment").get("OC2"))
- self.OC3 = str(functest_yaml.get("ONOS").get("environment").get("OC3"))
- self.OCN = str(functest_yaml.get("ONOS").get("environment").get("OCN"))
- self.OCN2 = str(functest_yaml.get("ONOS").
- get("environment").get("OCN2"))
- self.installer_master = str(functest_yaml.get("ONOS").
- get("environment").get("installer_master"))
- self.installer_master_username = str(functest_yaml.get("ONOS").
- get("environment").
- get("installer_master_username"))
- self.installer_master_password = str(functest_yaml.get("ONOS").
- get("environment").
- get("installer_master_password"))
+ self.Result_DB = str(
+ ft_utils.get_functest_config('results.test_db_url'))
+ self.masterusername = str(
+ ft_utils.get_functest_config('ONOS.general.onosbench_username'))
+ self.masterpassword = str(
+ ft_utils.get_functest_config('ONOS.general.onosbench_password'))
+ self.agentusername = str(
+ ft_utils.get_functest_config('ONOS.general.onoscli_username'))
+ self.agentpassword = str(
+ ft_utils.get_functest_config('ONOS.general.onoscli_password'))
+ self.runtimeout = \
+ ft_utils.get_functest_config('ONOS.general.runtimeout')
+ self.OCT = str(ft_utils.get_functest_config('ONOS.environment.OCT'))
+ self.OC1 = str(ft_utils.get_functest_config('ONOS.environment.OC1'))
+ self.OC2 = str(ft_utils.get_functest_config('ONOS.environment.OC2'))
+ self.OC3 = str(ft_utils.get_functest_config('ONOS.environment.OC3'))
+ self.OCN = str(ft_utils.get_functest_config('ONOS.environment.OCN'))
+ self.OCN2 = str(ft_utils.get_functest_config('ONOS.environment.OCN2'))
+ self.installer_master = str(
+ ft_utils.get_functest_config('ONOS.environment.installer_master'))
+ self.installer_master_username = str(ft_utils.get_functest_config(
+ 'ONOS.environment.installer_master_username'))
+ self.installer_master_password = str(ft_utils.get_functest_config(
+ 'ONOS.environment.installer_master_password'))
self.hosts = [self.OC1, self.OCN, self.OCN2]
self.localhost = self.OCT