- def linux_add_bridge(node, br_name, if_1, if_2):
+ def linux_add_bridge(node, br_name, if_1, if_2, set_up=True):
"""Bridge two interfaces on linux node.
:param node: Node to add bridge on.
:param br_name: Bridge name.
:param if_1: First interface to be added to the bridge.
:param if_2: Second interface to be added to the bridge.
"""Bridge two interfaces on linux node.
:param node: Node to add bridge on.
:param br_name: Bridge name.
:param if_1: First interface to be added to the bridge.
:param if_2: Second interface to be added to the bridge.
"""
cmd = 'brctl addbr {0}'.format(br_name)
exec_cmd_no_error(node, cmd, sudo=True)
"""
cmd = 'brctl addbr {0}'.format(br_name)
exec_cmd_no_error(node, cmd, sudo=True)
exec_cmd_no_error(node, cmd, sudo=True)
cmd = 'brctl addif {0} {1}'.format(br_name, if_2)
exec_cmd_no_error(node, cmd, sudo=True)
exec_cmd_no_error(node, cmd, sudo=True)
cmd = 'brctl addif {0} {1}'.format(br_name, if_2)
exec_cmd_no_error(node, cmd, sudo=True)
@staticmethod
def setup_network_namespace(node, namespace_name, interface_name,
@staticmethod
def setup_network_namespace(node, namespace_name, interface_name,
"""Delete bridge from linux node.
:param node: Node to delete bridge from.
:param br_name: Bridge name.
"""Delete bridge from linux node.
:param node: Node to delete bridge from.
:param br_name: Bridge name.
cmd = 'brctl delbr {0}'.format(br_name)
exec_cmd_no_error(node, cmd, sudo=True)
cmd = 'brctl delbr {0}'.format(br_name)
exec_cmd_no_error(node, cmd, sudo=True)