def init_unprivileged_network_components(cif, net_api): if nmstate.is_nmstate_backend(): dhcp_monitor.initialize_monitor(cif, net_api) else: _init_sourceroute(net_api) _register_notifications(cif) dhclient_monitor.start() bond_monitor.initialize_monitor(cif)
def test_bond_monitor(self, nics): notifier = FakeNotifier() with bond_device(slaves=nics) as bond: bond.set_options({'mode': '1'}) bond.up() bond.set_options({'active_slave': nics[0]}) bond_monitor.initialize_monitor(notifier) try: bond.set_options({'active_slave': nics[1]}) _wait_until(lambda: notifier.calls) finally: bond_monitor.stop() assert notifier.calls == [('|net|host_conn|no_id', None)]
def test_bond_monitor(self): notifier = FakeNotifier() with dummy_devices(2) as (nic1, nic2): with bond_device(slaves=(nic1, nic2)) as bond: bond.set_options({'mode': '1'}) bond.up() bond.set_options({'active_slave': nic1}) bond_monitor.initialize_monitor(notifier) try: bond.set_options({'active_slave': nic2}) _wait_until(lambda: notifier.calls) finally: bond_monitor.stop() self.assertEqual(notifier.calls, [('|net|host_conn|no_id', None)])
def init_unprivileged_network_components(cif, net_api): dhcp_monitor.initialize_monitor(cif, net_api) bond_monitor.initialize_monitor(cif)