summaryrefslogtreecommitdiffstats
path: root/tests/nl-test-util.h
Commit message (Collapse)AuthorAgeFilesLines
* tests: add _nltst_objects_to_string() helperThomas Haller2024-08-221-0/+3
|
* tests: add _nltst_malloc0() and _nltst_sprintf() helpersThomas Haller2024-08-221-0/+27
|
* tests: move definition of asserts in "tests/nl-test-util.h"Thomas Haller2024-08-221-38/+40
|
* tests: add a very basic test for route cacheThomas Haller2024-05-171-0/+10
| | | | Hopefully more to come, and more to improve.
* tests: add NLTstSelectRoute test helperThomas Haller2024-05-171-0/+64
| | | | | Add functions for matching a route. Currently only a few trivial options are supported, like the destination address and the ifindex.
* tests: set NLTST_IN_CI for not skipping tests accidentallyThomas Haller2024-05-171-0/+2
| | | | | In CI, we know which tests should be skipped. Let github actions set NLTST_IN_CI=1, and disable certain skip checks.
* tests: add helper to detect availablility of iproute2Thomas Haller2024-05-171-0/+3
|
* tests: add helper functions for testsThomas Haller2024-05-171-0/+44
|
* tests: fix _nltst_object_to_string() to print one line onlyThomas Haller2024-05-171-1/+1
|
* format: reformat "tests/nl-test-util.h" fileThomas Haller2024-05-161-112/+112
|
* include: don't explicitly include headers from "nl-default.h"Thomas Haller2023-08-031-4/+0
|
* tests: cleanup include of netlink headersThomas Haller2023-08-031-3/+2
| | | | | For no strong reason, we include the public netlink headers with <> instead of "". Be consistent.
* nl-aux: add "include/nl-aux-{core,route}" headersThomas Haller2023-07-311-2/+4
| | | | | | | | | | | | | | | | | | | We have "include/netlink-private/netlink.h", which is private API used internally. However, it's confusing where "include/netlink-private/netlink.h" can be used. For example, it contains some "libnl-route-3.so" specific extensions like "link_lookup()", hence you would think that it can only be used with libraries that also use "libnl-route-3.so". Well, since it's a header, you actually can also use it for example under "lib/xfrm/", you couldn't just use those declarations because they are implemented and accessible only under "lib/route/" In a first step to clean this up, and move helper to separate headers, add "include/nl-aux-{core,route}" headers with certain clear usage. Clear in the sense who may use those headers, and what the implementation of those headers may use.
* base: move "netlink-private/utils.h" to "base/nl-base-utils.h"Thomas Haller2023-07-311-1/+1
| | | | | | | | | | "base/nl-base-utils.h" (formerly "netlink-private/utils.h") contains no libnl3 specific references, just a bunch of C helpers. It's also a header-only "library", so it can be freely used by all our C-code. Move it to a separate directory, to make that clear.
* tests: add test utilsThomas Haller2022-05-091-1/+335
|
* tests: cleanup unshare_user() and use _nltst_fclose()Thomas Haller2022-04-211-0/+8
|
* tests: add unit test for nl_object_clone() and nl_object_diff()Thomas Haller2022-03-161-0/+16
|
* tests: add fixture/teardown for tests to run in separate netnsThomas Haller2022-03-161-0/+34
| | | | | | | | | | | | | We run the unit tests as non-root user, so usually we wouldn't have CAP_NET_ADMIN permissions to change networking. Also, we wouldn't want that our unit tests depend on the networking of the test host (or changes it). For each test, enter a new network namespace (and user/mnt namespace). There we will have the necessary permissions, and we are in full control of the things in the namespace. Note yet used.
* tests: refactor tests and add n-test-util helper libraryThomas Haller2022-03-161-0/+8
- we have "check-all.c" and "check-direct.c", which contains the main functions of the actual tests. On the other hand, the other "check-{addr,attr,ematch-tree-clone}.c" files only contained the test suites for "check-all.c". Rename the latter to have a separate name prefix. - rename "tests/util.h" to "tests/cksuite-all.h". It's really the header that declares all the suites. - add a "tests/nl-test-util.c" as a static helper library with test code.