-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
networkmanager: fix primary bond option #21533
Conversation
Hello @champtar, thanks for fixing this! This needs to be covered by an integration test to reproduce/demonstrate the original bug and validate the fix. If you would like to give this a try, please have a look at https://github.com/cockpit-project/cockpit/blob/main/test/README.md Otherwise someone from our team (@mvollmer or me) can help with that. However, we have a meeting week, so nothing will happen until the week afterwards. We are not ignoring you 😉 |
Hello @martinpitt, not sure I will have time to look at the tests this week either :( |
I wanted to learn a bit more about integration tests so tried creating a test for this. ~~~Couldn't get it passing locally though for some reason as it errors with the selection~~~ The patch works, tested it with a VM 🎉 It should create a new bond with bond0 name, one interface added that is made primary, then the bond edited to make sure it is selected as primary git patchdiff --git a/test/verify/check-networkmanager-bond b/test/verify/check-networkmanager-bond
index 8ec09b950..1fdaa9fdc 100755
--- a/test/verify/check-networkmanager-bond
+++ b/test/verify/check-networkmanager-bond
@@ -223,6 +223,38 @@ class TestBonding(netlib.NetworkCase):
b.wait_visible(f"#network-interface-members tr[data-interface='{iface}']")
b.wait_in_text("#network-interface .pf-v5-c-card:contains('tbond')", ip)
+ def testPrimary(self):
+ b = self.browser
+
+ self.login_and_go("/network")
+
+ b.wait_visible("#networking")
+ iface = "cockpit"
+ self.add_veth(iface, dhcp_cidr="10.111.112.2/20")
+ self.nm_activate_eth(iface)
+ self.wait_for_iface(iface)
+
+ # Create a bond
+ b.click("button:contains('Add bond')")
+ b.wait_visible("#network-bond-settings-dialog")
+ b.set_input_text("#network-bond-settings-interface-name-input", "tbond")
+ # add interface to bond
+ b.set_checked(f"input[data-iface='{iface}']", val=True)
+ # select it as primary
+ b.select_from_dropdown("#network-bond-settings-primary-select", iface)
+ # finish creating the bond
+ b.click("#network-bond-settings-dialog button:contains('Add')")
+ b.wait_not_present("#network-bond-settings-dialog")
+
+ # Navigate to bond and edit it
+ b.click("#networking-interfaces tr[data-interface='tbond'] button")
+ b.wait_visible("#network-interface")
+ b.click("#network-interface #networking-edit-bond")
+
+ # edit bond dialog
+ b.wait_visible("#network-bond-settings-dialog")
+ b.wait_val("#network-bond-settings-primary-select", iface)
+
def testAmbiguousMember(self):
b = self.browser
m = self.machine |
Thanks! From the description of the pull request, I think there are a few more cases that could be tested: removing the primary, and automatic removal when switching to a mode that doesn't have the concept of a primary interface. But we can install the test as it is and run our CI, and see whether our coverage report discovers the missing cases as well. :-) @champtar, do you want to add @Venefilyn's patch, or do you want one of the Cockpit maintainers to take over? |
I can think of:
Please take over, maintainers should be able to push in this PR directly |
Do I need to rebase or do anything here ? The failures seem unrelated |
- allow setting also for balance-tlb / balance-alb modes - read the current value - remove when not set (it can't be set to an empty string) - remove when switching to a non compatible mode
5a3107e
to
a6366cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. tests looking good!
(Except the failures of course, I'll figure them out.) |
The ubuntu failures are probably due to this journal entry:
The message comes from "netplan apply":
NetworkManager seems to ignore the failure, and somehow the "tbond" interface is created anyway, but the "bond.options" setting of its connection doesn't include the "primary" attribute:
I have no idea what the relationship between netpan and NetworkManager is. I am guessing that NetworkManager is writing the yaml files in /etc/netplan/. The problem seems to be that the definition of the "cockpit" interface uses a generated name:
If I change this to
then the error disappears and the correct primary is displayed in Cockpit. I'll file this upstream and get it tracked for us with a "naughty". |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1717 |
Blocked by cockpit-project/bots#7433 |
da6cd38
to
3f18aee
Compare
Green enough, thanks everyone! |
Is there any change this bugfix will go in EL 9.5 or 9.6 ? |
This fixes #21528
Patch tested on top of version 323 (~EL 9.5)