It avoids fasly testcases in failure for end users.
It also removes the neutron_trunk class which is now useless (Queens).
Change-Id: I3f5a1ac84a50e061da6eadcc5c9bafb2e99050db
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
OpenStack Tempest suite. The list of test cases is
generated by Tempest having as input the relevant
testcase list file.
- dependencies:
- - INSTALLER_TYPE: '(fuel)|(apex)|(compass)'
run:
- module: 'functest.opnfv_tests.openstack.trunk.trunk'
- class: 'TempestNeutronTrunk'
+ module: 'functest.opnfv_tests.openstack.tempest.tempest'
+ class: 'TempestCommon'
args:
mode: 'neutron_tempest_plugin.(api|scenario).test_trunk'
+ neutron_extensions:
+ - trunk
+ - trunk_details
-
case_name: barbican
description: >-
It leverages on the tempest plugin containing tests used to
verify the functionality of a barbican installation.
- dependencies:
- - INSTALLER_TYPE: '^((?!fuel|apex|compass|daisy|osa).)*$'
run:
module: 'functest.opnfv_tests.openstack.tempest.tempest'
class: 'TempestCommon'
args:
mode: 'barbican_tempest_plugin.tests.(api|scenario)'
+ services:
+ - barbican
OpenStack Tempest suite. The list of test cases is
generated by Tempest having as input the relevant
testcase list file.
- dependencies:
- - INSTALLER_TYPE: '(fuel)|(apex)|(compass)'
run:
- module: 'functest.opnfv_tests.openstack.trunk.trunk'
- class: 'TempestNeutronTrunk'
+ module: 'functest.opnfv_tests.openstack.tempest.tempest'
+ class: 'TempestCommon'
args:
mode: 'neutron_tempest_plugin.(api|scenario).test_trunk'
+ neutron_extensions:
+ - trunk
+ - trunk_details
-
case_name: barbican
description: >-
It leverages on the tempest plugin containing tests used to
verify the functionality of a barbican installation.
- dependencies:
- - INSTALLER_TYPE: '^((?!fuel|apex|compass|daisy|osa).)*$'
run:
module: 'functest.opnfv_tests.openstack.tempest.tempest'
class: 'TempestCommon'
args:
mode: 'barbican_tempest_plugin.tests.(api|scenario)'
+ services:
+ - barbican
-
name: features
self.conf_file = None
self.image_alt = None
self.flavor_alt = None
+ self.services = []
+ try:
+ self.services = kwargs['run']['args']['services']
+ except Exception: # pylint: disable=broad-except
+ pass
+ self.neutron_extensions = []
+ try:
+ self.neutron_extensions = kwargs['run']['args'][
+ 'neutron_extensions']
+ except Exception: # pylint: disable=broad-except
+ pass
+
+ def check_services(self):
+ """Check the mandatory services."""
+ for service in self.services:
+ try:
+ self.cloud.search_services(service)[0]
+ except Exception: # pylint: disable=broad-except
+ self.is_skipped = True
+ break
+
+ def check_extensions(self):
+ """Check the mandatory network extensions."""
+ extensions = self.cloud.get_network_extensions()
+ for network_extension in self.neutron_extensions:
+ if network_extension not in extensions:
+ LOGGER.warning(
+ "Cannot find Neutron extension: %s", network_extension)
+ self.is_skipped = True
+ break
+
+ def check_requirements(self):
+ self.check_services()
+ self.check_extensions()
@staticmethod
def read_file(filename):
+++ /dev/null
-#!/usr/bin/env python
-
-# Copyright (c) 2018 Orange and others.
-#
-# 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
-
-# pylint: disable=missing-docstring
-
-from six.moves import configparser
-
-from functest.opnfv_tests.openstack.tempest import tempest
-
-
-class TempestNeutronTrunk(tempest.TempestCommon):
- """Tempest neutron trunk testcase implementation."""
-
- def configure(self, **kwargs):
- super(TempestNeutronTrunk, self).configure(**kwargs)
- rconfig = configparser.RawConfigParser()
- rconfig.read(self.conf_file)
- rconfig.set('network-feature-enabled', 'api_extensions', 'all')
- with open(self.conf_file, 'wb') as config_file:
- rconfig.write(config_file)
- self.backup_tempest_config(self.conf_file, self.res_dir)