def test_add_network_with_running_bond(self): fake_running_bonds = {'bond1': {}} fake_to_be_added_bonds = {} fake_kernel_nics = [] with self.assertNotRaises(): ovs_validator.validate_net_configuration( 'net1', {'bonding': 'bond1', 'switch': 'ovs'}, fake_to_be_added_bonds, fake_running_bonds, fake_kernel_nics)
def test_adding_a_second_untagged_net(self): fake_running_bonds = {} fake_to_be_added_bonds = {} fake_kernel_nics = ['eth0', 'eth1'] with self.assertNotRaises(): ovs_validator.validate_net_configuration( 'net2', {'nic': 'eth1', 'switch': 'ovs'}, fake_to_be_added_bonds, fake_running_bonds, fake_kernel_nics)
def test_add_network_with_non_existing_bond(self): fake_running_bonds = {} fake_to_be_added_bonds = {} fake_kernel_nics = [] with self.assertRaises(ne.ConfigNetworkError) as e: ovs_validator.validate_net_configuration( 'net1', {'bonding': 'bond1', 'switch': 'ovs'}, fake_to_be_added_bonds, fake_running_bonds, fake_kernel_nics) self.assertEquals(e.exception[0], ne.ERR_BAD_BONDING)