Previously, an enum that didn't explicitly specify a numeric value
would wrongly start counting at 1.
E.g.
typedef enum {
MY_VAL,
} Name;
would result in documentation with MY_VAL=1.
https://bugzilla.gnome.org/show_bug.cgi?id=776848
Generating "src/NetworkManager.ver" each time seems to work well.
Thus, src/NetworkManager.ver-orig is unused an gets easily out
of date. Just remove it. It's not useful anymore.
- also when called from makefile, allow enabling valgrind even if it was not
enabled via configure option. That is, even if you configured --without-valgrind,
you can run tests via `NMTST_USE_VALGRIND=1 make check`. Previously, there
was no way to run on valgrind during `make check` unless you also had
configured --with-valgrind.
- Use $NMTST_VALGRIND variable to override the valgrind path. This now
always takes precedence. For `make check`, the path can be determined
by the configure script.
If all unspecified, as last fallback "valgrind" is searched in the current
$PATH.
- Allow to specify the suppressions file via $NMTST_SUPPRESSIONS.
If unset, fall back to the default. The default during `make check`
is determined by the configure options. The default for manual
invocation is our one valgrind.suppressions file.
To use no suppressions file, set NMTST_SUPPRESSIONS to empty.
Now, regardless of what you enabled during ./configure, you can
overwrite it via:
$ NMTST_USE_VALGRIND=1 \
NMTST_VALGRIND=~/bin/valgrind \
NMTST_SUPPRESSIONS=my-suppressions \
make check
Moving the PPP manager to a separate plugin that is loaded when needed
has the advantage of slightly reducing memory footprint and makes it
possible to install the PPP support only where needed.
https://bugzilla.gnome.org/show_bug.cgi?id=773482
This adds 0.4 seconds to the build time.
You can disable it by setting $NM_BUILD_NO_CREATE_EXPORTS environment
variable. This is useful in the unexpected case that the script
is broken.
Or, if you just want to use a different, non-generated version-script.
Or, if you want to save 0.4 seconds build-time.
- include symbols from the "B" section.
- improve the script, to use libNetworkManager.a instead
of the NetworkManager binary. The former is before stripping
symbols.
With --make-first|-m we first call `make` on the test.
However, the make path must be a relative path rooted
in the top directory.
Make sure we `cd` into the parent directory first and pass
the proper make path.
cd src
../tools/run-nm-test.sh -m settings/plugins/ifcfg-rh/tests/test-ifcfg-rh
No need to have two test-runners. Combine them, and call tests always
via "tools/run-nm-test.sh".
Yes, this brings an overhead, that we now always invoke the test with
a test wrapper script, also --without-vagrind. Previously, that was only
necessary for libnm tests that require their own D-Bus session.
Later we will do non-recursive Makefiles, thus all tests should have the
same LOG_COMPILER.
- 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.