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
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)