tests, integ: rename bond99_with_slave to bond99_with_eth2
The fixture is not very reader-friendly that using bond99_with_slave means that eth2 is the slave. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
This commit is contained in:
parent
2225ad7148
commit
fd8cbd440d
@ -101,7 +101,7 @@ def bond88_with_slave(eth1_up):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bond99_with_slave(eth2_up):
|
||||
def bond99_with_eth2(eth2_up):
|
||||
slaves = [eth2_up[Interface.KEY][0][Interface.NAME]]
|
||||
with bond_interface(BOND99, slaves) as state:
|
||||
yield state
|
||||
@ -302,9 +302,9 @@ def test_remove_one_of_the_bond_slaves(eth1_up, eth2_up):
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_swap_slaves_between_bonds(bond88_with_slave, bond99_with_slave):
|
||||
def test_swap_slaves_between_bonds(bond88_with_slave, bond99_with_eth2):
|
||||
bonding88 = bond88_with_slave[Interface.KEY][0][Bond.CONFIG_SUBTREE]
|
||||
bonding99 = bond99_with_slave[Interface.KEY][0][Bond.CONFIG_SUBTREE]
|
||||
bonding99 = bond99_with_eth2[Interface.KEY][0][Bond.CONFIG_SUBTREE]
|
||||
|
||||
bonding88[Bond.SLAVES], bonding99[Bond.SLAVES] = (
|
||||
bonding99[Bond.SLAVES],
|
||||
@ -312,7 +312,7 @@ def test_swap_slaves_between_bonds(bond88_with_slave, bond99_with_slave):
|
||||
)
|
||||
|
||||
state = bond88_with_slave
|
||||
state.update(bond99_with_slave)
|
||||
state.update(bond99_with_eth2)
|
||||
libnmstate.apply(state)
|
||||
|
||||
assertlib.assert_state(state)
|
||||
@ -371,8 +371,8 @@ def test_bond_with_empty_ipv6_static_address(eth1_up):
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_create_vlan_over_a_bond_slave(bond99_with_slave):
|
||||
bond_ifstate = bond99_with_slave[Interface.KEY][0]
|
||||
def test_create_vlan_over_a_bond_slave(bond99_with_eth2):
|
||||
bond_ifstate = bond99_with_eth2[Interface.KEY][0]
|
||||
bond_slave_ifname = bond_ifstate[Bond.CONFIG_SUBTREE][Bond.SLAVES][0]
|
||||
vlan_id = 102
|
||||
vlan_iface_name = "{}.{}".format(bond_slave_ifname, vlan_id)
|
||||
@ -380,11 +380,11 @@ def test_create_vlan_over_a_bond_slave(bond99_with_slave):
|
||||
vlan_iface_name, vlan_id, bond_slave_ifname
|
||||
) as desired_state:
|
||||
assertlib.assert_state(desired_state)
|
||||
assertlib.assert_state(bond99_with_slave)
|
||||
assertlib.assert_state(bond99_with_eth2)
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_create_linux_bridge_over_bond(bond99_with_slave):
|
||||
def test_create_linux_bridge_over_bond(bond99_with_eth2):
|
||||
port_state = {
|
||||
"stp-hairpin-mode": False,
|
||||
"stp-path-cost": 100,
|
||||
@ -399,24 +399,24 @@ def test_create_linux_bridge_over_bond(bond99_with_slave):
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_preserve_bond_after_bridge_removal(bond99_with_slave):
|
||||
def test_preserve_bond_after_bridge_removal(bond99_with_eth2):
|
||||
bridge_name = "linux-br0"
|
||||
bridge_state = add_port_to_bridge(create_bridge_subtree_state(), BOND99)
|
||||
with linux_bridge(bridge_name, bridge_state) as desired_state:
|
||||
assertlib.assert_state_match(desired_state)
|
||||
assertlib.assert_state(bond99_with_slave)
|
||||
assertlib.assert_state(bond99_with_eth2)
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_create_vlan_over_a_bond(bond99_with_slave):
|
||||
vlan_base_iface = bond99_with_slave[Interface.KEY][0][Interface.NAME]
|
||||
def test_create_vlan_over_a_bond(bond99_with_eth2):
|
||||
vlan_base_iface = bond99_with_eth2[Interface.KEY][0][Interface.NAME]
|
||||
vlan_id = 102
|
||||
vlan_iface_name = "{}.{}".format(vlan_base_iface, vlan_id)
|
||||
with vlan_interface(
|
||||
vlan_iface_name, vlan_id, vlan_base_iface
|
||||
) as desired_state:
|
||||
assertlib.assert_state(desired_state)
|
||||
assertlib.assert_state(bond99_with_slave)
|
||||
assertlib.assert_state(bond99_with_eth2)
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
@ -430,7 +430,7 @@ def test_change_bond_option_miimon(bond99_with_2_slaves):
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
def test_change_bond_option_with_an_id_value(bond99_with_slave):
|
||||
def test_change_bond_option_with_an_id_value(bond99_with_eth2):
|
||||
option_name = "xmit_hash_policy"
|
||||
desired_state = statelib.show_only((BOND99,))
|
||||
iface_state = desired_state[Interface.KEY][0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user