@@ -156,6 +156,49 @@ class TestNetworkingBasic(netlib.NetworkCase):
156156
157157 testlib .wait (lambda : "yes" in m .execute (f"nmcli -f ipv4.ignore-auto-dns connection show '{ con_id } '" ))
158158
159+ b .go ("/network" )
160+ # Create a bridge interface and disable it to test if disabled connections can be modified.
161+ # Connection exists, is down and the device itself does not exist as long as the connection is down
162+ m .execute ("nmcli con add con-name cockpitbr type bridge ifname cockpitbr ipv4.meth disab ipv6.meth disab" )
163+ self .addCleanup (m .execute , "nmcli con del cockpitbr" )
164+ self .wait_for_iface ("cockpitbr" , prefix = "No carrier" )
165+ m .execute ("nmcli con down cockpitbr" )
166+ self .wait_for_iface ("cockpitbr" , active = False )
167+ # check that connection exists but interface does not
168+ m .execute ("nmcli con sh | grep -q 'cockpitbr'" )
169+ m .execute ("ip link sh | grep -q --invert-match 'cockpitbr'" )
170+
171+ self .select_iface ("cockpitbr" )
172+ b .wait_visible ("#network-interface" )
173+ self .wait_for_iface_setting ("Status" , "Inactive" )
174+
175+ # Configure IPv4 address
176+ self .configure_iface_setting ("IPv4" )
177+ b .wait_visible ("#network-ip-settings-dialog" )
178+ b .select_from_dropdown ("#network-ip-settings-select-method" , "manual" )
179+ b .wait_visible ("#network-ip-settings-address-0" )
180+ b .set_input_text ("#network-ip-settings-address-0" , "10.0.5.10" )
181+ b .set_input_text ("#network-ip-settings-netmask-0" , "24" )
182+ b .set_input_text ("#network-ip-settings-gateway-0" , "10.0.5.1" )
183+ b .click ("#network-ip-settings-save" )
184+ self .wait_for_iface_setting ("IPv4" , "Address 10.0.5.10/24 via 10.0.5.1" )
185+ # Configure IPv6 address
186+ self .configure_iface_setting ("IPv6" )
187+ b .wait_visible ("#network-ip-settings-dialog" )
188+ b .select_from_dropdown ("#network-ip-settings-select-method" , "manual" )
189+ b .wait_visible ("#network-ip-settings-address-0" )
190+ b .set_input_text ("#network-ip-settings-address-0" , "2001:db8::10" )
191+ b .set_input_text ("#network-ip-settings-netmask-0" , "64" )
192+ b .set_input_text ("#network-ip-settings-gateway-0" , "2001:db8::1" )
193+ b .click ("#network-ip-settings-save" )
194+ self .wait_for_iface_setting ("IPv6" , "Address 2001:db8::10/64 via 2001:db8::1" )
195+
196+ # Start the interface and verify new address is set
197+ b .click ("#interface-switch" )
198+ self .wait_for_iface_setting ("Status" , "10.0.5.10/24," )
199+ m .execute ("ip addr sh cockpitbr | grep -q 'inet 10.0.5.10/24'" )
200+ m .execute ("ip addr sh cockpitbr | grep -q 'inet6 2001:db8::10/64'" )
201+
159202 def testIpHelper (self ):
160203 b = self .browser
161204 m = self .machine
0 commit comments