aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-08-25 11:53:10 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2017-08-25 11:53:10 +0200
commitc9ef93de81e802bd01ec7381b243c724c38af34f (patch)
tree376c81cd66f6f5747f339b4cd18c551173fbc49e /functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py
parentfb979fc03b8c744ea0f99658cf2edafe55c17299 (diff)
Remove Onos in Functest
No feedback from onos projects for Euphrates for MS6 Change-Id: I8d295c65e4b621df87752e15b5f41e04a80b32ca Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py')
-rw-r--r--functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py95
1 files changed, 0 insertions, 95 deletions
diff --git a/functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py b/functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py
deleted file mode 100644
index aed98ee4..00000000
--- a/functest/opnfv_tests/sdn/onos/teston/adapters/foundation.py
+++ /dev/null
@@ -1,95 +0,0 @@
-"""
-Description:
- This file include basis functions
- lanqinglong@huawei.com
-
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-"""
-
-import datetime
-import logging
-import os
-import re
-import time
-
-from functest.utils.constants import CONST
-
-
-class Foundation(object):
-
- def __init__(self):
-
- # currentpath = os.getcwd()
- currentpath = ('{0}/sdn/onos/teston/ci'
- .format(CONST.__getattribute__('dir_functest_data')))
- self.cipath = currentpath
- self.logdir = os.path.join(currentpath, 'log')
- self.workhome = currentpath[0: currentpath.rfind('opnfv_tests') - 1]
- self.Result_DB = ''
- filename = time.strftime('%Y-%m-%d-%H-%M-%S') + '.log'
- self.logfilepath = os.path.join(self.logdir, filename)
- self.starttime = datetime.datetime.now()
-
- def log(self, loginfo):
- """
- Record log in log directory for deploying test environment
- parameters:
- loginfo(input): record info
- """
- logging.basicConfig(level=logging.INFO,
- format='%(asctime)s %(filename)s:%(message)s',
- datefmt='%d %b %Y %H:%M:%S',
- filename=self.logfilepath,
- filemode='w')
- filelog = logging.FileHandler(self.logfilepath)
- logging.getLogger('Functest').addHandler(filelog)
- logging.info(loginfo)
-
- def getdefaultpara(self):
- """
- Get Default Parameters value
- """
- self.Result_DB = CONST.__getattribute__("results_test_db_url")
- self.masterusername = CONST.__getattribute__('ONOS_onosbench_username')
- self.masterpassword = CONST.__getattribute__('ONOS_onosbench_password')
- self.agentusername = CONST.__getattribute__('ONOS_onoscli_username')
- self.agentpassword = CONST.__getattribute__('ONOS_onoscli_password')
- self.runtimeout = CONST.__getattribute__('ONOS_runtimeout')
- self.OCT = CONST.__getattribute__('ONOS_environment_OCT')
- self.OC1 = CONST.__getattribute__('ONOS_environment_OC1')
- self.OC2 = CONST.__getattribute__('ONOS_environment_OC2')
- self.OC3 = CONST.__getattribute__('ONOS_environment_OC3')
- self.OCN = CONST.__getattribute__('ONOS_environment_OCN')
- self.OCN2 = CONST.__getattribute__('ONOS_environment_OCN2')
- self.installer_master = CONST.__getattribute__(
- 'ONOS_environment_installer_master')
- self.installer_master_username = (
- CONST.__getattribute__(
- 'ONOS_environment_installer_master_username'))
- self.installer_master_password = (
- CONST.__getattribute__(
- 'ONOS_environment_installer_master_password'))
- self.hosts = [self.OC1, self.OCN, self.OCN2]
- self.localhost = self.OCT
-
- def GetResult(self):
- cmd = "cat " + self.logfilepath + " | grep Fail"
- Resultbuffer = os.popen(cmd).read()
- duration = datetime.datetime.now() - self.starttime
- time.sleep(2)
-
- if re.search("[1-9]+", Resultbuffer):
- self.log("Testcase Fails\n" + Resultbuffer)
- Result = "POK"
- else:
- self.log("Testcases Pass")
- Result = "OK"
- payload = {'timestart': str(self.starttime),
- 'duration': str(duration), 'status': Result}
-
- return payload