aboutsummaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
Diffstat (limited to 'functest')
-rw-r--r--functest/ci/config_functest.yaml5
-rw-r--r--functest/ci/testcases.yaml20
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py17
-rw-r--r--functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml13
-rw-r--r--functest/opnfv_tests/openstack/vping/ping.sh19
-rw-r--r--functest/opnfv_tests/sdn/odl/odl.py3
-rw-r--r--functest/opnfv_tests/sdn/onos/teston/adapters/connection.py2
-rw-r--r--functest/opnfv_tests/sdn/onos/teston/adapters/environment.py22
-rw-r--r--functest/tests/unit/core/test_feature.py4
-rw-r--r--functest/tests/unit/openstack/tempest/test_conf_utils.py5
-rw-r--r--functest/tests/unit/vnf/ims/test_cloudify_ims.py9
-rw-r--r--functest/tests/unit/vnf/ims/test_orchestra_ims.py2
-rw-r--r--functest/tests/unit/vnf/rnc/__init__.py0
13 files changed, 77 insertions, 44 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index e26b3139..31ce4b90 100644
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -10,9 +10,8 @@ general:
repo_netready: /home/opnfv/repos/netready
repo_barometer: /home/opnfv/repos/barometer
repo_doctor: /home/opnfv/repos/doctor
- repo_copper: /home/opnfv/repos/copper
- repo_domino: /home/opnfv/repos/domino
- repo_fds: /home/opnfv/repos/fds
+ repo_odl_test: /src/odl_test
+ repo_fds: /src/fds
repo_securityscan: /home/opnfv/repos/securityscanning
repo_vrouter: /home/opnfv/repos/vnfs/vrouter
functest: /home/opnfv/functest
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index 0f8dff01..99c0cc20 100644
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -162,8 +162,8 @@ tiers:
class: 'ODLTests'
args:
suites:
- - /home/opnfv/repos/odl_test/csit/suites/integration/basic
- - /home/opnfv/repos/odl_test/csit/suites/openstack/neutron
+ - /src/odl_test/csit/suites/integration/basic
+ - /src/odl_test/csit/suites/openstack/neutron
-
case_name: odl_netvirt
@@ -183,9 +183,9 @@ tiers:
class: 'ODLTests'
args:
suites:
- - /home/opnfv/repos/odl_test/csit/suites/integration/basic
- - /home/opnfv/repos/odl_test/csit/suites/openstack/neutron
- - /home/opnfv/repos/odl_test/csit/suites/openstack/connectivity
+ - /src/odl_test/csit/suites/integration/basic
+ - /src/odl_test/csit/suites/openstack/neutron
+ - /src/odl_test/csit/suites/openstack/connectivity
-
case_name: fds
@@ -204,7 +204,7 @@ tiers:
class: 'ODLTests'
args:
suites:
- - /home/opnfv/repos/fds/testing/robot
+ - /src/fds/testing/robot
-
case_name: onos
@@ -297,7 +297,7 @@ tiers:
module: 'functest.core.feature'
class: 'BashFeature'
args:
- cmd: 'cd /usr/local/lib/python2.7/dist-packages/sdnvpn/test/functest && python ./run_tests.py'
+ cmd: 'run_sdnvpn_tests.py'
-
case_name: security_scan
@@ -331,7 +331,7 @@ tiers:
module: 'functest.core.feature'
class: 'BashFeature'
args:
- cmd: 'cd /home/opnfv/repos/copper/tests && bash run.sh && cd -'
+ cmd: 'cd /src/copper/tests && bash run.sh && cd -'
-
case_name: multisite
@@ -363,7 +363,7 @@ tiers:
module: 'functest.core.feature'
class: 'BashFeature'
args:
- cmd: 'cd /usr/local/lib/python2.7/dist-packages/sfc/tests/functest && python ./run_tests.py'
+ cmd: 'run_sfc_tests.py'
-
case_name: onos_sfc
@@ -411,7 +411,7 @@ tiers:
module: 'functest.core.feature'
class: 'BashFeature'
args:
- cmd: 'cd /home/opnfv/repos/domino && ./tests/run_multinode.sh'
+ cmd: 'cd /src/domino && ./tests/run_multinode.sh'
-
case_name: gluon_vping
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index d494db5e..2313ec04 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -15,6 +15,8 @@ import re
import shutil
import subprocess
+import yaml
+
from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
@@ -38,6 +40,8 @@ TEMPEST_RAW_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_raw_list.txt')
TEMPEST_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_list.txt')
REFSTACK_RESULTS_DIR = os.path.join(CONST.__getattribute__('dir_results'),
'refstack')
+TEMPEST_CONF_YAML = pkg_resources.resource_filename(
+ 'functest', 'opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml')
CI_INSTALLER_TYPE = CONST.__getattribute__('INSTALLER_TYPE')
CI_INSTALLER_IP = CONST.__getattribute__('INSTALLER_IP')
@@ -328,6 +332,19 @@ def configure_tempest_update_params(tempest_conf_file,
config.set(service, 'endpoint_type',
CONST.__getattribute__('OS_ENDPOINT_TYPE'))
+ logger.debug('Add/Update required params defined in tempest_conf.yaml '
+ 'into tempest.conf file')
+ with open(TEMPEST_CONF_YAML) as f:
+ conf_yaml = yaml.safe_load(f)
+ if not conf_yaml:
+ sections = config.sections()
+ for section in conf_yaml:
+ if section not in sections:
+ config.add_section(section)
+ sub_conf = conf_yaml.get(section)
+ for key, value in sub_conf.items():
+ config.set(section, key, value)
+
with open(tempest_conf_file, 'wb') as config_file:
config.write(config_file)
diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
new file mode 100644
index 00000000..b47a9736
--- /dev/null
+++ b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
@@ -0,0 +1,13 @@
+# This is an empty configuration file to be filled up with the desired options
+# to generate a custom tempest.conf
+# Examples:
+# network-feature-enabled:
+# port_security: True
+
+# volume-feature-enabled:
+# api_v1: False
+
+# validation:
+# image_ssh_user: root
+# ssh_timeout: 300
+
diff --git a/functest/opnfv_tests/openstack/vping/ping.sh b/functest/opnfv_tests/openstack/vping/ping.sh
index 693b8682..15f5e84e 100644
--- a/functest/opnfv_tests/openstack/vping/ping.sh
+++ b/functest/opnfv_tests/openstack/vping/ping.sh
@@ -1,13 +1,10 @@
#!/bin/sh
-while true; do
- ping -c 1 $1 2>&1 >/dev/null
- RES=$?
- if [ "Z$RES" = "Z0" ] ; then
- echo 'vPing OK'
- break
- else
- echo 'vPing KO'
- fi
- sleep 1
-done \ No newline at end of file
+
+ping -c 1 $1 2>&1 >/dev/null
+RES=$?
+if [ "Z$RES" = "Z0" ] ; then
+ echo 'vPing OK'
+else
+ echo 'vPing KO'
+fi
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py
index 5724012c..841da834 100644
--- a/functest/opnfv_tests/sdn/odl/odl.py
+++ b/functest/opnfv_tests/sdn/odl/odl.py
@@ -66,8 +66,7 @@ class ODLResultVisitor(robot.api.ResultVisitor):
class ODLTests(testcase.TestCase):
"""ODL test runner."""
- odl_test_repo = os.path.join(
- constants.CONST.__getattribute__('dir_repos'), 'odl_test')
+ odl_test_repo = constants.CONST.__getattribute__('dir_repo_odl_test')
neutron_suite_dir = os.path.join(odl_test_repo,
"csit/suites/openstack/neutron")
basic_suite_dir = os.path.join(odl_test_repo,
diff --git a/functest/opnfv_tests/sdn/onos/teston/adapters/connection.py b/functest/opnfv_tests/sdn/onos/teston/adapters/connection.py
index dfaa5cc1..a6d192ee 100644
--- a/functest/opnfv_tests/sdn/onos/teston/adapters/connection.py
+++ b/functest/opnfv_tests/sdn/onos/teston/adapters/connection.py
@@ -64,7 +64,7 @@ class Connection(Foundation):
"""
os.getenv only returns current user value
GetEnvValue returns a environment value of
- current handle
+ current handle
eg: GetEnvValue(handle,'HOME')
"""
envhandle = handle
diff --git a/functest/opnfv_tests/sdn/onos/teston/adapters/environment.py b/functest/opnfv_tests/sdn/onos/teston/adapters/environment.py
index cb75b5c3..875a2dc9 100644
--- a/functest/opnfv_tests/sdn/onos/teston/adapters/environment.py
+++ b/functest/opnfv_tests/sdn/onos/teston/adapters/environment.py
@@ -1,11 +1,11 @@
"""
Description:
- This file is used to setup the running environment
- Include Download code,setup environment variable
- Set onos running config
- Set user name/password
- Onos-push-keys and so on
- lanqinglong@huawei.com
+This file is used to setup the running environment
+Include Download code,setup environment variable
+Set onos running config
+Set user name/password
+Onos-push-keys and so on
+lanqinglong@huawei.com
#
# All rights reserved. This program and the accompanying materials
@@ -17,7 +17,7 @@ Description:
import logging
import pexpect
-import pxssh
+from pexpect import pxssh
import re
import os
import sys
@@ -196,10 +196,10 @@ class Environment(Connection):
def ChangeTestCasePara(self, testcase, user, password):
"""
- When running test script, there's something need
- to change in every test folder's *.param & *.topo files
- user: onos&compute node user
- password: onos&compute node password
+ When running test script, there\'s something need
+ to change in every test folder\'s \*.param & \*.topo files
+ user: onos\&compute node user
+ password: onos\&compute node password
"""
self.logger.info("Now Changing " + testcase + " name&password")
if self.masterusername == 'root':
diff --git a/functest/tests/unit/core/test_feature.py b/functest/tests/unit/core/test_feature.py
index 988981ef..553a5dfa 100644
--- a/functest/tests/unit/core/test_feature.py
+++ b/functest/tests/unit/core/test_feature.py
@@ -22,8 +22,8 @@ class FeatureTestingBase(unittest.TestCase):
_case_name = "foo"
_project_name = "bar"
- _repo = "dir_repo_copper"
- _cmd = "cd /home/opnfv/repos/foo/tests && bash run.sh && cd -"
+ _repo = "dir_repo_bar"
+ _cmd = "cd /home/opnfv/repos/bar/tests && bash run.sh && cd -"
_output_file = '/home/opnfv/functest/results/foo.log'
feature = None
diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py
index 37904965..79ef9915 100644
--- a/functest/tests/unit/openstack/tempest/test_conf_utils.py
+++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py
@@ -261,8 +261,11 @@ class OSTempestConfUtilsTesting(unittest.TestCase):
'write') as mwrite, \
mock.patch('__builtin__.open', mock.mock_open()), \
mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.backup_tempest_config'):
+ 'conf_utils.backup_tempest_config'), \
+ mock.patch('functest.utils.functest_utils.yaml.safe_load') \
+ as mock_yaml:
CONST.__setattr__('OS_ENDPOINT_TYPE', None)
+ mock_yaml.return_value = mock.Mock()
conf_utils.\
configure_tempest_update_params('test_conf_file',
IMAGE_ID=image_id,
diff --git a/functest/tests/unit/vnf/ims/test_cloudify_ims.py b/functest/tests/unit/vnf/ims/test_cloudify_ims.py
index 537c5146..f0483c69 100644
--- a/functest/tests/unit/vnf/ims/test_cloudify_ims.py
+++ b/functest/tests/unit/vnf/ims/test_cloudify_ims.py
@@ -13,6 +13,8 @@ import mock
from functest.core import vnf
from functest.opnfv_tests.vnf.ims import cloudify_ims
+from snaps.openstack.os_credentials import OSCreds
+
class CloudifyImsTesting(unittest.TestCase):
@@ -79,8 +81,11 @@ class CloudifyImsTesting(unittest.TestCase):
@mock.patch('snaps.openstack.create_image.OpenStackImage.create')
def test_prepare_bad_auth_url(self, *args):
with self.assertRaises(Exception):
- self.ims_vnf.prepare()
- args[0].assert_not_called()
+ self.ims_vnf.image_creator(
+ OSCreds(username='user', password='pass', auth_url='url',
+ project_name='project', identity_api_version=3),
+ mock.Mock())
+ args[0].assert_not_called()
def test_prepare_missing_param(self):
with self.assertRaises(vnf.VnfPreparationException):
diff --git a/functest/tests/unit/vnf/ims/test_orchestra_ims.py b/functest/tests/unit/vnf/ims/test_orchestra_ims.py
index 21999730..5a1efc7f 100644
--- a/functest/tests/unit/vnf/ims/test_orchestra_ims.py
+++ b/functest/tests/unit/vnf/ims/test_orchestra_ims.py
@@ -154,7 +154,7 @@ class OrchestraImsTesting(unittest.TestCase):
"""Testing prepare function with bad auth url"""
with self.assertRaises(Exception):
self.ims_vnf.prepare()
- args[0].assert_not_called()
+ args[0].assert_not_called()
def test_prepare_missing_param(self):
"""Testing prepare function with missing param"""
diff --git a/functest/tests/unit/vnf/rnc/__init__.py b/functest/tests/unit/vnf/rnc/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/functest/tests/unit/vnf/rnc/__init__.py
+++ /dev/null