From 628aa721cb121b775d74de5ca7739216c5d9a0e2 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Sat, 25 Jun 2022 14:00:38 +0200 Subject: [PATCH] bond: fix fail_over_mac follow mode There was a trailing whitespace on the Display implementation of the BondFailOverMac enum. Integration test case added. https://bugzilla.redhat.com/show_bug.cgi?id=2091775 Signed-off-by: Fernando Fernandez Mancera --- rust/src/lib/ifaces/bond.rs | 2 +- tests/integration/bond_test.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rust/src/lib/ifaces/bond.rs b/rust/src/lib/ifaces/bond.rs index 81f1405e0e..5bb53dd24d 100644 --- a/rust/src/lib/ifaces/bond.rs +++ b/rust/src/lib/ifaces/bond.rs @@ -438,7 +438,7 @@ impl std::fmt::Display for BondFailOverMac { match self { Self::None => "none", Self::Active => "active", - Self::Follow => "follow ", + Self::Follow => "follow", } ) } diff --git a/tests/integration/bond_test.py b/tests/integration/bond_test.py index bd5e885703..f459a798f3 100644 --- a/tests/integration/bond_test.py +++ b/tests/integration/bond_test.py @@ -579,6 +579,21 @@ def test_bond_mac_restriction_in_current_mac_in_desire(eth1_up, eth2_up): ) +@pytest.mark.tier1 +def test_bond_fail_over_mac_follow(eth1_up, eth2_up): + with bond_interface( + name=BOND99, + port=[ETH1, ETH2], + extra_iface_state={ + Bond.CONFIG_SUBTREE: { + Bond.MODE: BondMode.ACTIVE_BACKUP, + Bond.OPTIONS_SUBTREE: {"fail_over_mac": "follow"}, + }, + }, + ) as state: + assertlib.assert_state_match(state) + + @pytest.mark.tier1 def test_create_bond_with_mac(eth1_up, eth2_up): with bond_interface(