]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Change the half of the bridge name used for ports
authorKevin Benton <blak111@gmail.com>
Wed, 1 Jul 2015 20:06:38 +0000 (13:06 -0700)
committerKevin Benton <kevinbenton@buttewifi.com>
Wed, 1 Jul 2015 21:22:57 +0000 (21:22 +0000)
The code to generate the names of the patch ports
was based on a chunk of the bridge name starting from
the beginning. With the long suffix, this ended up
excluding all of the random characters in the name.
(e.g. br-int374623235 would create an interface br-in-patch-tun).

This meant that if two tests using patch interfaces ran together,
they would have a name collision and one would fail.

This patch updates the patch port name generation to use the
randomized back portion of the name.

Change-Id: I172e0b2c0b53e8c7151bd92f0915773ea62c0c6a
Closes-Bug: #1470637

neutron/tests/functional/agent/test_l2_ovs_agent.py

index 75614b20f3ca916e3ee9b3f5d0e664a26c67209a..6deaab64e2ea8faa028a20a95328ff06dd0fcc40 100644 (file)
@@ -60,8 +60,8 @@ class OVSAgentTestFramework(base.BaseOVSLinuxTestCase):
         self.br_tun = base.get_rand_name(n_const.DEVICE_NAME_MAX_LEN,
                                          prefix='br-tun')
         patch_name_len = n_const.DEVICE_NAME_MAX_LEN - len("-patch-tun")
-        self.patch_tun = "%s-patch-tun" % self.br_int[:patch_name_len]
-        self.patch_int = "%s-patch-int" % self.br_tun[:patch_name_len]
+        self.patch_tun = "%s-patch-tun" % self.br_int[patch_name_len:]
+        self.patch_int = "%s-patch-int" % self.br_tun[patch_name_len:]
         self.ovs = ovs_lib.BaseOVS()
         self.config = self._configure_agent()
         self.driver = interface.OVSInterfaceDriver(self.config)