- this allows the linker to drop unused symbols via link-time optimization
or with --gc-sections:
git clean -fdx
./autogen.sh --enable-ld-gc --enable-ifcfg-rh --enable-ifupdown \
--enable-ifnet --enable-ibft --enable-teamdctl --enable-wifi \
--with-modem-manager-1 --with-ofono --with-more-asserts \
--with-more-logging
make -j20
strip ./src/NetworkManager
gives 2822840 vs. 2625960 bytes (-7%).
- this also gives more control over the symbols that are used by the
plugins. Yes, it means if you modify a plugin to use a new symbols,
you have to extend NetworkManager.ver file.
You can run the script to create the version file:
$ ./tools/create-exports-NetworkManager.sh update
but be sure that your current configuration enables all plugins
and debugging options to actually use all symbols that are in use.
- If you compile with certain plugins enabled, you could theoretically
re-compile NetworkManager to expose less symbols. Try:
$ ./tools/create-exports-NetworkManager.sh build
- note that we have `make check` tests to ensure that all used
symbols of the plugins can be found. So, it should not be possible
to accidentally forget to expose a symbol.
Add new Reload D-Bus command to reload NetworkManager configuration.
For now, this is like sending SIGHUP to the process. There are several
advantages here:
- it is guarded via PolicyKit authentication while signals
can only be sent by root.
- the user can wait for the reload to be complete instead of sending
an asynchronous signal. For now, we operation completes after
nm_config_reload() returns, but later we could delay the response
further until specific parts are fully reloaded.
- SIGHUP reloads everything including re-reading configuration from
disk while SIGUSR1 reloads just certain parts such as writing out DNS
configuration anew.
Now, the Reload command has a flags argument which is more granular
in selecting parts which are to be reloaded. For example, via
signals the user can:
1) send SIGUSR1: this writes out the DNS configuration to
resolv.conf and possibly reloads other parts without
re-reading configuration and without restarting the DNS plugin.
2) send SIGHUP: this reloads configuration from disk,
writes out resolv.conf and restarts the DNS plugin.
There is no way, to only restart the DNS plugin without also reloading
everything else.
Otherwise the types links would be dangling or resolved to slightly
irrelevant documentation in libnm or completely irrelevant documentation
in libnm-util.
May use a lot of improvement (actually documenting the names and
objects that use the interfaces in question), but at least this looks a
lot better on developer.gnome.org.
Add a new NMPNetns class. This allows creation, deletion and
switching of network namespaces. The API only offers push/pop
operations to switch the namespace. This way the API enforces
the user to always restore the previous namespace.
A NMPlatform instance not only uses the netlink socket, but also
sysfs, udev, ethtool, mii. Still, a NMPlatform instance lives
entirely inside one namespace and is not spanning multiple namespaces.
To properly support network namespaces, the platform instance must
switch the namespace as necessary, transparent to the caller.
Udev is only supported in the main namespace.
For now, network namespaces are not actually used and are disabled
via the NM_PLATFORM_NETNS_SUPPORT argument.
https://bugzilla.gnome.org/show_bug.cgi?id=762408
Change the name of the file where to store the results
of the valgrind run.
Previously the file had a prefix "valgrind-", which is inconvinient.
Instead, have the file using the same name as the test executable,
with a ".valgrind-log" suffix.
When you want to run valgrind for a test, you either had to
invoke valgrind manually, or doing it via `make check` (provided
you configured --with-valgrind).
Make it more convenient to run valgrind by passing the test
to run to the "run-test-valgrind.sh" wrapper.
This also allows to pass -p/-s to the test, which is not possible
during `make check` because selecting tests conflicts with "--tap".
The following invocations are largely equivalent and work as
expected:
$ ./tools/run-test-valgrind.sh ./src/platform/tests/test-link-linux -p /link/software/detect/vlan
$ NMTST_DEBUG=no-debug,p=/link/software/detect/vlan ./tools/run-test-valgrind.sh ./src/platform/tests/test-link-linux
Add a macro to insert the necessary compiler/linker magic to add a
copy of an existing symbol to an older version. Also, update
check-exports.sh to be able to check for such symbols by listed them
commented-out in the appropriate section.
[thaller@redhat.com: patch modified]
Related: https://bugzilla.gnome.org/show_bug.cgi?id=742993
If the valgrind logfile is empty, don't log an error message with
the location of the logfile.
Also, if the test didn't fail due to memleaks, log a different message.
When configuring with --with-valgrind, tests will be invoked
via valgrind. That significantly slows down the tests. Allow
user to set the environment variable NMTST_NO_VALGRIND to invoke
tests directly, even when valgrind was enabled at configure time.
In Python 3, dbus.ByteArray() must be created using a byte string,
while strings obtained via DBUS are unicode strings.
This was wrong in WifiAp.__get_props() which broke the test
test_wifi_ap_added_removed().
File "/usr/lib/python3.3/site-packages/dbus/service.py", line 707, in _message_cb
retval = candidate_method(self, *args, **keywords)
File "./NetworkManager/tools/test-networkmanager-service.py", line 102, in GetAll
return self._get_dbus_properties(iface)
File "./NetworkManager/tools/test-networkmanager-service.py", line 96, in _get_dbus_properties
return self.__dbus_ifaces[iface]()
File "./NetworkManager/tools/test-networkmanager-service.py", line 315, in __get_props
props[PP_SSID] = dbus.ByteArray(self.ssid)
TypeError: string argument without an encoding
https://bugzilla.gnome.org/show_bug.cgi?id=739448
On ppc64, `nm` reports the exported symbols as 'D' instead of 'T'.
This caused `make check` to fail.
"D" The symbol is in the initialized data section.
"T" The symbol is in the text (code) section.
Move the definition of NMSettingsError to nm-errors, register it with
D-Bus, and verify in the tests that it maps correctly.
Remove a few unused error codes, simplify a few others, and rename
GENERAL to FAILED and HOSTNAME_INVALID to INVALID_HOSTNAME, for
consistency.
Merge libnm's NMDeviceError and the daemon's NMDeviceError into a
single enum (in nm-errors.h). Register the domain with D-Bus, and add
a test that the client side decodes it correctly.
The daemon's NM_DEVICE_ERROR_CONNECTION_INVALID gets absorbed into
libnm's NM_DEVICE_ERROR_INVALID_CONNECTION, and
NM_DEVICE_ERROR_UNSUPPORTED_DEVICE_TYPE gets dropped, since it was
only returned from one place, which is now using
NM_DEVICE_ERROR_FAILED, since (a) it ought to be a "can't happen", and
(b) the only caller of that function just logs error->message and then
frees the error without ever looking at the code.
Register NMConnectionError with D-Bus on both sides, so that, eg,
connection validation failures in the daemon will translate to the
correct error codes in the client.
Implement some basic secret agent functionality in
test-networkmanager-service.py, and add test-secret-agent to test that
NMSecretAgent works as expected.
Due to behavioral change of test-networkmanager-service.py, the test
/remote_settings/remove_connection fails (test_remove_connection() at
test-remote-settings-client.c:318).
Fixes: 66a3480329
Signed-off-by: Thomas Haller <thaller@redhat.com>
Since NMRemoteSettings doesn't announce new connections until it has
fetched their properties, it's possible that a connection could get
deleted while we're waiting for it to be created. NMRemoteSettings has
code to deal with this, so add a test to make sure that it works.
test-nm-client.c and test-remote-settings-client.c were using their
own assertion macros so they could kill the test service on assertion
failure. Except that some new code didn't get the memo and used the
g_assert* macros. Not to mention that sometimes the tests would crash
outside of an assertion macro.
We can make test-networkmanager-service.py notice that its parent has
crashed by opening a pipe between them and taking advantage of the
fact that the pipe will be automatically closed if the parent crashes.
So then test-networkmanager-service.py just has to watch for that, and
exit if the pipe closes.
Then that lets us drop the test_assert* macros and just use g_assert*
instead.