In "FdbInterfaceTestCase" test cases (no namespace scenario), can happen that two test cases are creating VXLAN interfaces in the kernel namespace (VTI) in the same VTEP and the same destination port (default=4789). In this case, the kernel will raise the exception errno.EEXIST (file already exists).
In order to avoid this problem, a random VNI could be used when creating the VXLAN interfaces.
In "FdbInterfaceTe stCase" test cases (no namespace scenario), can happen that two test cases are creating VXLAN interfaces in the kernel namespace (VTI) in the same VTEP and the same destination port (default=4789). In this case, the kernel will raise the exception errno.EEXIST (file already exists).
In order to avoid this problem, a random VNI could be used when creating the VXLAN interfaces.
How to test this:
from neutron.agent.linux import ip_lib privileged. agent.linux import ip_lib as priv_ip_lib ip_lib. remove_ netns(ns_ name) lib.create_ netns(ns_ name) IPWrapper( ns_name) add_dummy( dev) add_dummy( dev2) IPDevice( dev, ns_name) IPDevice( dev2, ns_name) link.set_ up() link.set_ up() add_vxlan( dev_vxlan, 100, dev=dev) wrapper. add_vxlan( dev_vxlan2, 100, dev=dev2) lib.remove_ netns(ns_ name)
from neutron.
ns_name = 'ns_test'
try:
priv_
except:
pass
priv_ip_
dev = 'device'
dev2 = 'device2'
dev_vxlan = 'device_vxlan'
dev_vxlan2 = 'device_vxlan2'
ip_wrapper = ip_lib.
ip_wrapper.
ip_wrapper.
ip_device1 = ip_lib.
ip_device2 = ip_lib.
ip_device1.
ip_device2.
ip_wrapper.
try:
ip_
except Exception as e:
print(str(e))
priv_ip_