Commit graph

191 commits

Author SHA1 Message Date
Iñigo Martínez a010fcb5f7 meson: Move network-config directory creation to main install file
The `ifcfg-rh` meson build file installs a new post install script
to create the `network-config` directory.

This has been moved to the main post install file so it's easier to
find because all post install steps are together and it avoids and
extra post install script execution.
2019-10-01 09:49:33 +02:00
Thomas Haller abff46cacf all: manually drop code comments with file description 2019-10-01 07:50:52 +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
Lubomir Rintel 24028a2246 all: SPDX header conversion
$ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
2019-09-10 11:19:56 +02:00
Beniamino Galvani 11cf082a62 build: use regexp in gtkdoc --ignore-decorators option
gtkdoc-scan supports regular expressions in the --ignore-decorators
command-line option. Since it is easier to use a regexp than grepping
macros from a source file, revert the ugly solution from commit
2d941dc95a ('build: fix errors when building with gtk-doc 1.32').
2019-09-06 14:18:24 +02:00
Beniamino Galvani 2d941dc95a build: fix errors when building with gtk-doc 1.32
gtkdoc-scan 1.32 performs stricter checks on structures definitions
and so it complains on:

 /build/networkmanager/src/NetworkManager/libnm/./nm-vpn-plugin-old.h:0: warning: partial declaration (struct) : typedef struct {
 	NM_DEPRECATED_IN_1_2
 	GObject parent;
 } NMVpnPluginOld NM_DEPRECATED_IN_1_2;

because of the unrecognized token 'NM_DEPRECATED_IN_1_2'.

Pass all allowed macros to gtkdoc-scan through the --ignore-decorators
argument.

https://gitlab.gnome.org/GNOME/gtk-doc/issues/98
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/238
2019-09-05 11:17:54 +02:00
Thomas Haller d35d3c468a settings: rework tracking settings connections and settings plugins
Completely rework how settings plugin handle connections and how
NMSettings tracks the list of connections.

Previously, settings plugins would return objects of (a subtype of) type
NMSettingsConnection. The NMSettingsConnection was tightly coupled with
the settings plugin. That has a lot of downsides.

Change that. When changing this basic relation how settings connections
are tracked, everything falls appart. That's why this is a huge change.
Also, since I have to largely rewrite the settings plugins, I also
added support for multiple keyfile directories, handle in-memory
connections only by keyfile plugin and (partly) use copy-on-write NMConnection
instances. I don't want to spend effort rewriting large parts while
preserving the old way, that anyway should change. E.g. while rewriting ifcfg-rh,
I don't want to let it handle in-memory connections because that's not right
long-term.

--

If the settings plugins themself create subtypes of NMSettingsConnection
instances, then a lot of knowledge about tracking connections moves
to the plugins.
Just try to follow the code what happend during nm_settings_add_connection().
Note how the logic is spread out:
 - nm_settings_add_connection() calls plugin's add_connection()
 - add_connection() creates a NMSettingsConnection subtype
 - the plugin has to know that it's called during add-connection and
   not emit NM_SETTINGS_PLUGIN_CONNECTION_ADDED signal
 - NMSettings calls claim_connection() which hocks up the new
   NMSettingsConnection instance and configures the instance
   (like calling nm_settings_connection_added()).
This summary does not sound like a lot, but try to follow that code. The logic
is all over the place.

Instead, settings plugins should have a very simple API for adding, modifying,
deleting, loading and reloading connections. All the plugin does is to return a
NMSettingsStorage handle. The storage instance is a handle to identify a profile
in storage (e.g. a particular file). The settings plugin is free to subtype
NMSettingsStorage, but it's not necessary.
There are no more events raised, and the settings plugin implements the small
API in a straightforward manner.
NMSettings now drives all of this. Even NMSettingsConnection has now
very little concern about how it's tracked and delegates only to NMSettings.

This should make settings plugins simpler. Currently settings plugins
are so cumbersome to implement, that we avoid having them. It should not be
like that and it should be easy, beneficial and lightweight to create a new
settings plugin.

Note also how the settings plugins no longer care about duplicate UUIDs.
Duplicated UUIDs are a fact of life and NMSettings must handle them. No
need to overly concern settings plugins with that.

--

NMSettingsConnection is exposed directly on D-Bus (being a subtype of
NMDBusObject) but it was also a GObject type provided by the settings
plugin. Hence, it was not possible to migrate a profile from one plugin to
another.
However that would be useful when one profile does not support a
connection type (like ifcfg-rh not supporting VPN). Currently such
migration is not implemented except for migrating them to/from keyfile's
run directory. The problem is that migrating profiles in general is
complicated but in some cases it is important to do.

For example checkpoint rollback should recreate the profile in the right
settings plugin, not just add it to persistent storage. This is not yet
properly implemented.

--

Previously, both keyfile and ifcfg-rh plugin implemented in-memory (unsaved)
profiles, while ifupdown plugin cannot handle them. That meant duplication of code
and a ifupdown profile could not be modified or made unsaved.
This is now unified and only keyfile plugin handles in-memory profiles (bgo #744711).
Also, NMSettings is aware of such profiles and treats them specially.
In particular, NMSettings drives the migration between persistent and non-persistent
storage.

Note that a settings plugins may create truly generated, in-memory profiles.
The settings plugin is free to generate and persist the profiles in any way it
wishes. But the concept of "unsaved" profiles is now something explicitly handled
by keyfile plugin. Also, these "unsaved" keyfile profiles are persisted to file system
too, to the /run directory. This is great for two reasons: first of all, all
profiles from keyfile storage in fact have a backing file -- even the
unsaved ones. It also means you can create "unsaved" profiles in /run
and load them with `nmcli connection load`, meaning there is a file
based API for creating unsaved profiles.
The other advantage is that these profiles now survive restarting
NetworkManager. It's paramount that restarting the daemon is as
non-disruptive as possible. Persisting unsaved files to /run improves
here significantly.

--

In the past, NMSettingsConnection also implemented NMConnection interface.
That was already changed a while ago and instead users call now
nm_settings_connection_get_connection() to delegate to a
NMSimpleConnection. What however still happened was that the NMConnection
instance gets never swapped but instead the instance was modified with
nm_connection_replace_settings_from_connection(), clear-secrets, etc.
Change that and treat the NMConnection instance immutable. Instead of modifying
it, reference/clone a new instance. This changes that previously when somebody
wanted to keep a reference to an NMConnection, then the profile would be cloned.
Now, it is supposed to be safe to reference the instance directly and everybody
must ensure not to modify the instance. nmtst_connection_assert_unchanging()
should help with that.
The point is that the settings plugins may keep references to the
NMConnection instance, and so does the NMSettingsConnection. We want
to avoid cloning the instances as long as they are the same.
Likewise, the device's applied connection can now also be referenced
instead of cloning it. This is not yet done, and possibly there are
further improvements possible.

--

Also implement multiple keyfile directores /usr/lib, /etc, /run (rh #1674545,
bgo #772414).

It was always the case that multiple files could provide the same UUID
(both in case of keyfile and ifcfg-rh). For keyfile plugin, if a profile in
read-only storage in /usr/lib gets modified, then it gets actually stored in
/etc (or /run, if the profile is unsaved).

--

While at it, make /etc/network/interfaces profiles for ifupdown plugin reloadable.

--

https://bugzilla.gnome.org/show_bug.cgi?id=772414
https://bugzilla.gnome.org/show_bug.cgi?id=744711
https://bugzilla.redhat.com/show_bug.cgi?id=1674545
2019-07-16 19:09:08 +02:00
Thomas Haller 7b6f1c2d90 tools: export more symbols from NetworkManager binary to plugins
Plugins also may use nmtst_*() functions (when built with --with-more-asserts)
or c_list_*(). Whitelist them too.
2019-06-26 12:26:11 +02:00
Thomas Haller 74641be816 settings: drop ibft settings plugin
The functionality of the ibft settings plugin is now handled by
nm-initrd-generator. There is no need for it anymore, drop it.

Note that ibft called iscsiadm, which requires CAP_SYS_ADMIN to work
([1]). We really want to drop this capability, so the current solution
of a settings plugin (as it is implemented) is wrong. The solution
instead is nm-initrd-generator.

Also, on Fedora the ibft was disabled and probably on most other
distributions as well. This was only used on RHEL.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1371201#c7
2019-06-20 16:06:44 +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
Lubomir Rintel a95b674c39 build: install dispatcher dirs in /usr
The dispatcher looks there for scripts now. This actually doesn't break
the RPM build, since it doesn't mind extra empty directories in
buildroot. Good.
2019-04-26 22:07:30 +02:00
Thomas Haller 17adf58d5d tools: fix out-of-tree build test "tools/check-docs.sh" for duplicate generated sources
When we do an in-tree-build with autotools and an out-of-tree build
with meson (all in the same source directory), then we have the
following files:

  libnm-core/nm-core-enum-types.h
  libnm/nm-enum-types.h
  build/libnm-core/nm-core-enum-types.h
  build/libnm/nm-enum-types.h

This caused "tools/check-docs.sh" for `ninja -C build test` to fail,
because the files are detected twice:

    --- command ---
    /data/src/NetworkManager/tools/check-docs.sh /data/src/NetworkManager /data/src/NetworkManager/build
    --- stderr ---
    8a9
    > nm-core-enum-types
    38a40
    > nm-enum-types
    *** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***
    -------
2019-04-23 11:45:06 +02:00
Thomas Haller a9b4362fc5 tools: cleanup path variable in "tools/check-docs.sh"
- don't append the path separator to the SOURCEDIR variable.
  Instead, use the path separator when we need it.
2019-04-23 11:45:06 +02:00
Lubomir Rintel 5801f89f4d all: goodbye libnm-glib
This removes libnm-glib, libnm-glib-vpn, and libnm-util for good.
The it has been replaced with libnm since NetworkManager 1.0, disabled
by default since 1.12 and no up-to-date distributions ship it for years
now.

Removing the libraries allows us to:

* Remove the horrible hacks that were in place to deal with accidental use
  of both the new and old library in a single process.
* Relief the translators of maintenance burden of similar yet different
  strings.
* Get rid of known bad code without chances of ever getting fixed
  (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c)
* Generally lower the footprint of the releases and our workspace

If there are some really really legacy users; they can just build
libnm-glib and friends from the NetworkManager-1.16 distribution. The
D-Bus API is stable and old libnm-glib will keep working forever.

https://github.com/NetworkManager/NetworkManager/pull/308
2019-04-16 15:52:27 +02:00
Lubomir Rintel b027723e00 Revert "all: goodbye libnm-glib"
We need this for a little little longer :(

This reverts commit 1de8383ad9.
2019-04-03 08:52:38 +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
Lubomir Rintel 1de8383ad9 all: goodbye libnm-glib
This removes libnm-glib, libnm-glib-vpn, and libnm-util for good.
The it has been replaced with libnm since NetworkManager 1.0, disabled
by default since 1.12 and no up-to-date distributions ship it for years
now.

Removing the libraries allows us to:

* Remove the horrible hacks that were in place to deal with accidental use
  of both the new and old library in a single process.
* Relief the translators of maintenance burden of similar yet different
  strings.
* Get rid of known bad code without chances of ever getting fixed
  (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c)
* Generally lower the footprint of the releases and our workspace

If there are some really really legacy users; they can just build
libnm-glib and friends from the NetworkManager-1.16 distribution. The
D-Bus API is stable and old libnm-glib will keep working forever.

https://github.com/NetworkManager/NetworkManager/pull/308
2019-03-19 17:15:15 +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
Beniamino Galvani 81bc218e6d meson: add check on settings docs
Move the autotools check on settings docs to a shell script and call
it from meson too.
2018-12-12 14:38:18 +01:00
Beniamino Galvani 446e5b27d6 core: add checks on connection default properties
Add a new CON_DEFAULT() macro that places a property name into a
special section used at runtime to check whether it is a supported
connection default.

Unfortunately, this mechanism doesn't work for plugins so we have to
enumerate the connection defaults from plugins in the daemon using
another CON_DEFAULT_NOP() macro.
2018-12-01 15:16:48 +01:00
Beniamino Galvani 2e45d4ada6 build: check that the list of supported config options is up to date
Add a script run during 'make check' to verify that all config options
are in the list of supported ones.
2018-12-01 15:16:48 +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 38299a1d78 build: meson: fix wrong man page link
Fixes: 98b4a19a53

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/78
2018-11-08 10:21:58 +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 168e8b9b6f build: fix check-docs.sh for out-of-tree builds
Fixes: 7a59cd2744
2018-10-25 11:08:39 +02:00
Thomas Haller 7a59cd2744 docs: rework check-docs test script
Try to make check-docs.sh script more readable.

Also, previously the script would check that one side was a subset
of the other side. Tighten this check up, now both sides of the
comparison must agree and yield the same lines.
2018-10-25 09:40:53 +02:00
Michael Biebl e11ee4582a docs: fix bashism in tools/check-docs.sh
[thaller@redhat.com: fixed issue in original patch]
2018-10-25 08:00:40 +02:00
Beniamino Galvani 1408ffd9f6 build: fix ibft option in create-exports-NetworkManager.sh 2018-10-24 22:10:31 +02: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
Thomas Haller 343b99f891 acd/tests: skip NAcd tests under valgrind
Under valgrind, we cannot create an NAcd instance.

    --10916-- WARNING: unhandled amd64-linux syscall: 321
    --10916-- You may be able to write your own handler.
    --10916-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
    --10916-- Nevertheless we consider this a bug.  Please report
    --10916-- it at http://valgrind.org/support/bug_reports.html.

This limitation already poses a problem, because running NetworkManager
under valgrind might fail. However, for tests it doesn't matter and we
can just skip them.
2018-10-04 10:58:50 +02:00
Thomas Haller 15857ad958 build: silence message in "tools/create-exports-NetworkManager.sh" about missing directory
When building with meson -Dppp=false, the following message is printed
during build:

  [623/671] Generating NetworkManager.ver with a custom command. find: ‘./src/ppp/’: No such file or directory

The message is harmless. Hide it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/43
2018-10-01 18:38:38 +02:00
Beniamino Galvani 24fc3c54a3 build: meson: fix install script
Fix directory paths and modes.

Fixes: 98b4a19a53
2018-09-28 17:25:46 +02:00
Beniamino Galvani 19a718bc13 build: meson: fix computing NM exported symbols
The script didn't include all the symbols needed by plugins because
libNetworkManager.a, as built by meson, doesn't include symbols from
other static libraries that are linked in. Since we used
libNetworkManager.a to know which symbols are potentiall available
from NM, the result was an incomplete list.

Unfortunately, the only way to include the whole static library is to
create a dependency object and use 'link_whole', but this is only
available in meson >= 0.46. Since 'link_whole' is available for
executables in meson >= 0.40, create a fake executable and use that to
enumerate symbols.

Also add tests to check that plugins can be loaded correctly.

Fixes: dfa2a2b40c
2018-09-19 16:03:32 +02:00
Beniamino Galvani 98b4a19a53 build: meson: support $DESTDIR in installation script
Adapt the meson post-installation script to handle the $DESTDIR
variable supplied by user to specify the installation target
directory. While at it, convert the script to shell because it seems
simpler to me.
2018-09-19 16:03:32 +02:00
luz.paz 58510ed566 docs: misc. typos pt2
Remainder of typos found using `codespell -q 3 --skip="./shared,./src/systemd,*.po" -I ../NetworkManager-word-whitelist.txt` whereby whitelist consists of:
 ```
ans
busses
cace
cna
conexant
crasher
iff
liftime
creat
nd
sav
technik
uint
```

https://github.com/NetworkManager/NetworkManager/pull/205
2018-09-17 11:26:13 +02:00
Beniamino Galvani 10ca2444b9 build: support meson builds in create-exports script
(cherry picked from commit 9b4bc0824c)
2018-09-13 14:35:25 +02:00
Thomas Haller 921db9132e build: fix whitelisting c-siphash symbols in NetworkManager.ver for device plugin
NetworkManager.ver needs to whitelist symbols needed by device,
settings, and ppp plugin. Fix the generator script to also allow
using c_siphash_*() symbols. These are needed by nm_hash_*().

Without this, wifi device plugin is broken.

Fixes: ccf36ff4ce
2018-09-05 16:55:45 +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
Lubomir Rintel 4fa1a49542 docs: include missing documentation in libnm and D-Bus docs
Check that we don't repeat the omission in future.

(cherry picked from commit cb1172ee3d)
2018-06-28 20:43:26 +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