Commit Graph

17 Commits

Author SHA1 Message Date
Thomas Haller
c7b3862503 platform: add network namespace support to platform
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
2016-03-07 12:28:13 +01:00
Thomas Haller
f74a9000b1 tests: use dbus-run-session for tools/run-test-valgrind.sh 2016-01-22 16:54:32 +01:00
Thomas Haller
ce238a7074 tests/valgrind: rename name of logfile for valgrind run
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.
2015-12-05 20:35:16 +01:00
Thomas Haller
4dacf0b1ad nmtst/valgrind: allow calling 'run-test-valgrind.sh' script directly
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
2015-11-24 11:02:55 +01:00
Thomas Haller
2a5d17eb5f valgrind: rework run-test-valgrind.sh script not to print unrelated message
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.
2015-06-04 17:48:34 +02:00
Lubomir Rintel
df0676ab00 tests: delete the valgrind logs if they're empty 2015-06-04 14:29:10 +02:00
Lubomir Rintel
d909e76d9e tests: don't limit the valgrind tracebacks to 12 frames
The glib tracebacks are typically longer.
2015-06-04 14:29:10 +02:00
Thomas Haller
ce3d1533cc test: fix running valgrind tests with NMTST_NO_VALGRIND
Fixes: 6463ce5dd9
2015-05-26 15:34:19 +02:00
Lubomir Rintel
dd959087a2 tests: be a bit more helpful when valgrind tests fail 2015-05-26 13:51:45 +02:00
Lubomir Rintel
6463ce5dd9 tests: use the TAP formatter
The test results in standard format are easily integrated into CI systems.
2015-05-26 13:51:45 +02:00
Lubomir Rintel
d0e25ac8be tests: always spawn private d-bus
Parallel test runs would not be possible without this.
2015-05-26 13:51:44 +02:00
Thomas Haller
95a750e4fa tests: allow running tests without valgrind by setting NMTST_NO_VALGRIND
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.
2015-02-09 15:49:58 +01:00
Thomas Haller
cfa4560073 tests: fail valgrind script if log file is non-empty 2015-02-09 12:10:13 +01:00
Thomas Haller
e7356ef0a6 libnm/tests: enable valgrind for libnm tests 2015-02-09 12:10:13 +01:00
Thomas Haller
9a2c0451a4 tests: fix valgrind script to handle exit value 77 (skip) 2015-02-06 12:58:42 +01:00
Pavel Šimerda
439473e9a4 valgrind: print absolute path
Relative paths in makefiles have different anchor than the current shell
directory.
2013-07-30 11:39:28 +02:00
Pavel Šimerda
b38f76cdb4 build: use a helper script for all valgrind tests 2013-07-26 19:08:03 +02:00