Commit Graph

109 Commits

Author SHA1 Message Date
Jan Vaclav
f2d91b4a68 wired: deprecate NMSettingWired mac-address-blacklist property
To embrace inclusive language, deprecate the NMSettingWired
mac-address-blacklist property and introduce mac-address-denylist property.
2024-03-20 15:32:00 +01:00
Jan Vaclav
5672757ac4 test/networkmanager-service: simulate behavior of aliased/deprecated properties
Previously, the mock server did not behave as expected when given an aliased property
and the test results were not matching that of actual NM daemon behavior.
2024-03-11 11:42:19 +01:00
Jan Vaclav
47f01c805d python: reformat with black-24.1.1-1.fc39.noarch 2024-03-01 07:51:21 +00:00
Thomas Haller
28a1afca63 python: reformat with black-23.7.0-2.fc39.noarch
The base image for the "check-tree" test got bumped to Fedora 39.  This
brings a new python-black version (23.7.0 vs. 22.8.0) and requires
reformatting.

Maybe we should stick to 22.8.0, via `pip install`. But it seems better
to just follow the latest black version (the one from current Fedora).

So do the reformatting instead.

https://black.readthedocs.io/en/stable/change_log.html#id38
2023-12-06 11:56:11 +01:00
Íñigo Huguet
fb851f3294 nmcli: warn if daemon version mismatch
When updating NetworkManager to a new version, normally the service is
not restarted by the installer to avoid interrupting networking.
However, next nmcli invocation will use the updated version, but against
the older version of the daemon that is still running. Although this is
suposed to work, it is advisable that nmcli and daemon's versions are
the same. Emit a warning recommending restarting the daemon.

Add nmcli test to check the new feature. To avoid breaking the existing
tests, test-networkmanager-service now reports the same version than the
running nmcli except if it's instructed to report a different one.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1703
2023-08-03 10:09:06 +02:00
Fernando Fernandez Mancera
2115032869 nmcli: show bandwidth on wifi device output
Example output:

```
NAME:                                   AP[3]
SSID:                                   testX
SSID-HEX:                               4D4F5649535441525F504C55535F32453037
BSSID:                                  80:78:71:90:2E:15
MODE:                                   Infra
CHAN:                                   104
FREQ:                                   5520 MHz
RATE:                                   540 Mbit/s
BANDWIDTH:                              40 MHz
SIGNAL:                                 32
BARS:                                   ▂▄__
SECURITY:                               WPA2
WPA-FLAGS:                              (none)
RSN-FLAGS:                              pair_ccmp group_ccmp psk
DEVICE:                                 wlp0s20f3
ACTIVE:                                 yes
IN-USE:                                 *
DBUS-PATH:                              /org/freedesktop/NetworkManager/AccessPoint/3
```
2023-08-02 00:54:32 +02:00
Frederic Martinsons
ae408fe4ab tools/tests: correct variant parsing
Seen in NM 1.42.6 where there is now a ipv4.dns-data key which
have as signature:
dbus.Array([dbus.String('a.b.c.d')], signature=dbus.Signature('s'), variant_level=1)

This lead to the following exception:
Cannot convert array element to type 's': Must be string, not Variant

Moreover, the exception TypeError has no message field so it raised
another expcetion which gave me trouble to find what's going on.

Hence the addition of a log file from the previous commit

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-06-07 05:48:09 +00:00
Frederic Martinsons
2f7a571759 tools/tests: add ability to log to a file
That has been proven useful for debugging the tool during tests

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-06-07 05:48:09 +00:00
Lubomir Rintel
fa191c929b test/nm-service: short circuit activation if AC activation delay is zero
This makes it possible for use to create a connection in immediately
rely on it being activated.
2023-03-21 21:56:17 +01:00
Lubomir Rintel
472e49e7b3 test/nm-service: make activation delay actually useful
The activation_state_change_delay_ms was not too useful, since it could
be changed only after the AC started activating. Not a big deal, since
it was actually unused.

Apart from that, the SetActiveConnectionStateChangedDelay() didn't make
a whole lot of sense either: it accepted a Device path, but actually
was looking up an AC.

Let's move the property to the Device, so that 1.) it can be adjusted
before the AC is constructed (the AC will inherit it from the Device)
and 2.) SetActiveConnectionStateChangedDelay() does no longer hurt my
feelings.
2023-03-21 21:56:17 +01:00
Lubomir Rintel
5ae3dc03a5 test/nm-service: implement applied connection handling
GetAppliedConnection() and Reapply(), both just enough to support
nm-cloud-setup.
2023-03-21 21:56:17 +01:00
Lubomir Rintel
f8188d51b2 test/nm-service: deconstruct string properties in connections too
I don't know what's going on:

  ======================================================================
  ERROR: test_ec2 (__main__.TestNmCloudSetup.test_ec2)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "NetworkManager/src/tests/client/test-client.py", line 2169, in f
      func(self)
    File "NetworkManager/src/tests/client/test-client.py", line 2194, in test_ec2
      conn = self.srv.op_AddAndActivateConnection(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/src/tests/client/test-client.py", line 748, in __call__
      return method(*args)
             ^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/site-packages/dbus/proxies.py", line 72, in __call__
      return self._proxy_method(*args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/site-packages/dbus/proxies.py", line 141, in __call__
      return self._connection.call_blocking(self._named_service,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/site-packages/dbus/connection.py", line 634, in call_blocking
      reply_message = self.send_message_with_reply_and_block(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  dbus.exceptions.DBusException: org.freedesktop.DBus.Python.Exception: Traceback (most recent call last):
    File "/usr/lib64/python3.11/site-packages/dbus/service.py", line 712, in _message_cb
      retval = candidate_method(self, *args, **keywords)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 1693, in AddAndActivateConnection
      conpath, acpath, result = self.AddAndActivateConnection2(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 1707, in AddAndActivateConnection2
      conpath = gl.settings.AddConnection(con_hash)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 2198, in AddConnection
      return self.add_connection(con_hash)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 2208, in add_connection
      con_inst = Connection(self.c_counter, con_hash, do_verify_strict)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 2045, in __init__
      NmUtil.con_hash_verify(con_hash, do_verify_strict=do_verify_strict)
    File "NetworkManager/tools/test-networkmanager-service.py", line 594, in con_hash_verify
      BusErr.raise_nmerror(e)
    File "NetworkManager/tools/test-networkmanager-service.py", line 497, in raise_nmerror
      raise e
    File "NetworkManager/tools/test-networkmanager-service.py", line 590, in con_hash_verify
      con_nm = NmUtil.con_hash_to_connection(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 537, in con_hash_to_connection
      assert GLib.Variant.equal(x_con, Util.variant_from_dbus(con_hash))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "NetworkManager/tools/test-networkmanager-service.py", line 378, in variant_from_dbus
      raise Exception("Unsupported type for value '%s'" % (repr(val)))
  Exception:
  Unsupported type for value 'dbus.Dictionary({
    dbus.String('connection'): dbus.Dictionary({
      dbus.String('type'): dbus.String('802-3-ethernet'),
      dbus.String('id'): dbus.String('con-eth0'),
      'uuid': '5fcfd6d7-1e63-3332-8826-a7eda103792d'
    }, signature=dbus.Signature('ss')),
    dbus.String('ipv4'): dbus.Dictionary({
      dbus.String('method'): dbus.String('auto')
    }, signature=dbus.Signature('ss'))
  }, signature=dbus.Signature('sa{ss}'))'
2023-03-21 21:56:17 +01:00
Thomas Haller
1f9de38a7b tools/tests: set available-connections for vlan device in NM test stub 2022-01-21 12:08:00 +01:00
Thomas Haller
0363d746ac tools: use "is" to compare _DEFAULT_ARG in "test-networkmanager-service.py" 2021-07-29 12:37:20 +02:00
Frederic Martinsons
8dc64c7bdd tools: correct NetworkManager top object set_state function
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-06-23 13:56:15 +02:00
Frederic Martinsons
e27141fb90 tools: suppress duplicate state change in deactivation step of active connection
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-06-23 13:56:15 +02:00
Thomas Haller
b6a195cf81 tools: remove deprecated PropertiesChanged signal in "test-networkmanager-service.py" 2021-05-14 10:57:35 +02:00
Frederic Martinsons
38331fc02c tests: add a dbus test function to change delay of active connection state change
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/740
2021-02-02 10:42:33 +01:00
Frederic Martinsons
c8b13dc92f Manage deactivation of active connection
Like what was done for activating an active connection, so
some state change are simulated and a dbus test method is added

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:10 +01:00
Frederic Martinsons
51dd9ed89a Enhance device state and active connection management
Add reason for device state change.
Add dbus test method to force failure of activation, set the
device state and the active connection state.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:10 +01:00
Frederic Martinsons
a3f596e273 Add basic modem device support
The modem device will have hardcoded capability which make it
compatible with GSM connection settings.
It will be seen with hardcoded ModemManager manager dbus object path
for the UDI property.
Add also a dbus test method to add the modem device.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Frederic Martinsons
f225148754 Initialize correctly _dbus_error_name in BusErr classes
To be consistent with dbus.DbusException classes which do the
following in __init__:

    def __init__(self, *args, **kwargs):
        name = kwargs.pop('name', None)
        if name is not None or getattr(self, '_dbus_error_name', None) is None:
            self._dbus_error_name = name
        if kwargs:
            raise TypeError('DBusException does not take keyword arguments: %s'
                            % ', '.join(kwargs.keys()))
        Exception.__init__(self, *args)

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Frederic Martinsons
7bc01ea14c Add dbus.Int32 support for variant parsing
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Sayed Shah
be822b52e6 all: reformat python files with python black
Part of !537.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/537
2020-06-15 16:40:38 +02:00
Beniamino Galvani
62c811b2bd cli: print interface flags 2019-11-22 10:18:26 +01:00
Thomas Haller
44a56fca60 libnm/tests: fix stub implementation for remote-next-connection
We cannot first remove the connection (and emit property changed signals),
before replying with the newly added path (that already no longer exists).
Fix the stub implementation.
2019-11-07 11:34:36 +01:00
Thomas Haller
6bf206eb81 libnm/tests: drop test_activate_failed() test
With this test the stub service simulates a failure to add-and-activate
the connection.

However the implementation of the stub service was not simulating the
real behavior of NetworkManager service. libnm will add the possibility
to assert against invalid server behavior by setting LIBNM_CLIENT_DEBUG=error.
With that change, libnm will complain that the stub service behaves
invalid, and rightly so.

Instead of fixing the test, just drop it.
2019-11-07 11:34:36 +01:00
Thomas Haller
ec39498fc6 tests: support D-Bus property Device.StateReason in mock service
The device interface (org.freedesktop.NetworkManager.Device) has
two properties: "State" and "StateReason". Both of them are supported by
NetworkManager for a very long time.

Note that "StateReason" is a tuple and also exposes the state along the
reason.

When reworking libnm, we will ignore the "State" property and only
consider "StateReason". The advantage is less code and not using
redundant state. This will also work well, because NetworkManager's
D-Bus API supports this property for a very long time.

However, that would then break the CI tests, because currently
"tools/test-networkmanager-service.py" does not expose that property.

Add it.
2019-11-07 11:34:36 +01:00
Thomas Haller
dab1d780fd libnm: retire deprecated WiMAX NMObject types
WiMAX is deprecated since NetworkManager 1.2.0. Note that also
NetworkManager on server side no longer supports this type, hence
the server's D-Bus API will never expose devices of this type.

Note that NMDeviceWimax and NMWimaxNsp are NMObject types. That means,
they are instantiated by NMClient to represent information on the D-Bus
interface. As NetworkManager no longer exposes WiMAX devices, such
devices are never created. Note that it makes no sense that a user would
directly instantiate NMObject types, because they only work together with
NMClient.

Don't drop the related symbols and definitions from libnm, so that there
is no API/ABI change (as far as building and linking is concerned). But
make the types defunctional (which of course is a behavioral API change).
Calling the API now triggers a g_return_*() warning.

Also belatedly mark the WimaxNsp API as deprecated. It should have been
done in 1.2. Note that here we deprecate the API and retire it at the
same time. Optimally, we would have deprecated it a few releases ago,
before retiring it. However, marking something for deprecation is anyway
no excuse for anything. I mean, removing or retiring API is usually
painful, regardless whether it was marked for deprecation or not. In this
case, there is no possibility that a libnm user gets hold on a NMDeviceWimax
or NMWimaxNsp instance, because NMClient simply no longer instantiates
them. Hence, this change should not affect any user in practice.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/316
2019-10-23 15:31:51 +02:00
Thomas Haller
ceae05cc4b tests: avoid deprecated GLib.IOChannel.add_watch() in "test-networkmanager-service.py"
test_001 (__main__.TestNmcli) ... /tmp/NetworkManager/tools/test-networkmanager-service.py:2346: PyGIDeprecationWarning: add_watch is deprecated; use GLib.io_add_watch() instead
  id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP,
2019-09-25 15:47:39 +02:00
Thomas Haller
c0e075c902 all: drop emacs file variables from source files
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
2019-06-11 10:04:00 +02:00
Beniamino Galvani
8200078ec5 lldp: support IEEE 802.3 TLVs
Add support for IEEE 802.3 organizationally specific TLVs:

 - MAC/PHY configuration/status (IEEE 802.1AB-2009 clause F.2)
 - power via medium dependent interface (clause F.3)
 - maximum frame size (clause F.4)
2019-03-27 10:47:24 +01:00
Beniamino Galvani
452851cc35 lldp: support multiple PPVIDs
As done for VLANs, add a new 'ppvids' attribute that reports all 'port
and protocol VLAN ID' TLVs for the neighbor.
2019-03-27 10:47:24 +01:00
Beniamino Galvani
c4be4ea298 lldp: support multiple vlans
Previously we exported the contents of VLAN Name TLV in the 'vid'
(uint32) and 'vlan-name' (string) attributes. This is not entirely
correct as the TLV can appear multiple times.

We need a way to export all the VLAN IDs and names for the
neighbor. Add a new 'vlans' attribute which obsoletes the other two
and is an array of dictionaries, where each dictionary contains the
'vid' and 'name' keys.
2019-03-27 10:47:24 +01:00
Beniamino Galvani
6c52d946fc lldp: add support for management address TLV
Support the management address TLV (IEEE 802.1AB-2009 clause
8.5.9). The TLV can appear multiple times and so it is exported on
D-Bus as an array of dictionaries.
2019-03-27 10:47:24 +01:00
Beniamino Galvani
b1d5f11b3d cli: add lldp output tests
Check the result of 'nmcli device lldp' command.
2019-03-27 10:17:39 +01:00
Frédéric Danis
10502f1701 tests: Fix variant_from_dbus() for arrays of UInt32
Using test-networkmanager-servic.py, I get the following error when
trying to add manual config with a dns address:

    Error: g-io-error-quark: Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
        retval = candidate_method(self, *args, **keywords)
      File "tools/test-networkmanager-service.py", line 1727, in AddConnection
        return self.add_connection(con_hash)
      File "tools/test-networkmanager-service.py", line 1731, in add_connection
        con_inst = Connection(self.c_counter, con_hash, do_verify_strict)
      File "tools/test-networkmanager-service.py", line 1601, in __init__
        NmUtil.con_hash_verify(con_hash, do_verify_strict=do_verify_strict)
      File "tools/test-networkmanager-service.py", line 497, in con_hash_verify
        BusErr.raise_nmerror(e)
      File "tools/test-networkmanager-service.py", line 419, in raise_nmerror
        raise e
    Exception: Unsupported value ipv4.dns = dbus.Array([dbus.UInt32(168430090L), dbus.UInt32(218893066L)], signature=dbus.Signature('u'), variant_level=1) (Cannot convert array element to type 'u': Must be number, not Variant)

https://mail.gnome.org/archives/networkmanager-list/2019-March/msg00013.html
(cherry picked from commit 9a71d7d273)
2019-03-11 16:44:22 +01:00
Lubomir Rintel
640164e979 clients/test: vary RSN capabilities across APs
This allows us to test if we distinguish WPA1, WPA2 and WPA3 in the
client.
2019-02-05 10:20:29 +01:00
Thomas Haller
fbb038af5e all: return output dictionary from "AddAndActivate2"
Add a "a{sv}" output argument to "AddAndActivate2" D-Bus API.
"AddAndActivate2" replaces "AddAndActivate" with more options.
It also has a dictionary argument to be forward compatible so that we
hopefully won't need an "AddAndActivate3". However, it lacked a similar
output dictionary. Add it for future extensibility. I think this is
really to workaround a shortcoming of D-Bus, which does provide strong
typing and type information about its API, but does not allow to extend
an existing API in a backward compatible manner. So we either resort to
Method(), Method2(), Method3() variants, or a catch-all variant with a
generic "a{sv}" input/output argument.

In libnm, rename "nm_client_add_and_activate_connection_options()" to
"nm_client_add_and_activate_connection2()". I think libnm API should have
an obvious correspondence with D-Bus API. Or stated differently, if
"AddAndActivateOptions" would be a better name, then the D-Bus API should
be renamed. We should prefer one name over the other, but regardless
of which is preferred, the naming for D-Bus and libnm API should
correspond.

In this case, I do think that AddAndActivate2() is a better name than
AddAndActivateOptions(). Hence I rename the libnm API.

Also, unless necessary, let libnm still call "AddAndActivate" instead of
"AddAndActivate2". Our backward compatibility works the way that libnm
requires a server version at least as new as itself. As such, libnm
theoretically could assume that server version is new enough to support
"AddAndActivate2" and could always use the more powerful variant.
However, we don't need to break compatibility intentionally and for
little gain. Here, it's easy to let libnm also handle old server API, by
continuing to use "AddAndActivate" for nm_client_add_and_activate_connection().
Note that during package update, we don't restart the currently running
NetworkManager instance. In such a scenario, it can easily happen that
nmcli/libnm is newer than the server version. Let's try a bit harder
to not break that.

Changes as discussed in [1].

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/37#note_79876
2019-01-14 11:56:18 +01:00
Benjamin Berg
00236ef977 libnm: Add support to pass options to AddAndActivateConnection
This adds the new methods nm_client_add_and_activate_connection_options_*
and ports the existing methods to use the new AddAndActivateConnection2
call rather than AddAndActivateConnection, allowing further parameters
to be passed in.
2018-11-17 12:15:40 +01:00
Beniamino Galvani
5ba301f4eb tests: simulate old LastScan wifi value in test-networkmanager-service.py
In this way clients will randomly find that the AP list is older than
30 seconds and they will issue a new scan.
2018-11-02 14:56:40 +01:00
Thomas Haller
0f503efd64 tests: support UInt64 type in test-networkmanager-service.py
and also accept "gsm" connection-type. Both will be used next.
2018-10-17 16:22:34 +02:00
Lubomir Rintel
d70185ddf1 all: point git references to the GitLab instance
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/2
2018-08-27 11:36:56 +02:00
Thomas Haller
9730961a02 tests/trivial: rename ip4_addr_ne32() to ip4_addr_be32() in test-networkmanager-service.py
The function is supposed to return the IPv4 address as 32 bit integer in
network byte order (bit endian). The ip4_addr_ne32() name is confusing,
because "ne" commonly stands for "native endianness".

Compare also "unaligned.h" and unaligned_read_ne32(), which also
stands for native endianness (host order), not network order (big
endian).

Rename.
2018-07-11 17:53:44 +02:00
Thomas Haller
296da44235 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 4e18ef49bf)
2018-06-18 11:33:15 +02:00
Thomas Haller
efddb0cef5 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 56a0488bba)
2018-06-18 10:58:05 +02:00
Thomas Haller
e05ce581b6 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 7e118c0091)
2018-06-18 10:58:04 +02:00
Lubomir Rintel
cfa3a02b91 tools/test-service: utilize nm_utils_get_timestamp_msec()
This is probably better than a hardcoded timestamp.
2018-06-15 16:23:30 +02:00
Lubomir Rintel
07fd0502f6 wifi: expose LastScan as milliseconds not seconds
This doesn't wrap around in 68 years of uptime and is consistent with
o.fd.NM.Checkpoint.Created.
2018-06-15 16:23:30 +02:00
Thomas Haller
9a14f9caa5 clients/tests: fix unstable tests for Python2 vs. Python3
Currently, nmcli does not sort the list of available connections
for display. Instead, it shows them in the order as NetworkManager
exposes them on D-Bus.

Previously, test-networkmanager-service.py, would generate the list
of available connections by iterating the connections dictionary.
In Python (at least until Python 3.6), the order when iterating over
dictionaries is undefined. This inconsistancy lets tests behave
differently depending on the python version. Possibly with Python
3.4 and 3.5, tests might even behave differently between individual
runs (since Python there uses siphash with a randomized hash seed).
2018-06-14 16:38:33 +02:00