'Makes sure vlan_interface flag overrides network bridge_interface.
Allows heterogeneous networks a la bug 833426'

@mock.patch.object(linux_net.LinuxBridgeInterfaceDriver, 'ensure_vlan_bridge')
def test_vlan_override(self, mock_ensure_vlan_bridge):

    driver = linux_net.LinuxBridgeInterfaceDriver()
    info = {}
    def test_ensure(vlan, bridge, interface, network, mac_address, mtu):
        info['passed_interface'] = interface
    mock_ensure_vlan_bridge.side_effect = test_ensure
    network = {'bridge': 'br100', 'bridge_interface': 'base_interface', 'share_address': False, 'vlan': 'fake'}
    self.flags(vlan_interface='')
    driver.plug(network, 'fakemac')
    self.assertEqual('base_interface', info['passed_interface'])
    self.flags(vlan_interface='override_interface')
    driver.plug(network, 'fakemac')
    self.assertEqual('override_interface', info['passed_interface'])
    driver.plug(network, 'fakemac')
    self.assertEqual(3, mock_ensure_vlan_bridge.call_count)
