diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-30 07:58:38 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-30 07:58:38 -0800 |
commit | 671823e12bc13be9a8b87a5d7de33da1bb7a44e8 (patch) | |
tree | cbb8f0f184a1d66b34a82da161ac8fe2b8108177 /framework/scripts/function_test/Teston/adapters/foundation.py | |
parent | c5768287ef3bc0aa450d31caeb5762f66dd0dba2 (diff) |
created broader test category under scripts
Change-Id: I3b8a39b7512594ae2c9aa7ab0e59cf6e2d31f7a2
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/scripts/function_test/Teston/adapters/foundation.py')
-rw-r--r-- | framework/scripts/function_test/Teston/adapters/foundation.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/framework/scripts/function_test/Teston/adapters/foundation.py b/framework/scripts/function_test/Teston/adapters/foundation.py deleted file mode 100644 index c909d36b..00000000 --- a/framework/scripts/function_test/Teston/adapters/foundation.py +++ /dev/null @@ -1,64 +0,0 @@ -""" -Description: - This file include basis functions - lanqinglong@huawei.com -""" - -import logging -import os -import time -import yaml - -class foundation: - - def __init__(self): - - currentpath = os.getcwd() - self.logdir = os.path.join( currentpath, 'log' ) - self.workhome = currentpath[0:currentpath.rfind('testcases')-1] - self.Result_DB = '' - - def log (self, loginfo): - """ - Record log in log directory for deploying test environment - parameters: - loginfo(input): record info - """ - filename = time.strftime( '%Y-%m-%d-%H-%M-%S' ) + '.log' - filepath = os.path.join( self.logdir, filename ) - logging.basicConfig( level=logging.INFO, - format = '%(asctime)s %(filename)s:%(message)s', - datefmt = '%d %b %Y %H:%M:%S', - filename = filepath, - filemode = 'w') - filelog = logging.FileHandler( filepath ) - logging.getLogger( 'Functest' ).addHandler( filelog ) - print loginfo - logging.info(loginfo) - - def getdefaultpara( self ): - """ - Get Default Parameters value - """ - with open(self.workhome + "testcases/config_functest.yaml") as f: - functest_yaml = yaml.safe_load(f) - f.close() - - 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.localhost = self.OCT - return True
\ No newline at end of file |