def test_plug_create_vlan(self, mock_create_vif, mock_ensure_vlan_bridge): instance = {'name': "fake_instance_name"} network = model.Network() network._set_meta({'should_create_vlan': True}) vif = model.VIF() vif._set_meta({'rxtx_cap': 1}) vif['network'] = network vif['address'] = "fake_address" vm_ref = "fake_vm_ref" device = 1 ret_vif_ref = self.bridge_driver.plug(instance, vif, vm_ref, device) self.assertEqual('fake_vif_ref', ret_vif_ref)
def test_plug_create_vlan(self, mock_create_vif, mock_ensure_vlan_bridge): instance = {"name": "fake_instance_name"} network = model.Network() network._set_meta({"should_create_vlan": True}) vif = model.VIF() vif._set_meta({"rxtx_cap": 1}) vif["network"] = network vif["address"] = "fake_address" vm_ref = "fake_vm_ref" device = 1 ret_vif_ref = self.bridge_driver.plug(instance, vif, vm_ref, device) self.assertEqual("fake_vif_ref", ret_vif_ref)