aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPanagiotis Karalis <pkaralis@intracom-telecom.com>2018-02-23 14:56:25 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-03-13 16:36:08 +0100
commit0ce4ba21f5b934431adfa8a96f20065483a9f5c9 (patch)
tree9a7f128eb5c433fcdf0d6b6e63e3a9b872a8b6c2
parent632556645e8b3a4487c59e311e2cd43147c8d082 (diff)
Implement trunk ports testcase
The tempest testcases have been integrated from Neutron trunk testcases. It also enables every Neutron extension which may raise side effects [1]. [1] https://docs.openstack.org/tempest/latest/sampleconf.html JIRA: FUNCTEST-926 Change-Id: I05015acf119f504ce0a5539d677719de874594ad Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
-rw-r--r--docker/restapi/Dockerfile6
-rw-r--r--docker/smoke/Dockerfile6
-rw-r--r--docker/smoke/testcases.yaml17
-rw-r--r--functest/ci/testcases.yaml17
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py2
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py13
-rw-r--r--functest/tests/unit/openstack/tempest/test_tempest.py6
7 files changed, 66 insertions, 1 deletions
diff --git a/docker/restapi/Dockerfile b/docker/restapi/Dockerfile
index 32a8b3964..3286c8753 100644
--- a/docker/restapi/Dockerfile
+++ b/docker/restapi/Dockerfile
@@ -51,6 +51,12 @@ RUN apk --no-cache add --update python3 sshpass \
juju-wait && \
go get github.com/rogpeppe/godeps && \
(cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system) && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+ -e git+https://github.com/openstack/neutron.git@$OPENSTACK_TAG#egg=neutron && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+ -r /src/neutron/test-requirements.txt && \
mkdir -p /etc/rally && \
printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
mkdir -p /var/lib/rally/database && rally db create && \
diff --git a/docker/smoke/Dockerfile b/docker/smoke/Dockerfile
index ad0ae9fcd..e09ea1c2c 100644
--- a/docker/smoke/Dockerfile
+++ b/docker/smoke/Dockerfile
@@ -34,6 +34,12 @@ RUN apk --no-cache add --virtual .build-deps --update \
git clone https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
(cd /src/odl_test && git checkout $ODL_TAG) && \
virtualenv --system-site-packages /src/tempest/.venv && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+ -e git+https://github.com/openstack/neutron.git@$OPENSTACK_TAG#egg=neutron && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+ -r /src/neutron/test-requirements.txt && \
rm -r upper-constraints.txt thirdparty-requirements.txt /src/odl_test/.git \
/src/os-faults /src/rally && \
mkdir -p /etc/rally && \
diff --git a/docker/smoke/testcases.yaml b/docker/smoke/testcases.yaml
index 9f017e5f3..44539c9ea 100644
--- a/docker/smoke/testcases.yaml
+++ b/docker/smoke/testcases.yaml
@@ -171,3 +171,20 @@ tiers:
run:
module: 'functest.opnfv_tests.openstack.snaps.smoke'
class: 'SnapsSmoke'
+
+ -
+ case_name: neutron_trunk
+ project_name: functest
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case runs the neutron trunk subtest of the
+ OpenStack Tempest suite. The list of test cases is
+ generated by Tempest having as input the relevant
+ testcase list file.
+ dependencies:
+ installer: '(fuel)|(apex)|(compass)'
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.openstack.tempest.tempest'
+ class: 'TempestNeutronTrunk'
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index 7cbe0e69f..1ebeef793 100644
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -234,6 +234,23 @@ tiers:
module: 'functest.opnfv_tests.openstack.snaps.smoke'
class: 'SnapsSmoke'
+ -
+ case_name: neutron_trunk
+ project_name: functest
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case runs the neutron trunk subtest of the
+ OpenStack Tempest suite. The list of test cases is
+ generated by Tempest having as input the relevant
+ testcase list file.
+ dependencies:
+ installer: '(fuel)|(apex)|(compass)'
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.openstack.tempest.tempest'
+ class: 'TempestNeutronTrunk'
+
-
name: features
order: 2
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 6121ab970..b3d0d0139 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -271,6 +271,8 @@ def configure_tempest_update_params(tempest_conf_file, res_dir,
rconfig.set('identity', 'v3_endpoint_type',
os.environ.get('OS_ENDPOINT_TYPE'))
+ rconfig.set('network-feature-enabled', 'api_extensions', 'all')
+
if os.environ.get('OS_ENDPOINT_TYPE') is not None:
sections = rconfig.sections()
services_list = [
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 1d85e689a..059def384 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -289,6 +289,19 @@ class TempestSmokeSerial(TempestCommon):
self.option = ["--concurrency", "1"]
+class TempestNeutronTrunk(TempestCommon):
+ """Tempest neutron trunk testcase implementation."""
+ def __init__(self, **kwargs):
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = 'neutron_trunk'
+ TempestCommon.__init__(self, **kwargs)
+ self.mode = "'neutron.tests.tempest.(api|scenario).test_trunk'"
+ self.res_dir = os.path.join(
+ getattr(config.CONF, 'dir_results'), 'neutron_trunk')
+ self.raw_list = os.path.join(self.res_dir, 'test_raw_list.txt')
+ self.list = os.path.join(self.res_dir, 'test_list.txt')
+
+
class TempestSmokeParallel(TempestCommon):
"""Tempest smoke parallel testcase implementation."""
def __init__(self, **kwargs):
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index 7a2394918..52d98465d 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -47,6 +47,7 @@ class OSTempestTesting(unittest.TestCase):
self.tempestfull_parallel = tempest.TempestFullParallel()
self.tempestcustom = tempest.TempestCustom()
self.tempestdefcore = tempest.TempestDefcore()
+ self.tempestneutrontrunk = tempest.TempestNeutronTrunk()
@mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.error')
@mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.debug')
@@ -79,7 +80,7 @@ class OSTempestTesting(unittest.TestCase):
elif self.tempestcommon.mode == 'full':
testr_mode = r"'^tempest\.'"
else:
- testr_mode = 'tempest.api.' + self.tempestcommon.mode
+ testr_mode = self.tempestcommon.mode
verifier_repo_dir = 'test_verifier_repo_dir'
cmd = ("cd {0};"
"testr list-tests {1} > {2};"
@@ -94,6 +95,9 @@ class OSTempestTesting(unittest.TestCase):
def test_gen_tl_full_mode(self):
self._test_gen_tl_mode_default('full')
+ def test_gen_tl_neutron_trunk_mode(self):
+ self._test_gen_tl_mode_default('neutron_trunk')
+
def test_verif_res_missing_verif_id(self):
self.tempestcommon.verification_id = None
with self.assertRaises(Exception):