summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes/functest-release.rst6
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/client.py14
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/connection.py18
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/environment.py39
-rw-r--r--testcases/Controllers/ONOS/Teston/adapters/foundation.py3
-rw-r--r--testcases/OpenStack/tempest/custom_tests/blacklist.txt19
-rwxr-xr-xtestcases/features/doctor.py17
-rwxr-xr-xtestcases/features/domino.py9
-rw-r--r--utils/functest_utils.py29
-rwxr-xr-xutils/openstack_clean.py2
10 files changed, 81 insertions, 75 deletions
diff --git a/docs/release-notes/functest-release.rst b/docs/release-notes/functest-release.rst
index ed258b690..9623b43d4 100644
--- a/docs/release-notes/functest-release.rst
+++ b/docs/release-notes/functest-release.rst
@@ -242,8 +242,10 @@ Colorado known restrictions/issues
| | | metadata service excluded from onos scenarios|
| | | https://gerrit.opnfv.org/gerrit/#/c/18729/ |
+-----------+-----------+----------------------------------------------+
-| any | odl_l3-* | vPing_ssh and Tempest cases related to using |
-| | | floating IP addresses are excluded (ODL bug) |
+| any | odl_l3-* | Tempest cases related to using floating IP |
+| | | addresses fail because of a known ODL bug. |
+| | | vPing_ssh test case is excluded for the same |
+| | | reason. |
| | | https://jira.opnfv.org/browse/APEX-112 |
| | | https://jira.opnfv.org/browse/FUNCTEST-445 |
+-----------+-----------+----------------------------------------------+
diff --git a/testcases/Controllers/ONOS/Teston/adapters/client.py b/testcases/Controllers/ONOS/Teston/adapters/client.py
index 77de092e4..6b3285e5e 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/client.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/client.py
@@ -10,15 +10,19 @@ Description:
# http://www.apache.org/licenses/LICENSE-2.0
#
"""
-from environment import environment
-import time
+import json
import pexpect
import requests
-import json
+import time
+
+from environment import environment
+import functest.utils.functest_logger as ft_logger
class client(environment):
+ logger = ft_logger.Logger("client").getLogger()
+
def __init__(self):
environment.__init__(self)
self.loginfo = environment()
@@ -50,7 +54,7 @@ class client(environment):
[len(lastshowscreeninfo)::])
lastshowscreeninfo = curshowscreeninfo
if Result == 0:
- print "Done!"
+ self.logger.info("Done!")
return
time.sleep(1)
circletime += 1
@@ -61,7 +65,7 @@ class client(environment):
def onosstart(self):
# This is the compass run machine user&pass,you need to modify
- print "Test Begin....."
+ self.logger.info("Test Begin.....")
self.OnosConnectionSet()
masterhandle = self.SSHlogin(self.localhost, self.masterusername,
self.masterpassword)
diff --git a/testcases/Controllers/ONOS/Teston/adapters/connection.py b/testcases/Controllers/ONOS/Teston/adapters/connection.py
index 16f2ef32c..b2a2e3d88 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/connection.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/connection.py
@@ -16,11 +16,15 @@ Description:
import os
import pexpect
import re
+
from foundation import foundation
+import functest.utils.functest_logger as ft_logger
class connection(foundation):
+ logger = ft_logger.Logger("connection").getLogger()
+
def __init__(self):
foundation.__init__(self)
self.loginfo = foundation()
@@ -33,7 +37,7 @@ class connection(foundation):
username: login user name
password: login password
"""
- print("Now Adding an user to known hosts " + ipaddr)
+ self.logger.info("Now Adding an user to known hosts " + ipaddr)
login = handle
login.sendline("ssh -l %s -p 8101 %s" % (username, ipaddr))
index = 0
@@ -78,7 +82,7 @@ class connection(foundation):
"""
Generate ssh keys, used for some server have no sshkey.
"""
- print "Now Generating SSH keys..."
+ self.logger.info("Now Generating SSH keys...")
# Here file name may be id_rsa or id_ecdsa or others
# So here will have a judgement
keysub = handle
@@ -112,7 +116,7 @@ class connection(foundation):
parameters:
password: root login password
"""
- print("Now changing to user root")
+ self.logger.info("Now changing to user root")
login = pexpect.spawn("su - root")
index = 0
while index != 2:
@@ -129,7 +133,7 @@ class connection(foundation):
"""
Exit root user.
"""
- print("Now Release user root")
+ self.logger.info("Now Release user root")
login = pexpect.spawn("exit")
index = login.expect(['logout', pexpect.EOF, pexpect.TIMEOUT])
if index == 0:
@@ -145,7 +149,7 @@ class connection(foundation):
parameters:
envalue: environment value to add
"""
- print "Now Adding bash environment"
+ self.logger.info("Now Adding bash environment")
fileopen = open("/etc/profile", 'r')
findContext = 1
while findContext:
@@ -165,7 +169,7 @@ class connection(foundation):
Change ONOS root path in file:bash_profile
onospath: path of onos root
"""
- print "Now Changing ONOS Root Path"
+ self.logger.info("Now Changing ONOS Root Path")
filepath = onospath + 'onos/tools/dev/bash_profile'
line = open(filepath, 'r').readlines()
lenall = len(line) - 1
@@ -175,7 +179,7 @@ class connection(foundation):
NewFile = open(filepath, 'w')
NewFile.writelines(line)
NewFile.close
- print "Done!"
+ self.logger.info("Done!")
def OnosConnectionSet(self):
"""
diff --git a/testcases/Controllers/ONOS/Teston/adapters/environment.py b/testcases/Controllers/ONOS/Teston/adapters/environment.py
index 231677333..f2755b669 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/environment.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/environment.py
@@ -15,17 +15,21 @@ Description:
#
"""
-import os
-import time
import pexpect
+import pxssh
import re
+import os
import sys
-import pxssh
+import time
+
from connection import connection
+import functest.utils.functest_logger as ft_logger
class environment(connection):
+ logger = ft_logger.Logger("environment").getLogger()
+
def __init__(self):
connection.__init__(self)
self.loginfo = connection()
@@ -39,9 +43,9 @@ class environment(connection):
handle: current working handle
codeurl: clone code url
"""
- print "Now loading test codes! Please wait in patient..."
+ self.logger.info("Now loading test codes! Please wait in patient...")
originalfolder = sys.path[0]
- print originalfolder
+ self.logger.info(originalfolder)
gitclone = handle
gitclone.sendline("git clone " + codeurl)
index = 0
@@ -82,7 +86,7 @@ class environment(connection):
parameters:
handle(input): current working handle
"""
- print "Now Cleaning test environment"
+ self.logger.info("Now Cleaning test environment")
handle.sendline("sudo apt-get install -y mininet")
handle.prompt()
handle.sendline("sudo pip install configobj")
@@ -102,7 +106,7 @@ class environment(connection):
cmd(input): onos-push-keys xxx(xxx is device)
password(input): login in password
"""
- print "Now Pushing Onos Keys:" + cmd
+ self.logger.info("Now Pushing Onos Keys:" + cmd)
Pushkeys = handle
Pushkeys.sendline(cmd)
Result = 0
@@ -121,7 +125,7 @@ class environment(connection):
break
time.sleep(2)
Pushkeys.prompt()
- print "Done!"
+ self.logger.info("Done!")
def SetOnosEnvVar(self, handle, masterpass, agentpass):
"""
@@ -131,13 +135,14 @@ class environment(connection):
masterpass: scripts running server's password
agentpass: onos cluster&compute node password
"""
- print "Now Setting test environment"
+ self.logger.info("Now Setting test environment")
for host in self.hosts:
- print "try to connect " + str(host)
+ self.logger.info("try to connect " + str(host))
result = self.CheckSshNoPasswd(host)
if not result:
- print ("ssh login failed,try to copy master publickey" +
- "to agent " + str(host))
+ self.logger.info(
+ "ssh login failed,try to copy master publickey" +
+ "to agent " + str(host))
self.CopyPublicKey(host)
self.OnosPushKeys(handle, "onos-push-keys " + self.OCT, masterpass)
self.OnosPushKeys(handle, "onos-push-keys " + self.OC1, agentpass)
@@ -173,7 +178,7 @@ class environment(connection):
user: onos&compute node user
password: onos&compute node password
"""
- print "Now Changing ONOS name&password"
+ self.logger.info("Now Changing ONOS name&password")
filepath = self.home + '/onos/tools/build/envDefaults'
line = open(filepath, 'r').readlines()
lenall = len(line) - 1
@@ -187,7 +192,7 @@ class environment(connection):
NewFile = open(filepath, 'w')
NewFile.writelines(line)
NewFile.close
- print "Done!"
+ self.logger.info("Done!")
def ChangeTestCasePara(self, testcase, user, password):
"""
@@ -196,7 +201,7 @@ class environment(connection):
user: onos&compute node user
password: onos&compute node password
"""
- print "Now Changing " + testcase + " name&password"
+ self.logger.info("Now Changing " + testcase + " name&password")
if self.masterusername == 'root':
filepath = '/root/'
else:
@@ -232,7 +237,7 @@ class environment(connection):
login.sendline('ls -l')
# match prompt
login.prompt()
- print("SSH login " + ipaddr + " success!")
+ self.logger.info("SSH login " + ipaddr + " success!")
return login
def SSHRelease(self, handle):
@@ -256,7 +261,7 @@ class environment(connection):
str(publickey) + ">>/root/.ssh/authorized_keys\'")
tmphandle.prompt()
self.SSHRelease(tmphandle)
- print "Add OCT PublicKey to " + host + " success"
+ self.logger.info("Add OCT PublicKey to " + host + " success")
def OnosEnvSetup(self, handle):
"""
diff --git a/testcases/Controllers/ONOS/Teston/adapters/foundation.py b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
index 70c84ac02..3fae2a5d2 100644
--- a/testcases/Controllers/ONOS/Teston/adapters/foundation.py
+++ b/testcases/Controllers/ONOS/Teston/adapters/foundation.py
@@ -16,8 +16,8 @@ import logging
import os
import re
import time
-
import yaml
+
from functest.utils.functest_utils import FUNCTEST_REPO as FUNCTEST_REPO
@@ -49,7 +49,6 @@ class foundation:
filemode='w')
filelog = logging.FileHandler(self.logfilepath)
logging.getLogger('Functest').addHandler(filelog)
- print loginfo
logging.info(loginfo)
def getdefaultpara(self):
diff --git a/testcases/OpenStack/tempest/custom_tests/blacklist.txt b/testcases/OpenStack/tempest/custom_tests/blacklist.txt
index a2427e282..42e1a327a 100644
--- a/testcases/OpenStack/tempest/custom_tests/blacklist.txt
+++ b/testcases/OpenStack/tempest/custom_tests/blacklist.txt
@@ -88,22 +88,3 @@
- fuel
tests:
- tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops
-
--
- # https://bugs.opendaylight.org/show_bug.cgi?id=5586
- # https://jira.opnfv.org/browse/APEX-112
- # https://jira.opnfv.org/browse/FUNCTEST-445
- scenarios:
- - os-odl_l3-nofeature-ha
- - os-odl_l3-nofeature-noha
- installers:
- - fuel
- - apex
- - compass
- - joid
- tests:
- - tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_reboot_server_hard
- - tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops
- - tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops
- - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_volume_boot_pattern
- - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPatternV2.test_volume_boot_pattern
diff --git a/testcases/features/doctor.py b/testcases/features/doctor.py
index 5fc0713f9..95531596f 100755
--- a/testcases/features/doctor.py
+++ b/testcases/features/doctor.py
@@ -13,12 +13,13 @@
# 0.2: measure test duration and publish results under json format
#
#
+import argparse
import time
-import argparse
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
+
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--report",
help="Create json result file",
@@ -29,6 +30,8 @@ functest_yaml = functest_utils.get_functest_yaml()
dirs = functest_yaml.get('general').get('directories')
DOCTOR_REPO = dirs.get('dir_repo_doctor')
+RESULTS_DIR = functest_utils.get_parameter_from_yaml(
+ 'general.directories.dir_results')
logger = ft_logger.Logger("doctor").getLogger()
@@ -36,19 +39,23 @@ logger = ft_logger.Logger("doctor").getLogger()
def main():
exit_code = -1
cmd = 'cd %s/tests && ./run.sh' % DOCTOR_REPO
+ log_file = RESULTS_DIR + "/doctor.log"
+
start_time = time.time()
- ret = functest_utils.execute_command(cmd, info=True,
- exit_on_error=False)
+ ret = functest_utils.execute_command(cmd,
+ info=True,
+ exit_on_error=False,
+ output_file=log_file)
stop_time = time.time()
duration = round(stop_time - start_time, 1)
if ret == 0:
- logger.info("doctor OK")
+ logger.info("Doctor test case OK")
test_status = 'OK'
exit_code = 0
else:
- logger.info("doctor FAILED")
+ logger.info("Doctor test case FAILED")
test_status = 'NOK'
details = {
diff --git a/testcases/features/domino.py b/testcases/features/domino.py
index aaf38047b..7835c5ce8 100755
--- a/testcases/features/domino.py
+++ b/testcases/features/domino.py
@@ -14,9 +14,9 @@
# 0.3: add report flag to push results when needed
#
+import argparse
import time
-import argparse
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
@@ -31,15 +31,20 @@ functest_yaml = functest_utils.get_functest_yaml()
dirs = functest_yaml.get('general').get('directories')
DOMINO_REPO = dirs.get('dir_repo_domino')
+RESULTS_DIR = functest_utils.get_parameter_from_yaml(
+ 'general.directories.dir_results')
logger = ft_logger.Logger("domino").getLogger()
def main():
cmd = 'cd %s && ./tests/run_multinode.sh' % DOMINO_REPO
+ log_file = RESULTS_DIR + "/domino.log"
start_time = time.time()
- ret = functest_utils.execute_command(cmd, exit_on_error=False)
+ ret = functest_utils.execute_command(cmd,
+ exit_on_error=False,
+ output_file=log_file)
stop_time = time.time()
duration = round(stop_time - start_time, 1)
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 644ad1a1b..4a98a8662 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -7,23 +7,21 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
-from datetime import datetime as dt
import json
import os
import re
-import requests
import shutil
import subprocess
import sys
import urllib2
-
-import functest.ci.tier_builder as tb
-import functest.utils.functest_logger as ft_logger
+from datetime import datetime as dt
import dns.resolver
-from git import Repo
+import requests
import yaml
+from git import Repo
+import functest.utils.functest_logger as ft_logger
logger = ft_logger.Logger("functest_utils").getLogger()
@@ -350,15 +348,16 @@ def get_deployment_dir():
def get_criteria_by_test(testname):
- criteria = ""
- file = get_testcases_file()
- tiers = tb.TierBuilder("", "", file)
- for tier in tiers.get_tiers():
- for test in tier.get_tests():
- if test.get_name() == testname:
- criteria = test.get_criteria()
-
- return criteria
+ with open(get_testcases_file()) as f:
+ testcases_yaml = yaml.safe_load(f)
+
+ for dic_tier in testcases_yaml.get("tiers"):
+ for dic_testcase in dic_tier['testcases']:
+ if dic_testcase['name'] == testname:
+ return dic_testcase['criteria']
+
+ logger.error('Project %s is not defined in testcases.yaml' % testname)
+ return None
# ----------------------------------------------------------
diff --git a/utils/openstack_clean.py b/utils/openstack_clean.py
index 3b937c917..ef26be1f3 100755
--- a/utils/openstack_clean.py
+++ b/utils/openstack_clean.py
@@ -233,7 +233,7 @@ def remove_ports(neutron_client, ports, network_ids):
except:
logger.debug(" > WARNING: Port %s does not contain fixed_ips"
% port_id)
- print port
+ logger.info(port)
router_id = port['device_id']
if len(port['fixed_ips']) == 0 and router_id == '':
logger.debug("Removing port %s ..." % port_id)