aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/Controllers/ONOS/Teston/adapters
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-07 22:13:42 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-08 10:45:45 +0800
commit55d301a2622ff5b63d431b9272caa68224d53843 (patch)
treeb540f05ba3ed45e15260ee7131ce90dc93af753d /testcases/Controllers/ONOS/Teston/adapters
parent227afb8285b8f178987a7d6eb1d28a74201a5d1b (diff)
make use of functest_utils.get_parameter_from_yaml
JIRA: FUNCTEST-463 Change-Id: I1d54a65c5bfa2542f2fd3a2e408967641e6e4ac9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testcases/Controllers/ONOS/Teston/adapters')
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/foundation.py54
1 files changed, 24 insertions, 30 deletions
diff --git a/testcases/Controllers/ONOS/Teston/adapters/foundation.py b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
index 90eb14490..5c42c35e8 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/foundation.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
@@ -16,7 +16,6 @@ import logging
import os
import re
import time
-import yaml
import functest.utils.functest_utils as ft_utils
@@ -55,35 +54,30 @@ class foundation:
"""
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