]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Prepare to functionally test OVSDB interfaces
authorTerry Wilson <twilson@redhat.com>
Thu, 22 Jan 2015 09:52:33 +0000 (03:52 -0600)
committerTerry Wilson <twilson@redhat.com>
Wed, 11 Feb 2015 02:43:23 +0000 (02:43 +0000)
When the OVSDB interface is added, make it easy to run all
ovs-related functional tests against both interfaces.

Partially-Implements: blueprint vsctl-to-ovsdb
Change-Id: Iadff4ec8c44be61861a2358745c7b08dc8985d26

neutron/tests/functional/agent/linux/base.py

index 40364c3f02d30668dce6b4fbcc721534ac8c0e7b..eed65578078d0457e4693d2af152e9f7412e383a 100644 (file)
@@ -14,6 +14,7 @@
 
 import netaddr
 from oslo_config import cfg
+import testscenarios
 
 from neutron.agent.common import config
 from neutron.agent.linux import ip_lib
@@ -114,9 +115,17 @@ class BaseLinuxTestCase(functional_base.BaseSudoTestCase):
         return str(net)
 
 
-class BaseOVSLinuxTestCase(BaseLinuxTestCase):
+# Regarding MRO, it goes BaseOVSLinuxTestCase, WithScenarios,
+# BaseLinuxTestCase, ..., UnitTest, object. setUp is not dfined in
+# WithScenarios, so it will correctly be found in BaseLinuxTestCase.
+class BaseOVSLinuxTestCase(testscenarios.WithScenarios, BaseLinuxTestCase):
+    scenarios = [
+        ('vsctl', dict(ovsdb_interface='vsctl')),
+    ]
+
     def setUp(self):
         super(BaseOVSLinuxTestCase, self).setUp()
+        self.config(group='OVS', ovsdb_interface=self.ovsdb_interface)
         self.ovs = ovs_lib.BaseOVS(self.root_helper)
         self.ip = ip_lib.IPWrapper(self.root_helper)