Exemplo n.º 1
0
    def test_remove_bond_attached_to_network_that_will_use_nic(self):
        fake_kernel_nics = ['eth0', 'eth1']
        nets = {'net1': {'nic': 'eth0'}}
        running_nets = {'net1': {'southbound': 'bond1'}}

        validator.validate_bond_configuration('bond1', {'remove': True}, nets,
                                              running_nets, fake_kernel_nics)
Exemplo n.º 2
0
    def test_remove_bond_attached_to_a_network(self):
        fake_kernel_nics = ['eth0', 'eth1']
        nets = {}
        running_nets = {}

        validator.validate_bond_configuration('bond1', {'remove': True}, nets,
                                              running_nets, fake_kernel_nics)
Exemplo n.º 3
0
 def test_add_bond_with_no_slaves(self):
     fake_kernel_nics = []
     nets = {}
     running_nets = {}
     with pytest.raises(ne.ConfigNetworkError):
         validator.validate_bond_configuration('bond1', {'switch': 'ovs'},
                                               nets, running_nets,
                                               fake_kernel_nics)
Exemplo n.º 4
0
 def test_add_bond_with_no_slaves(self):
     fake_kernel_nics = []
     nets = {}
     running_nets = {}
     with self.assertRaises(ne.ConfigNetworkError):
         validator.validate_bond_configuration(
             'bond1', {'switch': 'ovs'}, nets, running_nets,
             fake_kernel_nics)
Exemplo n.º 5
0
    def test_remove_bond_attached_to_network_that_will_use_nic(self):
        fake_kernel_nics = ['eth0', 'eth1']
        nets = {'net1': {'nic': 'eth0'}}
        running_nets = {'net1': {'southbound': 'bond1'}}

        validator.validate_bond_configuration(
            'bond1', {'remove': True}, nets, running_nets,
            fake_kernel_nics)
Exemplo n.º 6
0
    def test_remove_bond_attached_to_a_network(self):
        fake_kernel_nics = ['eth0', 'eth1']
        nets = {}
        running_nets = {}

        validator.validate_bond_configuration(
            'bond1', {'remove': True}, nets, running_nets,
            fake_kernel_nics)
Exemplo n.º 7
0
 def test_add_bond_with_dpdk(self):
     fake_kernel_nics = []
     nets = {}
     running_nets = {}
     with self.assertRaises(ne.ConfigNetworkError):
         validator.validate_bond_configuration(
             'bond1', {'nics': ['eth0', 'dpdk0'], 'switch': 'ovs'},
             nets, running_nets, fake_kernel_nics)
Exemplo n.º 8
0
    def test_add_bond_with_two_slaves(self):
        fake_kernel_nics = ['eth0', 'eth1']
        nets = {}
        running_nets = {}

        validator.validate_bond_configuration(
            'bond1', {'nics': ['eth0', 'eth1'], 'switch': 'ovs'}, nets,
            running_nets, fake_kernel_nics)
Exemplo n.º 9
0
 def test_remove_bond_reattached_to_another_network(self):
     fake_kernel_nics = ['eth0', 'eth1', 'eth2']
     nets = {'net1': {'nic': 'eth0'}, 'net2': {'bonding': 'bond1'}}
     running_nets = {'net1': {'southbound': 'bond1'}}
     with pytest.raises(ne.ConfigNetworkError) as e:
         validator.validate_bond_configuration('bond1', {'remove': True},
                                               nets, running_nets,
                                               fake_kernel_nics)
     assert e.value.errCode == ne.ERR_USED_BOND
Exemplo n.º 10
0
 def test_remove_bond_reattached_to_another_network(self):
     fake_kernel_nics = ['eth0', 'eth1', 'eth2']
     nets = {'net1': {'nic': 'eth0'}, 'net2': {'bonding': 'bond1'}}
     running_nets = {'net1': {'southbound': 'bond1'}}
     with self.assertRaises(ne.ConfigNetworkError) as e:
         validator.validate_bond_configuration('bond1', {'remove': True},
                                               nets, running_nets,
                                               fake_kernel_nics)
     self.assertEqual(e.exception.args[0], ne.ERR_USED_BOND)
Exemplo n.º 11
0
 def test_remove_bond_reattached_to_another_network(self):
     fake_kernel_nics = ['eth0', 'eth1', 'eth2']
     nets = {'net1': {'nic': 'eth0'}, 'net2': {'bonding': 'bond1'}}
     running_nets = {'net1': {'southbound': 'bond1'}}
     with self.assertRaises(ne.ConfigNetworkError) as e:
         validator.validate_bond_configuration(
             'bond1', {'remove': True}, nets, running_nets,
             fake_kernel_nics)
     self.assertEqual(e.exception.args[0], ne.ERR_USED_BOND)