From e231fc19e6e6e7b65ee201cfd2c27683fd7b2af8 Mon Sep 17 00:00:00 2001 From: Genadi Chereshnya Date: Sun, 16 Jul 2017 09:51:58 +0300 Subject: [PATCH] [Tempest] Running Trunk test with advanced image only 1)Adding 'image_is_advanced' option to tempest config, so you can run specific tests with images that are not cirros. 2)Adding decorator to run 'subport_connectivity' test with such image for VLAN aware VM feature. 3)Configuring gate to run trunk test with ubuntu image only 4) Updating release notes and TESTING.rst with the change Conflicts: neutron/tests/tempest/scenario/test_trunk.py Change-Id: Ie15b0e79c6ea320322b2815fb8afbc8ec95f853a (cherry picked from commit 314277286dd2c9d3eb53c8dfed901abb445b2137) --- TESTING.rst | 14 ++++++++++++++ neutron/tests/contrib/hooks/ubuntu_image | 5 +++++ neutron/tests/tempest/config.py | 4 ++++ neutron/tests/tempest/scenario/test_trunk.py | 4 ++++ .../notes/advanced_image-8abff2ca91de7f6c.yaml | 11 +++++++++++ 5 files changed, 38 insertions(+) create mode 100644 releasenotes/notes/advanced_image-8abff2ca91de7f6c.yaml diff --git a/TESTING.rst b/TESTING.rst index 408255bf04a..f66de6fcc42 100644 --- a/TESTING.rst +++ b/TESTING.rst @@ -358,6 +358,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 e48a26aba1d..4c5f315c434 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/xenial/current/xenial-server-cloudimg DEFAULT_INSTANCE_TYPE="ds1G" 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 479d9093d07..30a219117ea 100644 --- a/neutron/tests/tempest/config.py +++ b/neutron/tests/tempest/config.py @@ -27,6 +27,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 13fec2d21da..0d7b19f735a 100644 --- a/neutron/tests/tempest/scenario/test_trunk.py +++ b/neutron/tests/tempest/scenario/test_trunk.py @@ -18,6 +18,7 @@ from tempest.common.utils.linux import remote_client from tempest.common import waiters from tempest.lib.common.utils import data_utils from tempest import test +import testtools from neutron.common import utils from neutron.tests.tempest import config @@ -220,6 +221,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.") @test.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``. +