summaryrefslogtreecommitdiff
path: root/src/test/test-local-addresses.c
Commit message (Collapse)AuthorAgeFilesLines
* test-local-addresses: drop racy checkZbigniew Jędrzejewski-Szmek2022-10-201-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test would fail when addresses were being removed in parallel. In general, the check is only valid when the machine configuration is static, which in general isn't true. CentOS CI (Arch Linux) fails in TEST-02-UNITTESTS test-local-addresses: 10:38:05 (gdb) #0 0x00007f86260a164c in ?? () from /usr/lib/libc.so.6 10:38:05 No symbol table info available. 10:38:05 #1 0x00007f8626051958 in raise () from /usr/lib/libc.so.6 10:38:05 No symbol table info available. 10:38:05 #2 0x00007f862603b53d in abort () from /usr/lib/libc.so.6 10:38:05 No symbol table info available. 10:38:05 #3 0x00007f862639a755 in log_assert_failed ( 10:38:05 text=text@entry=0x56180e56c03b "n == n_ipv4 + n_ipv6", 10:38:05 file=file@entry=0x56180e56c0d1 "src/test/test-local-addresses.c", 10:38:05 line=line@entry=45, 10:38:05 func=func@entry=0x56180e56c360 <__PRETTY_FUNCTION__.6> "test_local_addresses") at ../build/src/basic/log.c:853 10:38:05 No locals. 10:38:05 #4 0x000056180e56b77e in test_local_addresses () 10:38:05 at ../build/src/test/test-local-addresses.c:45 10:38:05 a = 0x0 10:38:05 n = 234 10:38:05 n_ipv4 = 236 10:38:05 n_ipv6 = 7 10:38:05 __PRETTY_FUNCTION__ = "test_local_addresses" 10:38:05 __func__ = "test_local_addresses" 10:38:05 #5 0x000056180e56ba67 in run_test_table () at ../build/src/shared/tests.h:106 10:38:05 r = 0 10:38:05 t = 0x56180e56e010 <__unique_prefix_static_test_table_entry10> 10:38:05 __PRETTY_FUNCTION__ = <optimized out> 10:38:05 __func__ = "run_test_table" 10:38:05 #6 0x000056180e56bb2f in main (argc=1, argv=0x7ffc3a814808) 10:38:05 at ../build/src/test/test-local-addresses.c:81 10:38:05 _intro = 0x0 10:38:05 _outro = 0x0 10:38:05 _r = 0 10:38:05 _q = 0 10:38:05 (gdb) The logs show that there's a huge number of private addresses, probably from some other test running in parallel.
* test-local-addresses: inline iterator variableZbigniew Jędrzejewski-Szmek2022-10-201-3/+1
|
* test: Use TEST macroJan Janssen2021-11-251-5/+3
| | | | | | | | | This converts to TEST macro where it is trivial. Some additional notable changes: - simplify HAVE_LIBIDN #ifdef in test-dns-domain.c - use saved_argc/saved_argv in test-copy.c, test-path-util.c, test-tmpfiles.c and test-unit-file.c
* test: add testcases of filtering on dumping addressesYu Watanabe2021-05-251-10/+42
|
* local-addresses: add helper for determining local "outbound" IP addressesLennart Poettering2021-04-231-0/+7
| | | | | | | | | | | | | | | This adds a small helper, similar in style to local_addresses() and local_gateways() that determines the local "outbound" addresses. What's an "outbound" address supposed to be? The local IP addresses that are the most likely used for outbound communication. It's determined by using connect() towards the default gws on an UDP socket, and then reading the address of the socket this caused it to be bound to. This is not the "public" or "external" IP address of the local system, and is not supposed to be. It's just the local IP addresses that are likely the ones going to be used by the local IP stack for communication with other hosts.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* netlink: move local-addresses.[ch] to src/sharedLennart Poettering2019-07-241-0/+44
This code is not part of the public API of sd-netlink, nor used by it internally and hence should not be in the sd-netlink directory. Also, move the test case for it to src/test/.