diff --git a/TESTING.rst b/TESTING.rst index 761ea39f5c2..15be7835190 100644 --- a/TESTING.rst +++ b/TESTING.rst @@ -386,6 +386,20 @@ http://docs.openstack.org/developer/tempest/field_guide/scenario.html Scenario tests, like API tests, are split between the Tempest and Neutron repositories according to the Neutron API the test is targeting. +Some scenario tests require advanced ``Glance`` images (for example, ``Ubuntu`` +or ``CentOS``) in order to pass. Those tests are skipped by default. To enable +them, make sure ``tempest.conf`` is configured to use an advanced image, and +then set the following in ``tempest`` configuration file:: + +.. code-block:: ini + + [neutron_plugin_options] + image_is_advanced = True + +Specific test requirements for advanced images are: + +#. ``test_trunk`` requires ``802.11q`` kernel module loaded. + Rally Tests ~~~~~~~~~~~ diff --git a/neutron/tests/contrib/hooks/ubuntu_image b/neutron/tests/contrib/hooks/ubuntu_image index ad710b8b832..0e14303fa59 100644 --- a/neutron/tests/contrib/hooks/ubuntu_image +++ b/neutron/tests/contrib/hooks/ubuntu_image @@ -3,3 +3,8 @@ IMAGE_URLS="http://cloud-images.ubuntu.com/releases/16.04/release-20170113/ubunt DEFAULT_INSTANCE_TYPE=ds512M DEFAULT_INSTANCE_USER=ubuntu BUILD_TIMEOUT=392 + +[[test-config|$TEMPEST_CONFIG]] + +[neutron_plugin_options] +image_is_advanced=True diff --git a/neutron/tests/tempest/config.py b/neutron/tests/tempest/config.py index 5a9ac77c5cf..6830b184f19 100644 --- a/neutron/tests/tempest/config.py +++ b/neutron/tests/tempest/config.py @@ -30,6 +30,10 @@ NeutronPluginOptions = [ default=[], help='List of network types available to neutron, ' 'e.g. vxlan,vlan,gre.'), + cfg.BoolOpt('image_is_advanced', + default=False, + help='Image that supports features that cirros does not, like' + ' Ubuntu or CentOS supporting advanced features'), ] # TODO(amuller): Redo configuration options registration as part of the planned diff --git a/neutron/tests/tempest/scenario/test_trunk.py b/neutron/tests/tempest/scenario/test_trunk.py index 5d775ef351c..1412b11f223 100644 --- a/neutron/tests/tempest/scenario/test_trunk.py +++ b/neutron/tests/tempest/scenario/test_trunk.py @@ -18,6 +18,7 @@ from tempest.common import waiters from tempest.lib.common.utils import data_utils from tempest.lib import decorators from tempest import test +import testtools from neutron.common import utils from neutron.tests.tempest.common import ssh @@ -221,6 +222,9 @@ class TrunkTest(base.BaseTempestTestCase): CONF.validation.image_ssh_user, self.keypair['private_key']) + @testtools.skipUnless( + CONF.neutron_plugin_options.image_is_advanced, + "Advanced image is required to run this test.") @decorators.idempotent_id('a8a02c9b-b453-49b5-89a2-cce7da66aafb') def test_subport_connectivity(self): vlan_tag = 10 diff --git a/releasenotes/notes/advanced_image-8abff2ca91de7f6c.yaml b/releasenotes/notes/advanced_image-8abff2ca91de7f6c.yaml new file mode 100644 index 00000000000..3f08a32aa55 --- /dev/null +++ b/releasenotes/notes/advanced_image-8abff2ca91de7f6c.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Some scenario tests require advanced ``Glance`` images (for example, + ``Ubuntu`` or ``CentOS``) in order to pass. They are now skipped by + default. If you need to execute those tests, please configure + ``tempest.conf`` to use an advanced image, and set ``image_is_advanced`` in + ``neutron_plugin_options`` section of ``tempest.conf`` file to ``True``. + The first scenario test case that requires the new option set to execute is + ``test_trunk``. +