summaryrefslogtreecommitdiff
path: root/src/devices/tests
Commit message (Collapse)AuthorAgeFilesLines
* platform/tests: use nm_platform_link_veth_add() to create veth pair in testThomas Haller2017-05-271-3/+2
|
* tests/lldp: skip test if there's no Tun deviceLubomir Rintel2017-03-281-2/+12
|
* all: use O_CLOEXEC for file descriptorsThomas Haller2016-12-131-2/+2
|
* build: don't add subdirectories to include search path but require qualified ↵Thomas Haller2016-11-212-4/+4
| | | | | | | | | | | | | | | include Keep the include paths clean and separate. We use directories to group source files together. That makes sense (I guess), but then we should use this grouping also when including files. Thus require to #include files with their path relative to "src/". Also, we build various artifacts from the "src/" tree. Instead of having individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be unified. Previously, the CFLAGS for each artifact differ and are inconsistent in which paths they add to the search path. Fix the inconsistency by just don't add the paths at all.
* build: merge "src/devices/tests/Makefile.am" into toplevel MakefileThomas Haller2016-10-213-54/+2
|
* build: merge "src/platform/tests/Makefile.am" into toplevel MakefileThomas Haller2016-10-212-0/+4
|
* build/trivial: rename VALGRIND_RULES in Makefile.am to NM_LOG_COMPILERThomas Haller2016-10-191-1/+1
|
* build: don't add systemd path the include search pathThomas Haller2016-09-272-6/+1
| | | | | | | | | | | | | | | | | | | | Our internal copy of systemd should not be in the search path. Instead, let users only #include "systemd/nm-sd.h" which then includes everything from systemd that we need. We want to avoid to accidentally include anything from our systemd-copy. Any user of that should only include "nm-sd.h", which then includes everything that is needed further. For example, "src/devices/wwan/nm-modem-manager.c" has #include <systemd/nm-daemon.h> which in turn includes #include "_sd-common.h" This works all correctly before, because #include "" will first look in the directory where sd-daemon.h is. However, our mixing of external systemd library and internal copy is rather dangerous. Try to avoid it further by keeping the include paths clean.
* all/tests: split core part out of "nm-test-utils.h"Thomas Haller2016-05-171-1/+1
| | | | | | | A large part of "nm-test-utils.h" is only relevant for tests inside "src/" directory, as they are helpers related to NetworkManager core part. Split this part out of "nm-test-utils.h" header.
* platform/tests: add @platform argument to nmtstp functionsThomas Haller2016-04-111-1/+1
| | | | | | | | | | | | | | This allows tests to use these functions on a different platform instance then on the singleton. The change makes the argument list longer, which is unfortunate. On the other hand, it makes those functions more useful in general. You can't have it all. Also, they now follow the pattern of most functions in NM where the type is a singleton: you always pass the singleton to the function, although in the usual case there is only one singleton instance. This allows to use the function also on the non-singleton instance.
* platform/tests/trivial: rename init_tests() and setup_tests() functionThomas Haller2016-04-112-4/+4
| | | | | Make it clear that they are nmtstp functions, i.e. they are found in the header "test-common.h".
* build: disable deprecation checks for internal compilationThomas Haller2016-04-051-1/+0
| | | | | | | | | | | | For internal compilation we want to be able to use deprecated API without warnings. Define the version min/max macros to effectively disable deprecation warnings. However, don't do it via CFLAGS option in the makefiles, instead hack it to "nm-default.h". After all, *every* source file that is for internal compilation needs to include this header as first.
* merge: merge branch 'systemd' into masterThomas Haller2016-04-011-6/+5
| | | | | After merging https://github.com/systemd/systemd/pull/2898, use the LLDP defines now from public systemd API.
* lldp: process one neighbor at a timeThomas Haller2016-03-171-1/+1
| | | | | | | | | | The systemd event tells which neighbor changed. Make use of this information and don't rebuild all the neighbors all the time. That means, we must also change our rate limiting. Instead of rate limiting the processing of all neighbors, we process neighbors right away but limit the notification that gobject property changed.
* platform/tests: pass platform argument to nmtstp helper functionsThomas Haller2016-03-152-3/+3
| | | | | | Make the test helper independent from the platform singleton instance. That way, we can also use them for other platform instances (e.g. in a different namespace).
* systemd: split "nm-sd.h" out of "nm-sd-adapt.h"Thomas Haller2016-03-111-1/+2
| | | | | | | | | | | | | | | | | | | Now we have: "nm-sd.h" is a header file of NetworkManager with utilities related to systemd. It can be used anywhere freely. Also, systemd headers that are considered public API (like "sd-event.h") can be used without restrictions. When compiling the systemd sources, we always must include "nm-sd-adapt.h" as first. Similarly, systemd headers must not include "nm-sd-adapt.h", because they are either public (in which case the adapter is not needed) or they are internal (in which case they are themself included via a systemd source). Sometimes, we must internal API (like "dhcp-lease-internal.h"). In this case, we also must include "nm-sd-adapt.h".
* systemd: integrate sd-event into glib main loopThomas Haller2016-03-111-0/+4
| | | | | We should not try to reimplement sd-event based on glib, instead we should hook sd-event into the glib mainloop.
* systemd: merge branch systemd into th/systemd-lldp-bgo763384Thomas Haller2016-03-111-4/+3
| | | | | | | As the lldp API changed, adjust "nm-lldp-listener.c". Note that the commit is not yet functional due to missing sd_event_source_set_enabled() and sd_event_source_set_time().
* lldp/tests: add test for ttlThomas Haller2016-03-101-6/+52
|
* lldp/tests: use nmtst_main_loop_run()Thomas Haller2016-03-101-9/+2
|
* lldp/tests: add a test with another lldp frameThomas Haller2016-03-101-0/+136
|
* lldp/tests: refactor checking for lldp neighborsThomas Haller2016-03-101-59/+58
| | | | | | Also assert against the number of properties in the attributes and explicitly assert against the values of chassis-id-type, port-id-type, and system-description.
* lldp/tests: refactor tests to run receive different framesThomas Haller2016-03-101-51/+95
|
* lldp/tests/trivial: some renaming and moving of codeThomas Haller2016-03-101-58/+61
|
* platform: add and use nm_utils_ifname_cpy() helperThomas Haller2016-03-071-1/+4
| | | | | | | | | Coverity complains rightly about "strncpy (dst, ifname, IFNAMSIZ)" because it might leave @dst non-NULL-terminated, in case @ifname is too long (which already would be a bug in the first place). Replace the strcpy() uses by a new helper nm_utils_ifname_cpy() that asserts against valid arguments.
* platform: add flags argument to nm_platform_ip4_address_add()Thomas Haller2016-03-011-1/+1
| | | | | The argument is still always unset. We will need it later to set IFA_F_NOPREFIXROUTE.
* lldp/tests: fix memleaks in testThomas Haller2016-03-011-17/+22
| | | | valgrind complains since commit ae9cc8910ddd04d43c9a15dbbe92a4863b6c49f0.
* lldp/tests: unref lldp instance in testThomas Haller2016-02-291-1/+1
|
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-192-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* core: add test for NMArpingManagerBeniamino Galvani2016-01-202-2/+156
|
* build: rename directory "include" to "shared"Thomas Haller2015-12-241-2/+2
| | | | | | | | | | Up to now, the "include" directory contained (only) header files that were used project-wide by libs, core, clients, et al. Since the directory now also contains a non-header file, the "include" name is misleading. Instead of adding yet another directory that is project-wide, with non-header-only content, rename the "include" directory to "shared".
* lldp: add test caseBeniamino Galvani2015-11-102-0/+263
Add a test for the LLDP listener to ensure that things don't accidentally break when we import new code from systemd upstream. https://bugzilla.gnome.org/show_bug.cgi?id=757005