Merge pull request #255 from AurelienLourot/ovs-mark-managed-ports
Re-enable neutron/test_800_ovs_bridges_are_managed_by_us
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
import copy
|
||||
import logging
|
||||
import tenacity
|
||||
import unittest
|
||||
|
||||
import zaza
|
||||
import zaza.openstack.charm_tests.nova.utils as nova_utils
|
||||
@@ -35,6 +34,7 @@ import zaza.openstack.utilities.openstack as openstack_utils
|
||||
class NeutronPluginApiSharedTests(test_utils.OpenStackBaseTest):
|
||||
"""Shared tests for Neutron Plugin API Charms."""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Run class setup for running Neutron Openvswitch tests."""
|
||||
super(NeutronPluginApiSharedTests, cls).setUpClass()
|
||||
@@ -109,7 +109,7 @@ class NeutronGatewayTest(NeutronPluginApiSharedTests):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Run class setup for running Neutron Gateway tests."""
|
||||
super(NeutronGatewayTest, cls).setUpClass(cls)
|
||||
super(NeutronGatewayTest, cls).setUpClass()
|
||||
cls.services = cls._get_services()
|
||||
|
||||
# set up clients
|
||||
@@ -148,33 +148,6 @@ class NeutronGatewayTest(NeutronPluginApiSharedTests):
|
||||
|
||||
self.assertIn('qos', ovs_agent['configurations']['extensions'])
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_800_ovs_bridges_are_managed_by_us(self):
|
||||
"""Checking OVS bridges' external-id.
|
||||
|
||||
OVS bridges created by us should be marked as managed by us in their
|
||||
external-id. See
|
||||
http://docs.openvswitch.org/en/latest/topics/integration/
|
||||
|
||||
NOTE(lourot): this test is expected to fail as long as this feature
|
||||
hasn't landed yet: https://review.opendev.org/717074
|
||||
"""
|
||||
for unit in zaza.model.get_units(self._APP_NAME,
|
||||
model_name=self.model_name):
|
||||
for bridge_name in ('br-int', 'br-ex'):
|
||||
logging.info(
|
||||
'Checking that the bridge {}:{}'.format(
|
||||
unit.name, bridge_name
|
||||
) + ' is marked as managed by us'
|
||||
)
|
||||
expected_external_id = 'charm-neutron-gateway=managed'
|
||||
actual_external_id = zaza.model.run_on_unit(
|
||||
unit.entity_id,
|
||||
'ovs-vsctl br-get-external-id {}'.format(bridge_name),
|
||||
model_name=self.model_name
|
||||
)['Stdout'].strip()
|
||||
self.assertEqual(actual_external_id, expected_external_id)
|
||||
|
||||
def test_900_restart_on_config_change(self):
|
||||
"""Checking restart happens on config change.
|
||||
|
||||
@@ -454,7 +427,7 @@ class NeutronOpenvSwitchTest(NeutronPluginApiSharedTests):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Run class setup for running Neutron Openvswitch tests."""
|
||||
super(NeutronOpenvSwitchTest, cls).setUpClass(cls)
|
||||
super(NeutronOpenvSwitchTest, cls).setUpClass()
|
||||
|
||||
# set up client
|
||||
cls.neutron_client = (
|
||||
@@ -617,6 +590,33 @@ class NeutronOpenvSwitchTest(NeutronPluginApiSharedTests):
|
||||
logging.info('Testing pause resume')
|
||||
|
||||
|
||||
class NeutronOvsVsctlTest(NeutronPluginApiSharedTests):
|
||||
"""Test 'ovs-vsctl'-related functionality on Neutron charms."""
|
||||
|
||||
def test_800_ovs_bridges_are_managed_by_us(self):
|
||||
"""Checking OVS bridges' external-id.
|
||||
|
||||
OVS bridges created by us should be marked as managed by us in their
|
||||
external-id. See
|
||||
http://docs.openvswitch.org/en/latest/topics/integration/
|
||||
"""
|
||||
for unit in zaza.model.get_units(self.application_name,
|
||||
model_name=self.model_name):
|
||||
for bridge_name in ('br-int', 'br-ex'):
|
||||
logging.info(
|
||||
'Checking that the bridge {}:{}'.format(
|
||||
unit.name, bridge_name
|
||||
) + ' is marked as managed by us'
|
||||
)
|
||||
expected_external_id = 'charm-neutron-gateway=managed'
|
||||
actual_external_id = zaza.model.run_on_unit(
|
||||
unit.entity_id,
|
||||
'ovs-vsctl br-get-external-id {}'.format(bridge_name),
|
||||
model_name=self.model_name
|
||||
)['Stdout'].strip()
|
||||
self.assertEqual(actual_external_id, expected_external_id)
|
||||
|
||||
|
||||
class NeutronNetworkingBase(test_utils.OpenStackBaseTest):
|
||||
"""Base for checking openstack instances have valid networking."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user