diff options
| author | Michael Biebl <biebl@debian.org> | 2018-07-01 21:00:06 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-07-01 21:00:06 +0200 |
| commit | e08bc09a596b7287ca393011644f6f2d8f15bb44 (patch) | |
| tree | 90ef816e2aec0254fe247d31c72244b4aa1f9244 | |
| parent | 4c3005cb25b601b4e2bcdf332ae524ed3dd843d2 (diff) | |
Rebase patches
6 files changed, 9 insertions, 269 deletions
diff --git a/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch index 9a7719d7..b2912d8d 100644 --- a/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch +++ b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch @@ -10,10 +10,10 @@ to be autostarted by a client request. 2 files changed, 6 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 7eef51d..201ef1c 100644 +index cdb5cfc..2c6db0f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -3884,11 +3884,6 @@ endif +@@ -3889,11 +3889,6 @@ endif data/NetworkManager-dispatcher.service: $(srcdir)/data/NetworkManager-dispatcher.service.in $(AM_V_GEN) $(data_edit) $< >$@ diff --git a/debian/patches/Force-online-state-with-unmanaged-devices.patch b/debian/patches/Force-online-state-with-unmanaged-devices.patch index 2e31693f..bfdb652d 100644 --- a/debian/patches/Force-online-state-with-unmanaged-devices.patch +++ b/debian/patches/Force-online-state-with-unmanaged-devices.patch @@ -12,7 +12,7 @@ Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 1 file changed, 115 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c -index c6d82c9..ced37b6 100644 +index 0fea13d..150d7de 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -62,6 +62,8 @@ @@ -35,7 +35,7 @@ index c6d82c9..ced37b6 100644 guint timestamp_update_id; guint devices_inited_id; -@@ -1385,6 +1391,27 @@ find_best_device_state (NMManager *manager) +@@ -1387,6 +1393,27 @@ find_best_device_state (NMManager *manager) return best_state; } @@ -63,7 +63,7 @@ index c6d82c9..ced37b6 100644 static void nm_manager_update_metered (NMManager *self) { -@@ -1423,6 +1450,9 @@ nm_manager_update_state (NMManager *self) +@@ -1425,6 +1452,9 @@ nm_manager_update_state (NMManager *self) else new_state = find_best_device_state (self); @@ -73,7 +73,7 @@ index c6d82c9..ced37b6 100644 if ( new_state >= NM_STATE_CONNECTED_LOCAL && priv->connectivity_state == NM_CONNECTIVITY_FULL) { new_state = NM_STATE_CONNECTED_GLOBAL; -@@ -5884,6 +5914,62 @@ impl_manager_check_connectivity (NMDBusObject *obj, +@@ -5886,6 +5916,62 @@ impl_manager_check_connectivity (NMDBusObject *obj, nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); } @@ -136,7 +136,7 @@ index c6d82c9..ced37b6 100644 static void start_factory (NMDeviceFactory *factory, gpointer user_data) { -@@ -6034,6 +6120,9 @@ nm_manager_start (NMManager *self, GError **error) +@@ -6036,6 +6122,9 @@ nm_manager_start (NMManager *self, GError **error) nm_clear_g_source (&priv->devices_inited_id); priv->devices_inited_id = g_idle_add_full (G_PRIORITY_LOW + 10, devices_inited_cb, self, NULL); @@ -146,7 +146,7 @@ index c6d82c9..ced37b6 100644 return TRUE; } -@@ -6897,6 +6986,22 @@ nm_manager_init (NMManager *self) +@@ -6899,6 +6988,22 @@ nm_manager_init (NMManager *self) KERNEL_FIRMWARE_DIR); } @@ -169,7 +169,7 @@ index c6d82c9..ced37b6 100644 /* Update timestamps in active connections */ priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, self); -@@ -7172,6 +7277,16 @@ dispose (GObject *object) +@@ -7174,6 +7279,16 @@ dispose (GObject *object) g_clear_object (&priv->fw_monitor); } diff --git a/debian/patches/series b/debian/patches/series index 9cb72fc3..0adf0cf1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,6 +2,3 @@ Force-online-state-with-unmanaged-devices.patch Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch Don-t-make-NetworkManager-D-Bus-activatable.patch Fix-iscsiadm-path.patch -tests-fix-race-in-setting-signal-strength-for-Wi-Fi-AP-in.patch -tests-improve-NetworkManager-stub-service-for-Wi-Fi-scann.patch -tests-don-t-exit-test-networkmanager-service.py-after-20-.patch diff --git a/debian/patches/tests-don-t-exit-test-networkmanager-service.py-after-20-.patch b/debian/patches/tests-don-t-exit-test-networkmanager-service.py-after-20-.patch deleted file mode 100644 index 7df8a630..00000000 --- a/debian/patches/tests-don-t-exit-test-networkmanager-service.py-after-20-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Thomas Haller <thaller@redhat.com> -Date: Mon, 18 Jun 2018 11:24:00 +0200 -Subject: tests: don't exit test-networkmanager-service.py after 20 seconds - -Tests might just take longer than 20 seconds. - -Also, we already watch stdin to determine whether the service -should exit. - -(cherry picked from commit 4e18ef49bf2527b4c29a0bdff2faddf0194dd5bd) -(cherry picked from commit 296da44235815ff32202f2afe9c990e94e4824ea) ---- - tools/test-networkmanager-service.py | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py -index f6da6e1..7fbed7e 100755 ---- a/tools/test-networkmanager-service.py -+++ b/tools/test-networkmanager-service.py -@@ -2252,14 +2252,9 @@ def main(): - id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP, - lambda io, condition: gl.mainloop.quit() or True) - -- # also quit after inactivity to ensure we don't stick around if the above fails somehow -- id2 = GLib.timeout_add_seconds(20, -- lambda: gl.mainloop.quit() or True) -- - gl.mainloop.run() - - GLib.source_remove(id1) -- GLib.source_remove(id2) - - gl.agent_manager.remove_from_connection() - gl.dns_manager.unexport() diff --git a/debian/patches/tests-fix-race-in-setting-signal-strength-for-Wi-Fi-AP-in.patch b/debian/patches/tests-fix-race-in-setting-signal-strength-for-Wi-Fi-AP-in.patch deleted file mode 100644 index ed61494e..00000000 --- a/debian/patches/tests-fix-race-in-setting-signal-strength-for-Wi-Fi-AP-in.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Thomas Haller <thaller@redhat.com> -Date: Mon, 18 Jun 2018 10:49:46 +0200 -Subject: tests: fix race in setting signal strength for Wi-Fi AP in NM stub - -This opens the tests up to races. If we want to change the strength, we -need to do it in a controlled, race-free manner. This is especially the -case, because clients/tests run a large number of nmcli instances in -parallel, and it's thus racy which signal the nmcli processes will -see. - -This also fixes a bug at - - self._dbus_property_set(IFACE_WIFI_AP, PRP_WIFI_AP_STRENGTH, strength) - -@strength must be a D-Bus type, so that python-dbus knows the correct -type for serialization. - -(cherry picked from commit 7e118c00916aa7dd3f04752debbcc09569d6effe) -(cherry picked from commit e05ce581b619a2fa3584b374aa7c3dad909c3a8a) ---- - tools/test-networkmanager-service.py | 26 ++------------------------ - 1 file changed, 2 insertions(+), 24 deletions(-) - -diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py -index ab63b60..c55955d 100755 ---- a/tools/test-networkmanager-service.py -+++ b/tools/test-networkmanager-service.py -@@ -864,8 +864,6 @@ class WifiAp(ExportedObj): - strength = Util.random_int(self.path, 100) - - self.ssid = ssid -- self.strength_counter = 0 -- self.strength_id = GLib.timeout_add_seconds(10, self.strength_cb, None) - - props = { - PRP_WIFI_AP_FLAGS: dbus.UInt32(flags), -@@ -881,17 +879,6 @@ class WifiAp(ExportedObj): - - self.dbus_interface_add(IFACE_WIFI_AP, props, WifiAp.PropertiesChanged) - -- def __del__(self): -- if self.strength_id > 0: -- GLib.source_remove(self.strength_id) -- self.strength_id = 0 -- -- def strength_cb(self, ignored): -- self.strength_counter += 1 -- strength = Util.random_int(self.path + str(self.strength_counter), 100) -- self._dbus_property_set(IFACE_WIFI_AP, PRP_WIFI_AP_STRENGTH, strength) -- return True -- - @dbus.service.signal(IFACE_WIFI_AP, signature='a{sv}') - def PropertiesChanged(self, changed): - pass -@@ -991,25 +978,16 @@ class WimaxNsp(ExportedObj): - - ExportedObj.__init__(self, ExportedObj.create_path(WimaxNsp)) - -- self.strength_id = GLib.timeout_add_seconds(10, self.strength_cb, None) -+ strength = Util.random_int(self.path, 100) - - props = { - PRP_WIMAX_NSP_NAME: name, -- PRP_WIMAX_NSP_SIGNAL_QUALITY: dbus.UInt32(random.randint(0, 100)), -+ PRP_WIMAX_NSP_SIGNAL_QUALITY: dbus.UInt32(strength), - PRP_WIMAX_NSP_NETWORK_TYPE: dbus.UInt32(NM.WimaxNspNetworkType.HOME), - } - - self.dbus_interface_add(IFACE_WIMAX_NSP, props, WimaxNsp.PropertiesChanged) - -- def __del__(self): -- if self.strength_id > 0: -- GLib.source_remove(self.strength_id) -- self.strength_id = 0 -- -- def strength_cb(self, ignored): -- self._dbus_property_set(IFACE_WIMAX_NSP, PRP_WIMAX_NSP_SIGNAL_QUALITY, dbus.UInt32(random.randint(0, 100))) -- return True -- - @dbus.service.signal(IFACE_WIMAX_NSP, signature='a{sv}') - def PropertiesChanged(self, changed): - pass diff --git a/debian/patches/tests-improve-NetworkManager-stub-service-for-Wi-Fi-scann.patch b/debian/patches/tests-improve-NetworkManager-stub-service-for-Wi-Fi-scann.patch deleted file mode 100644 index 09f3cdf7..00000000 --- a/debian/patches/tests-improve-NetworkManager-stub-service-for-Wi-Fi-scann.patch +++ /dev/null @@ -1,141 +0,0 @@ -From: Thomas Haller <thaller@redhat.com> -Date: Sat, 16 Jun 2018 13:38:45 +0200 -Subject: tests: improve NetworkManager stub service for Wi-Fi scanning - -Now that nmcli initiates a scan before displaying Wi-Fi networks, -the stub service must properly support that as well. - -For the moment, the stub service chooses "now" as LastScan timestamp. -This causes nmcli not to trigger a new scan, because nmcli gives -unstable output if multiple nmcli processes in parallel race to -trigger a Wi-Fi scan. That should be fixed. - -(cherry picked from commit 56a0488bbae38f8d802b1cc32ba94c1640f70bc6) -(cherry picked from commit efddb0cef5187f4f77d0c6b94f75063ad8f9d6a2) ---- - clients/cli/devices.c | 11 ++++++++++ - tools/test-networkmanager-service.py | 40 ++++++++++++++++++++++++++++++------ - 2 files changed, 45 insertions(+), 6 deletions(-) - -diff --git a/clients/cli/devices.c b/clients/cli/devices.c -index 58102ed..aa28678 100644 ---- a/clients/cli/devices.c -+++ b/clients/cli/devices.c -@@ -2772,6 +2772,17 @@ wifi_list_aps (NMDeviceWifi *wifi, - - needs_rescan = rescan_cutoff < 0 || (rescan_cutoff > 0 && nm_device_wifi_get_last_scan (wifi) < rescan_cutoff); - -+ /* FIXME: nmcli should either -+ * - don't request any new scan for any device and print the full AP list right -+ * away. -+ * - or, when requesting a scan on one or more devices, don't print the result -+ * before all requests complete. -+ * -+ * Otherwise: -+ * - the printed output is not self consistent. E.g. it will print the result -+ * on one device at a certain time, while printing the result for another -+ * device at a later point in time. -+ * - the order in which we print the AP list per-device, is unstable. */ - if (needs_rescan) { - data = g_slice_new0 (WifiListData); - data->nmc = nmc; -diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py -index c55955d..f6da6e1 100755 ---- a/tools/test-networkmanager-service.py -+++ b/tools/test-networkmanager-service.py -@@ -49,6 +49,11 @@ class Util: - - PY3 = (sys.version_info[0] == 3) - -+ @staticmethod -+ def g_source_remove(source_id): -+ if source_id is not None: -+ GLib.source_remove(source_id) -+ - @staticmethod - def addr_family_check(family, allow_af_unspec = False): - if family == socket.AF_INET: -@@ -840,6 +845,7 @@ PRP_WIFI_AP_HW_ADDRESS = "HwAddress" - PRP_WIFI_AP_MODE = "Mode" - PRP_WIFI_AP_MAX_BITRATE = "MaxBitrate" - PRP_WIFI_AP_STRENGTH = "Strength" -+PRP_WIFI_AP_LAST_SEEN = "LastSeen" - - class WifiAp(ExportedObj): - -@@ -875,6 +881,7 @@ class WifiAp(ExportedObj): - PRP_WIFI_AP_MODE: dbus.UInt32(getattr(NM,'80211Mode').INFRA), - PRP_WIFI_AP_MAX_BITRATE: dbus.UInt32(54000), - PRP_WIFI_AP_STRENGTH: dbus.Byte(strength), -+ PRP_WIFI_AP_LAST_SEEN: dbus.Int32(NM.utils_get_timestamp_msec() / 1000), - } - - self.dbus_interface_add(IFACE_WIFI_AP, props, WifiAp.PropertiesChanged) -@@ -902,6 +909,18 @@ class WifiDevice(Device): - mac = Util.random_mac(self.ident) - - self.aps = [] -+ self.scan_cb_id = None -+ -+ # Note: we would like to simulate how nmcli calls RequestScan() and we could -+ # do so by using an older timestamp. However, that makes the client tests -+ # racy, because if a bunch of nmcli instances run in parallel against this -+ # service, earlier instances will issue a RequestScan(), while later instances -+ # won't do that (because the LastScan timestamp is already updated). That means, -+ # the later instances will print the scan result immediately, and in another sort -+ # order. That should be fixed, by nmcli not starting to print anything, before -+ # all RequestScan() requests complete, and thus, always print a consistent list -+ # of results. -+ ts = NM.utils_get_timestamp_msec() - - props = { - PRP_WIFI_HW_ADDRESS: mac, -@@ -911,7 +930,7 @@ class WifiDevice(Device): - PRP_WIFI_WIRELESS_CAPABILITIES: dbus.UInt32(0xFF), - PRP_WIFI_ACCESS_POINTS: ExportedObj.to_path_array(self.aps), - PRP_WIFI_ACTIVE_ACCESS_POINT: ExportedObj.to_path(None), -- PRP_WIFI_LAST_SCAN: NM.utils_get_timestamp_msec(), -+ PRP_WIFI_LAST_SCAN: dbus.Int64(ts), - } - - self.dbus_interface_add(IFACE_WIFI, props, WifiDevice.PropertiesChanged) -@@ -928,6 +947,15 @@ class WifiDevice(Device): - - @dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='a{sv}', out_signature='') - def RequestScan(self, props): -+ self.scan_cb_id = Util.g_source_remove(self.scan_cb_id) -+ def cb(): -+ ts = NM.utils_get_timestamp_msec() -+ for ap in self.aps: -+ ap._dbus_property_set(IFACE_WIFI_AP, PRP_WIFI_AP_LAST_SEEN, dbus.Int32(ts / 1000)) -+ self._dbus_property_set(IFACE_WIFI, PRP_WIFI_LAST_SCAN, dbus.Int64(ts)) -+ self.scan_cb_id = None -+ return False -+ self.scan_cb_id = GLib.idle_add(cb) - pass - - @dbus.service.signal(IFACE_WIFI, signature='o') -@@ -947,6 +975,10 @@ class WifiDevice(Device): - self.AccessPointRemoved(ExportedObj.to_path(ap)) - ap.unexport() - -+ def stop(self): -+ self.scan_cb_id = Util.g_source_remove(self.scan_cb_id) -+ super(WifiDevice, self).stop() -+ - @dbus.service.signal(IFACE_WIFI, signature='o') - def AccessPointRemoved(self, ap_path): - pass -@@ -1138,11 +1170,7 @@ class ActiveConnection(ExportedObj): - self.StateChanged(state, dbus.UInt32(reason)) - - def activation_cancel(self): -- if self._activation_id is None: -- return False -- GLib.source_remove(self._activation_id) -- self._activation_id = None -- return True -+ self._activation_id = Util.g_source_remove(self._activation_id) - - def _activation_step2(self): - assert self._activation_id is not None |