Zbigniew Jędrzejewski-Szmek
5e2a51d588
networkd: use OrderedSets instead of strvs to store lists of domains
...
We were already using OrderedSets in the manager object, but strvs in the
configuration parsing code. Using sets gives us better scaling when many
domains are used.
In oss-fuzz #13059 the attached reproducer takes approximately 30.5 s to be
parsed. Converting to sets makes this go down to 10s. This is not _vastly_
faster, but using sets seems like a nicer approach anyway. In particular, we
avoid the quadratic de-unification operation after each addition.
2019-02-21 12:04:27 +01:00
Yu Watanabe
4da3315452
test-network: add testcases for handling disable_ipv6 sysctl property
2019-02-21 11:08:07 +09:00
Yu Watanabe
ecdd039246
test-network: update cosmetic workaround
...
Almost all tests call copy_unit_to_networkd_unit_path() at first.
So, let's move the line break there.
2019-02-21 10:55:46 +09:00
Anita Zhang
7ca69792e5
core: add ':' prefix to ExecXYZ= skip env var substitution
2019-02-20 17:58:14 +01:00
Yu Watanabe
2dcaf38020
Merge pull request #11764 from yuwata/network-verify
...
network: introduce network_verify() and drop incompatible settings
2019-02-20 06:13:53 +09:00
Yu Watanabe
0cc972aac3
test-network: add tests for meaningless settings which should be ignored by networkd
2019-02-20 06:12:54 +09:00
Yu Watanabe
71064bd5ac
Merge pull request #11759 from yuwata/fix-test-dropin
...
test-network: check whether ethtool support driver field for dummy interfaces
2019-02-20 06:11:11 +09:00
Yu Watanabe
b1b10691be
Merge pull request #11757 from yuwata/test-udev-continuation
...
test-udev: add more tests for line continuations and comments
2019-02-20 06:10:37 +09:00
Yu Watanabe
232152bcb1
test-network: check whether ethtool support driver field for dummy interfaces
...
Fixes #11758 .
2019-02-19 22:00:06 +09:00
Yu Watanabe
f32c600935
test-network: disable test for Driver field in networkctl
...
CentOS CI does not like the test. Let's at least tentatively disable the test.
2019-02-19 17:39:05 +09:00
Yu Watanabe
fde66c2120
test-network: update format used by networkctl status
2019-02-19 17:38:30 +09:00
Yu Watanabe
d35976c670
test-udev: add more tests for line continuations and comments
2019-02-19 09:22:45 +09:00
Yu Watanabe
e37a5d90b0
test-udev: use proper semantics for too long line with continuation
...
Follow-up for 1e797cf596 .
2019-02-19 09:21:58 +09:00
Lennart Poettering
9c5675af76
Merge pull request #11729 from yuwata/fix-11721
...
sd-device: also store properties read from udev database to sd_device::properties_db
2019-02-18 16:02:26 +01:00
Lennart Poettering
1ff3e129ae
Merge pull request #11746 from yuwata/udev-rules-cleanup
...
udev-rules: several cleanups for udev-rules.c
2019-02-18 13:05:34 +01:00
Lennart Poettering
1cfece4a45
Merge pull request #11681 from yuwata/network-link-enslaved-operstate
...
network: introduce new 'enslaved' operstate
2019-02-18 13:00:13 +01:00
Lennart Poettering
702451b038
Merge pull request #11698 from yuwata/fix-network-route-table
...
network: honor specified route table
2019-02-18 12:58:32 +01:00
Lennart Poettering
31ced79065
Merge pull request #11743 from keszybz/two-memory-fixups
...
Two fixups for issues found by scanners
2019-02-18 12:09:25 +01:00
Yu Watanabe
c3a8853f6e
test-network: add tests for bonding
2019-02-18 18:07:11 +09:00
Yu Watanabe
1e797cf596
test-udev: add a testcase of too long line
2019-02-18 12:22:54 +09:00
Yu Watanabe
b117044c09
test-network: decrease sleep time in test_bind_carrier()
...
This effectively reverts 63eb09569a ,
as the commit does not fix #11724 .
2019-02-18 06:11:50 +09:00
Zbigniew Jędrzejewski-Szmek
ea53cfd195
shared/calendarspec: do not allocate a big string on stack
...
The string can be as long as a logical line in a unit file — so no unlimited,
but quite big. Let's use a normal heap allocation when making a copy.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13125
2019-02-16 23:31:07 +01:00
Yu Watanabe
18c613dc36
test-network: add tests for VRF=
2019-02-17 01:25:21 +09:00
Yu Watanabe
0ae7a66d1a
test-network: add tests for DHCP.RouteTable=
2019-02-17 01:17:40 +09:00
Yu Watanabe
3b51bbe135
test-network: drop unused variable
2019-02-17 01:17:40 +09:00
Yu Watanabe
96fb7dc30f
test-network: add a tiny test for ID_NET_DRIVER= udev property
...
Test for #11721 .
2019-02-17 00:43:38 +09:00
Yu Watanabe
63eb09569a
test-network: increase sleep time in test_bind_carrier()
...
Hopefully fixes #11667 .
2019-02-16 07:22:54 +09:00
Lennart Poettering
84e4b0b893
Merge pull request #11716 from ssahani/drop-autoconf-address
...
networkd: ipv6ra allow to ignore addresses
2019-02-15 12:17:46 +01:00
Lennart Poettering
a0279563d7
Merge pull request #11719 from yuwata/networkctl-wildcards
...
networkctl: accept wildcards to specify links
2019-02-15 11:44:24 +01:00
Lennart Poettering
19df3047f3
Merge pull request #9262 from ssahani/ignore-carrier-9111
...
networkd: allow to retain configs even if carrier is lost
2019-02-15 11:35:43 +01:00
Yu Watanabe
cd65d06720
test-network: add test for BindCarrier=
2019-02-15 11:30:17 +01:00
Yu Watanabe
308ae89c9b
test-network: add tests for wildcards in networkctl
2019-02-15 13:54:28 +09:00
Susant Sahani
24433ffa6d
Add to fuzzer
2019-02-14 21:10:59 +05:30
Zbigniew Jędrzejewski-Szmek
dc9cced4ac
Merge pull request #11704 from yuwata/fix-oss-fuzz-12980
...
udev-rule: make rule_add_key() return negative errno when too much tokens
2019-02-13 23:27:12 +01:00
Yu Watanabe
be18d18bd8
test: add testcase for oss-fuzz#12980
2019-02-13 04:16:30 +09:00
Yu Watanabe
05514ae196
test-network: add tests for LinkLocalAddressing=
2019-02-13 02:36:15 +09:00
Frantisek Sumsal
b35d6d828b
test: replace echo with socat
...
The original version of the test used netcat along with a standard
AF_UNIX socket, which caused issues across different netcat
implementations. The AF_UNIX socket was then replaced by a FIFO with a
simple echo, which, however, suffers from the same issue (some echo
implementations don't check if the write() was successful).
Let's revert back to the AF_UNIX socket, but replace netcat with socat,
which, hopefully, resolves the main issue.
Relevant commit: 9b45c2bf02
2019-02-12 19:45:50 +03:00
Jan Synacek
ed2dc503da
rule-syntax-check: allow PROGRAM as an assignment
2019-02-10 19:06:58 +01:00
Yu Watanabe
b412fce830
test-network: use dnsmasq with --dhcp-alternate-port option to test DHCP.ListenPort=
...
Fixes #11675 .
2019-02-09 23:49:12 +09:00
Yu Watanabe
804b6cd26b
test-network: add testcases for IgnoreCarrierLoss=
2019-02-08 22:00:07 +09:00
Yu Watanabe
e327272d79
test-network: ignore tunnel devices automatically added by kernel
...
Fixes #10934 .
2019-02-06 22:04:32 +09:00
Susant Sahani
93b4dab57e
networkd: Allow to retain configs even if carrier is lost
...
When there is bad link in the network the carrier goes up/down.
This makes networkd stops all the clients and drop config.
But if the remote router/dhcpserver running a prevention
of DHCP Starvation attack or DHCP Flood attack it does not allow
networkd to take a DHCP lease resulting failure in configuration.
This patch allows to keep the client running and keep the conf
also for this scenario.
Closes #9111
2019-02-06 13:35:11 +01:00
Yu Watanabe
d586a2c30c
test-network: check port range and ipproto attributes are supported by kernel and ip command
2019-02-06 10:18:23 +01:00
Yu Watanabe
f5d191a9e7
test-network: add or drop whitespace
2019-02-03 05:27:15 +01:00
Yu Watanabe
3e9d555241
test-network: fix test_dhcp_server() and test_ipv6_prefix_delegation()
...
The tests have been broken since 30d3b54eba .
2019-02-03 04:40:05 +01:00
Taro Yamada
19632f6dbb
test: (ArchLinux) Replace initramfs-linux.img with initramfs-linux-fallback.img.
...
Currently /boot/initramfs-linux.img is used as the default initrd for ArchLinux.
Although, since the kernel modules that are not necessary for the host environment are removed from
initramfs-linux.img by mkinitcpio 's autodetect hook, the kernel modules necessary for qemu may be missing.
(ata_piix, ext4, and so on in my case.)
As a result, the test environment may not be built properly and the test will be failed.
initramfs-linux-fallback.img will skip this autodetect hook, so the test will run successfully in more
environments.
Both initramfs-linux.img and initramfs-linux-fallback.img are generated by default.
2019-02-02 12:45:51 +01:00
Susant Sahani
7bea7f9b57
test-network: skip erspan test if not available
2019-01-30 14:30:59 +01:00
Evgeny Vereshchagin
a19f909b5b
tests: crash PID1 if UBSan is unhappy
...
Now that https://github.com/systemd/systemd/issues/10332 is unlikely to happen
it should be totally fine to try to crash PID1 :-)
2019-01-30 03:16:14 +01:00
Evgeny Vereshchagin
d56db495de
tests: ignore memory leaks in dbus-daemon
...
Otherwise, the test fails on Fedora 28 with
```
Jan 30 01:42:35 systemd-testsuite dbus-daemon[61]: [system] Successfully activated service 'org.freedesktop.systemd1'
Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Kernel keyring access prohibited, ignoring.
Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Executing: /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: =================================================================
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: ==61==ERROR: LeakSanitizer: detected memory leaks
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 72 byte(s) in 1 object(s) allocated from:
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #1 0x7f21f9b1b23c (/lib64/libdbus-1.so.3+0x3323c)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #2 0x240000001b (<unknown module>)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 16 byte(s) in 1 object(s) allocated from:
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #1 0x7f21f9b1b23c (/lib64/libdbus-1.so.3+0x3323c)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #2 0x7ffffffff (<unknown module>)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: SUMMARY: AddressSanitizer: 88 byte(s) leaked in 2 allocation(s).
```
The leaks were reported and fixed in https://bugs.freedesktop.org/show_bug.cgi?id=107320 .
2019-01-30 02:28:40 +01:00
Lennart Poettering
f90bf549f7
Merge pull request #11569 from yuwata/first-step-11307
...
util-lib: warn if address is specified without prefix length
2019-01-29 11:25:55 +01:00