1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00
Commit Graph

1011 Commits

Author SHA1 Message Date
Yu Watanabe
c2990ec39a test-network: move tests related to bonding 2019-03-30 02:27:22 +09:00
Yu Watanabe
b810272594 test-network: merge tests about static addresses
And use wait_online()
2019-03-30 02:27:22 +09:00
Yu Watanabe
5aa58329d8 test-network: add wait_online() helper function 2019-03-30 02:27:16 +09:00
Lennart Poettering
f087c7e072 test: add some basic testing that "systemctl start -T" does something 2019-03-27 12:37:37 +01:00
Yu Watanabe
4d6cd572a7 fuzz: add testcases for the bug in condition_free_list_type() 2019-03-24 00:35:39 +09:00
Zbigniew Jędrzejewski-Szmek
b2645747b7 nspawn-oci: fix double free
Also rename function to make it clear that it also frees the array
object itself.
2019-03-22 17:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
b1f13b0e75 nspawn-oci: mount source is optional 2019-03-22 12:04:32 +01:00
Zbigniew Jędrzejewski-Szmek
9ddd62cda1 fuzz-nspawn-oci: add fuzzer for the oci bundle loader 2019-03-22 11:09:52 +01:00
Yu Watanabe
3f4c9bc04c
Merge pull request #12066 from yuwata/fix-network-tunnel-12041
network: fix netdev_tunnel_verify()
2019-03-22 05:57:38 +09:00
Yu Watanabe
6a97a86489 test-network: add more tests for tunneling devices 2019-03-22 03:31:50 +09:00
Zbigniew Jędrzejewski-Szmek
59b44cc3b1
Merge pull request #12020 from mrc0mmand/test-functions-interactive-debug
test: test-functions improvements for debugging
2019-03-21 18:15:04 +01:00
dana
4890482531 journalctl: support -b all to negate effect of -b
Also fix an issue where -b without argument didn't always behave as -b0
2019-03-19 10:48:26 +01:00
Frantisek Sumsal
5a2114b60e test: improve testsuite configuration documentation 2019-03-16 18:59:07 +01:00
Frantisek Sumsal
b43c2c01e9 test: allow overriding of the KVM detection using TEST_NO_KVM
By default the run_qemu() function enables KVM automatically
if it detects the /dev/kvm char device and if the machine is not
already a KVM one. Let's add a TEST_NO_KVM env variable to suppress
this detection.
2019-03-16 18:59:07 +01:00
Frantisek Sumsal
c81a46b904 test: introduce INTERACTIVE_DEBUG
Make the interactive debugging of (particularly QEMU) machines less
painful, by replacing the default vt220 TERM with linux one, and
by not shutting down the machine after running the test itself.
2019-03-16 18:59:01 +01:00
Frantisek Sumsal
6d67286fc3 test: unify indentation 2019-03-16 15:49:43 +01:00
Lennart Poettering
95658673a0
Merge pull request #12016 from yuwata/fix-two-memleaks-found-by-oss-fuzz
Fix two memleaks found by oss fuzz
2019-03-15 17:33:48 +01:00
Yu Watanabe
c7a67ba5eb fuzz: add testcase for oss-fuzz#13691 2019-03-15 23:54:30 +09:00
Yu Watanabe
5ba40bb2cc fuzz: add a testcase for oss-fuzz#13719 2019-03-15 23:47:41 +09:00
Zbigniew Jędrzejewski-Szmek
054d871d41 test-execute: block /sys not /proc
As explained in the previous commit, blocking /proc can cause us
to go into a long loop or fail the test.
2019-03-15 15:46:41 +01:00
Yu Watanabe
8cc6727a5a test: add a testcase for device plugged -> dead -> plugged bug 2019-03-15 21:16:58 +09:00
Lennart Poettering
9bbd37845c
Merge pull request #11988 from keszybz/test-binaries-installation
Install more requires binaries for tests
2019-03-15 13:06:11 +01:00
Frantisek Sumsal
5b69d297c1 test: use PBKDF2 instead of Argon2 in cryptsetup...
to reduce memory requirements for volume manipulation. Also,
to further improve the test performance, reduce number of PBKDF
iterations to 1000 (allowed minimum).
2019-03-15 10:05:33 +01:00
Frantisek Sumsal
32983312ed test: bump the second partition size to 50MB
10MB is not enough for a LUKS2 partition.
2019-03-15 06:12:23 +01:00
Zbigniew Jędrzejewski-Szmek
98b0439f08 tests: install /usr/bin/dbus-broker when using dbus-broker
We'd install the service file, and then dbus-broker-launcher because it is
mentioned in ExecStart=, but not the main executable, so nothing would work.
Let's just install dbus-broker executables if found. They are small, so this
doesn't matter much, and is much easier than figuring the exact conditions
under which dbus-broker will be used instead of dbus-daemon.
2019-03-14 15:52:38 +01:00
Yu Watanabe
cff83db917 test-network: add tests for L2TP 2019-03-14 11:12:32 +09:00
Susant Sahani
3a56e697c8 networkd: Introduce l2tp tunnel
This works allows networkd to configure l2tp tunnel.
See http://man7.org/linux/man-pages/man8/ip-l2tp.8.html
2019-03-14 10:57:41 +09:00
Frantisek Sumsal
0ae4456c93 test: avoid double-fsck'ing of the rootfs on Arch
Since systemd 206 the combination of systemd and mkinitcpio
causes, under certain conditions, the rootfs to be double fsck'd.

Symptoms:
```
:: performing fsck on '/dev/sda1'
systemd: clean, 3523/125488 files, 141738/501760 blocks
********************** WARNING **********************
*                                                   *
*  The root device is not configured to be mounted  *
*  read-write! It may be fsck'd again later.        *
*                                                   *
*****************************************************
<snip>
[  OK  ] Started File System Check on Root Device
```

This occurs when neither 'ro' or 'rw', or only 'ro' is present
on the kernel command line. The solution is to mount the roofs
as read-write on the kernel command line, so systemd knows to not fsck
it again.
2019-03-13 17:05:31 +01:00
Zbigniew Jędrzejewski-Szmek
1e46047066 tests: install "head" in the image
For #11915.
2019-03-13 16:35:23 +01:00
Tobias Jungel
7f15b71460 networkd: Add bridge port capabilities
This PR adds the configuration switches for multicast flooding, neighbor
suppression and learning of a bridge port.
2019-03-13 16:27:22 +01:00
Frantisek Sumsal
3f50fff536 test: don't overwrite TESTDIR if already set 2019-03-13 10:30:25 +01:00
Lennart Poettering
96c45cc697
Merge pull request #11861 from yuwata/network-verify-2
network: config parser updates and wireguard refactoring
2019-03-13 10:15:27 +01:00
Lennart Poettering
3cca6cfd41
Merge pull request #11893 from yuwata/wait-online-take-operstate
wait-online: optionally take required minimum operational state
2019-03-13 10:10:43 +01:00
Yu Watanabe
c9cc038343 network: introduce 'degraded-carrier' operstate to order all states
Previously, 'degraded' state is ambiguous for bonding or bridge master:
1. one or more slave interfaces does not have carrier,
2. no link local address is assigned to the master,
3. combination of the above two.

This makes the above case 1 and 3 are in the new 'degraded-carrier'
state, and makes 'degraded' state as all slaves are active but no
link local address on master.
2019-03-13 14:29:00 +09:00
Yu Watanabe
4ddbf08cfd test-network: wait more and fix wrong operational state
Closes #11977.
2019-03-13 14:27:39 +09:00
Yu Watanabe
39bcff3bca test-network: add test for WireGuard.PrivateKeyFile= 2019-03-13 12:02:08 +09:00
Yu Watanabe
76df77794a wireguard: add PrivateKeyFile= option
Closes #11878.
2019-03-13 12:02:03 +09:00
Yu Watanabe
bbb5aebe3e test-network: add tests for invalid Address sections 2019-03-13 11:59:18 +09:00
Yu Watanabe
7e46b29bd3 test: add a testcase for ProtectHome=tmpfs vs ProtectSystem=strict 2019-03-13 11:53:59 +09:00
Davide Cavalca
1485aacb16 meson: scope more git invocations with current_source_dir() 2019-03-12 15:01:47 +01:00
Zbigniew Jędrzejewski-Szmek
ec637f309f
Merge pull request #11943 from yuwata/device-action-seqnum-cleanups
sd-device: store parsed SEQNUM and ACTION string
2019-03-12 13:17:33 +01:00
Zbigniew Jędrzejewski-Szmek
a729e42d4b
Merge pull request #11897 from mrc0mmand/parallelize-TEST-24-UNIT-TESTS
test: parallelize tasks in TEST-24-UNIT-TESTS
2019-03-12 11:21:06 +01:00
Yu Watanabe
7905e6d70e test: wait for a while active state of .device is updated 2019-03-12 09:49:58 +09:00
Lennart Poettering
35d3a35e56
Merge pull request #11960 from mrc0mmand/more-fuzzers
fuzz: introduce more fuzzers
2019-03-11 18:04:22 +01:00
Clemens Gruber
c423be28a0 network: introduce TripleSampling= option in CAN section
When enabled, three samples are used to determine the value of a
received bit by majority rule.

This patch adds support for the TripleSampling= option in the [CAN]
section of .network files.
2019-03-11 17:15:47 +01:00
Yu Watanabe
7f45d738a6 test-network: add tests for issue #11921 2019-03-11 15:29:19 +01:00
Frantisek Sumsal
ea1cdaf262 fuzz: add a memleak reproducer for fuzz-nspawn-settings 2019-03-11 14:13:09 +01:00
Frantisek Sumsal
b5b499b32c fuzz: add nspawn-settings fuzzer 2019-03-11 14:13:00 +01:00
Frantisek Sumsal
18d51b4509 fuzz: add env-file fuzzer 2019-03-11 14:11:28 +01:00
Frantisek Sumsal
5bfb2a93a4 test: try to determine QEMU_SMP dynamically
If the QEMU_SMP value has not been explicitly set, try to determine it
from the number of online CPUs using the nproc utility. If this approach
fails, fall back to the default value QEMU_SMP=1.

This change should significantly help when running integration tests
under QEMU on multicore systems.
2019-03-08 21:28:26 +01:00
Yu Watanabe
1ec38b8574 test: add test for ID_RENAMING= udev property handling by pid1 2019-03-07 17:28:19 +09:00
Frantisek Sumsal
2f2a0454ef test: parallelize tasks in TEST-24-UNIT-TESTS 2019-03-06 10:23:19 +01:00
Zbigniew Jędrzejewski-Szmek
f27abfccd0 fuzz-dns-packet: add test case with lots of labels
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13422
2019-03-04 15:53:37 +01:00
Lennart Poettering
46d4d67d79
Merge pull request #11820 from dm0-/chase
Allow tmpfiles to create files in a root under an unprivileged directory
2019-03-04 13:04:45 +01:00
Yu Watanabe
26bf9c302d test-network: add tests for address pool 2019-03-01 16:34:55 +09:00
David Michael
8595c4588c TEST-22: add test for unprivileged dirs in root prefixes
This verifies the fix for the issue described in:
https://github.com/systemd/systemd/pull/11820
2019-02-28 13:06:07 -05:00
Zbigniew Jędrzejewski-Szmek
2fe4c28d30
Merge pull request #11834 from martinpitt/network-test-fixes
networkd-test fix/improvement
2019-02-28 17:48:41 +01:00
Yu Watanabe
af3b1498c6 test-network: add testcase for #1850 2019-02-28 10:34:27 +09:00
Yu Watanabe
9cb8c55934 network: rename GatewayOnlink= to GatewayOnLink=
But still GatewayOnlink= is supported for backward compatibility.
2019-02-28 10:00:22 +09:00
Martin Pitt
09b8826ea3 networkd-test: ignore failures of test_route_only_dns* in containers
This test exposes a race condition when running in LXC, see issue #11848
for details. Until that is understood and fixed, skip the test as it's
not a recent regression.
2019-02-27 23:15:31 +01:00
Martin Pitt
829c0672e0 networkd-test: specify Address= with prefix length
This avoids a warning:

    An address '192.168.42.100' is specified without prefix length. The
    behavior of parsing addresses without prefix length will be changed
    in the future release. Please specify prefix length explicitly.
2019-02-27 22:53:57 +01:00
Martin Pitt
74c13b7659 networkd-test: show service journal on startup failure
This provides easier evaluation of failed tests.
2019-02-27 22:53:57 +01:00
Lennart Poettering
dc16327c48
Merge pull request #11795 from yuwata/fix-network-routing-policy-11280
network: fix routing policy rule issue #11280
2019-02-27 18:43:56 +01:00
Lennart Poettering
200fb167a2
Merge pull request #11844 from keszybz/networkd-fuzzer-fixes
Networkd fuzzer fixes
2019-02-27 17:45:55 +01:00
Zbigniew Jędrzejewski-Szmek
c448459d56 networkd: refuse more than 128 NTP servers
This test case is a bit silly, but it shows that our code is unprepared to
handle so many network servers, with quadratic complexity in various places.
I don't think there are any valid reasons to have hundres of NTP servers
configured, so let's just emit a warning and cut the list short.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13354
2019-02-27 14:52:33 +01:00
Zbigniew Jędrzejewski-Szmek
83ec459276 networkd: fix memleak when the same NetDev is specified twice
hashmap_put() returns 0 if the (key, value) pair is already present in the
hashmap, and -EEXIST if the key exists, but the value is different.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13433
2019-02-27 14:31:28 +01:00
Yu Watanabe
b677774d69 test-network: add testcase for issue #11280 2019-02-27 19:24:13 +09:00
Yu Watanabe
703bc7a2a6 test-network: drop relevant ip routing policy rules before testing 2019-02-27 19:23:46 +09:00
Yu Watanabe
72b7f1b976 test-network: add test for MTUBytes= in vlan or macvlan devices 2019-02-27 10:05:02 +09:00
Lennart Poettering
f3892edd5e
Merge pull request #11824 from keszybz/fuzzer-fixes
Fuzzer fixes
2019-02-26 19:02:12 +01:00
Lennart Poettering
8c28360a21
Merge pull request #11823 from keszybz/more-fuzz-coverage
More fuzz coverage
2019-02-26 17:21:32 +01:00
Zbigniew Jędrzejewski-Szmek
92e068b465 basic/utf8: do not read past end of string when looking for a multi-byte character
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9341.
2019-02-26 12:37:40 +01:00
Yu Watanabe
10f6188b67 fuzz: add a sample for fuzz-udev-database 2019-02-26 13:28:30 +09:00
Lennart Poettering
510dc4da13
Merge pull request #11767 from yuwata/network-bridge-enslaved
network: extend 'enslaved' state to bridge slave
2019-02-25 19:29:30 +01:00
Zbigniew Jędrzejewski-Szmek
4c4589227e fuzz-unit-file: add some directives for stuff coverage reports as not covered
Some of those directives appear in the corpus, but without arguments, so maybe
the fuzzing libraries can't trigger the right cases. Let's help them.
2019-02-25 15:46:23 +01:00
Yu Watanabe
eac31d708f fuzz: add directives.link and 99-default.link for fuzz-link-parser
Also adds several reproducers of errors fixed in earlier commits.
2019-02-25 12:40:42 +09:00
Yu Watanabe
6609924c32 test-network: add more tests for IgnoreCarrierLoss=
Suggested by @amishmm in #9262.
2019-02-25 09:34:14 +09:00
Yu Watanabe
2be6c5d2ec test-network: add more tests for Bridge= 2019-02-25 09:34:14 +09:00
Yu Watanabe
cc3e488c7d test-network: testing with two bond slaves 2019-02-23 19:43:25 +09:00
Yu Watanabe
3dd2d52414 test-udev: fix alignment and drop unnecessary white spaces 2019-02-22 06:50:21 +09:00
Yu Watanabe
84a0819c9d test-udev: add more tests for line continuation 2019-02-22 06:50:20 +09:00
Lennart Poettering
953a1af082
Merge pull request #11776 from keszybz/networkd-ordered-sets
Store domains lists in OrderedSets in networkd
2019-02-21 15:15:11 +01:00
Martin Pitt
f5cf985e9c networkd-test: fix test_dropin()
- This test needs resolved, so make sure it is started. In some Debian
   environments it is not.
 - It was an unnecessary, and now failing assumption that name servers
   get atomically written to the resolved's resolv.conf. Wait until both
   expected name servers are in the file.
2019-02-21 12:37:08 +01:00
Martin Pitt
ca56805c8d networkd-test: use a complete domain name in test_route_only_dns()
Since version 241 (commit ea4678?), querying MX type records for
single-label domains does not actually forward the query to the DNS
server any more. Use "example.com" instead, which is the recommended
test domain anyway.
2019-02-21 12:37:08 +01:00
Martin Pitt
6592c9c850 networkd-test: disable DNSSEC in domain-restricted DNS test
dnsmasq 2.80 changed behaviour when being queried by resolved with
enabled DNSSEC: It returns errors for SOA and DS queries which cause the
entire query to fail. As we don't configure DNSSEC in this test anyway,
just disable it so that we retain compatibility with old and new dnsmasq
versions.
2019-02-21 12:37:06 +01:00
Zbigniew Jędrzejewski-Szmek
95b2903bde tests: shorten the fuzz test case
The test was failing in Ubuntu CI with a 30s timeout. It makes
sense to keep the file so exercise the set allocation logic, but
we can make it shorter.
2019-02-21 12:30:13 +01:00
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
Yu Watanabe
0b5245a2ee test-network: set missing prefixlen 2019-01-29 07:36:35 +01:00
Yu Watanabe
16ab043bda test-network: add more checks in NetworkdNetDevTests.test_wireguard 2019-01-28 10:10:15 +01:00
Lennart Poettering
7c45deb20d
Merge pull request #11460 from yuwata/fix-11458
network: update address when static address was already configured by DHCP
2019-01-26 15:41:06 +01:00
Dimitri John Ledkov
9a2e265bb0
test/test-functions: on PPC64 use hvc0 console 2019-01-26 00:21:08 +00:00
Dimitri John Ledkov
eaa602cb14
test/test-functions: on PP64 use vmlinux
At least on Ubuntu, ppc64el uses vmlinux-, not vmlinuz. With this, it should be
possible to run qemu tests on ppc64el as part of Ubuntu autopkgtests.
2019-01-26 00:21:07 +00:00
Frantisek Sumsal
e4e039bce4 test: mark plymouth as optional dependency
rescue.service pulls in /bin/plymouth, which doesn't exist on some
distributions (e.g. Arch Linux). Let's mark it as optional, as it's not
even required by the referencing unit and causes unwanted fails in the
integration testsuite.
2019-01-21 11:35:24 +01:00
Frantisek Sumsal
bb0e960448 meson: bump timeout for test-udev to 180s
On some (mainly virtual) machines the last test takes more than 30
seconds, which causes unnecessary fails, as the test itself is working
properly.
2019-01-21 11:33:54 +01:00
Lennart Poettering
a8ea2833cf
Merge pull request #11375 from daxtens/issue5882
network: Fix IPv6 PreferredSource routes
2019-01-17 18:08:01 +01:00
Yu Watanabe
30d3b54eba test: add a testcase for #11458 2019-01-17 15:38:17 +09:00
Daniel Axtens
20ca06a669 tests: Add test for IPv6 source routing
The test is a bit messy because it must be done on a device that
enforces a tentative state for IPv6 addresses, and it appears
that the dummy device does not. So we use a bond instead.

Signed-off-by: Daniel Axtens <dja@axtens.net>
2019-01-16 12:54:06 +11:00
Zbigniew Jędrzejewski-Szmek
29a93cb19d
Merge pull request #11418 from yuwata/fix-11404
network: fix infinite loop in setting up wireguard
2019-01-15 21:04:32 +01:00
Zbigniew Jędrzejewski-Szmek
477fd8e886
Merge pull request #11345 from kirbyfan64/tmpfiles-c-empty
tmpfiles: Make C still copy if the destination directory is empty
2019-01-15 16:54:19 +01:00
Yu Watanabe
7e6636196a test: add a testcase for Address.Peer= with ipv6
Testcase for #9130.
2019-01-15 07:37:15 +09:00
Yu Watanabe
da44fb8a72 test: add a testcase for 23 wirguard peers 2019-01-14 10:08:58 +09:00
Frantisek Sumsal
d7283fc157 test: limit environments for systemd-hwdb-update under ASan 2019-01-12 11:44:39 +01:00
Frantisek Sumsal
5b2172ee50 test: bump QEMU_SMP to 4 when running under ASan/UBSan 2019-01-12 11:38:21 +01:00
Frantisek Sumsal
670bec2b07 test: bump QEMU memory to 1536M when running under ASan/UBSan 2019-01-12 11:38:21 +01:00
Frantisek Sumsal
3071b3ff6e test: introduce QEMU_MEM
Some tests (mainly under ASan/UBSan) require more than 512M of memory,
so let's make it configurable (but still default to 512M).
2019-01-11 16:23:53 +01:00
Frantisek Sumsal
e47df8232a test: drop service masking in TEST-01-BASIC
This test should ensure all systemd starts correctly, so masking them is
counter-productive in this case.
2019-01-11 13:45:08 +01:00
Ryan Gonzalez
55b25c43ff test: Add tests for tmpfiles C behavior 2019-01-08 14:30:15 -06:00
Yu Watanabe
c226800996
Merge pull request #11232 from yuwata/fix-9130-alternative
network: always check link is ready when address is updated
2019-01-08 12:22:21 +09:00
Frantisek Sumsal
4a2c3dc318
Merge pull request #11252 from evverx/use-asan-wrapper-on-travis-ci
travis: run PID1, journald and everything else under ASan+UBsan
2019-01-06 18:48:38 +01:00
Chris Down
4e1dfa45e9 cgroup: s/cgroups? ?v?([0-9])/cgroup v\1/gI
Nitpicky, but we've used a lot of random spacings and names in the past,
but we're trying to be completely consistent on "cgroup vN" now.

Generated by `fd -0 | xargs -0 -n1 sed -ri --follow-symlinks 's/cgroups?  ?v?([0-9])/cgroup v\1/gI'`.

I manually ignored places where it's not appropriate to replace (eg.
"cgroup2" fstype and in src/shared/linux).
2019-01-03 11:32:40 +09:00
Yu Watanabe
6f783ce5f5 test-network: disable DNS function of dnsmasq 2019-01-02 18:37:10 +09:00
Yu Watanabe
0532bd0883 test-network: drop unused variable 2019-01-02 18:37:10 +09:00
Yu Watanabe
094b54790f test: fix neighbor address 2019-01-02 18:37:10 +09:00
Evgeny Vereshchagin
0d6e61d6a1 tests: introduce check_asan_reports and use it in check_result_{qemu|nspawn} 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
ed4f303f39 tests: look for ASan+UBSan reports in the journal 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
9688fccc27 tests: double DefaultTimeoutStartSec when systemd is run under ASan+UBSan 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
082bcdca2c tests: overwrite a hard-coded timeout in systemd-hwdb-update.service 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
998445fd8a tests: fail if asan has found issues in journald 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
7e11a95e41 tests: reproduce https://github.com/systemd/systemd/issues/11251 2018-12-29 19:14:28 +01:00
Evgeny Vereshchagin
9103671d7c test: don't run TEST-01-BASIC in unprivileged containers on Travis CI 2018-12-24 08:52:33 +01:00
Evgeny Vereshchagin
b4a450d85f tests: use systemd-journald to check whether everything has been built with ASan 2018-12-24 08:52:33 +01:00
Yu Watanabe
ac60877f1d test: add a testcase for Address.Peer= in .network unit 2018-12-23 08:04:54 +09:00
Patrick Williams
8eab766804 core: support %j in unit dependency resolution
Commit 250e9fadbc introduced
support for %j/%J specifier in unit files.  The function
unit_name_printf is used in unit dependency resolution,
such as Wants / After directives, but was missing support
for the %j.  Add to allow directives such as:

    [Unit]
    Wants=bar-%j.target

Fixes: systemd/systemd#11217
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2018-12-22 17:21:13 +09:00
Lennart Poettering
7ece6f5897 networkd: permit DNS "DefaultRoute" configuration in .network files 2018-12-21 12:10:07 +01:00
Lennart Poettering
1750854916 resolved: bind .local domains to mDNS with DNS_SCOPE_YES, similar LLMNR
Previously, we'd return DNS_SCOPE_MAYBE for all domain lookups matching
LLMNR or mDNS. Let's upgrade this to DNS_SCOPE_YES, to make the binding
stronger.

The effect of this is that even if "local" is defined as routing domain
on some iface, we'll still lookup domains in local via mDNS — if mDNS is
turned on. This should not be limiting, as people who don't want such
lookups should turn off mDNS altogether, as it is useless if nothing is
routed to it.

This also has the nice benefit that mDNS/LLMR continue to work if people
use "~." as routing domain on some interface.

Similar for LLMNR and single label names.

Similar also for the link local IPv4 and IPv6 reverse lookups.

Fixes: #10125
2018-12-21 11:41:45 +01:00
Frantisek Sumsal
67f5c0c776 tests: explicitly enable user namespaces for TEST-13-NSPAWN-SMOKE 2018-12-21 05:19:37 +09:00
Susant Sahani
fde60a424e netdev bond: add support to configure tlb_dynamic_lb
Closes https://github.com/systemd/systemd/issues/11135

Add test for bond : tlb_dynamic_lb
2018-12-15 18:15:16 +05:30
Alexey Bogdanenko
dbfbc6c4e3 udev-test: check if permitted to create block device nodes 2018-12-11 16:55:34 +03:00
Evgeny Vereshchagin
ba958bb18b
Merge pull request #11099 from abogdanenko/udev-test-fix-missing-dir
udev-test: fix skip condition and missing directory test/run
2018-12-11 14:48:29 +03:00
Zbigniew Jędrzejewski-Szmek
3bf72311c8
Merge pull request #11084 from poettering/networkd-test-fix
unbreak networkd-test.py
2018-12-11 11:37:05 +01:00
Lennart Poettering
8f3fd07ac0
Merge pull request #11105 from keszybz/path-parsing
Some tightening of our path parsing code
2018-12-10 15:50:08 +01:00
Zbigniew Jędrzejewski-Szmek
a5dfc36ce6 fuzz-unit-file: add one more test case
There seems to be no error per se. RequiresMountsFor=%s%s%s..%s%s%s is expanded to
RequiresMountsFor=/bin/zsh/bin/zsh/bin/zsh/bin/zsh/..., which takes a bit of time,
and then we iterate over this a few times, creating a hashmap with a hashmap
for each prefix of the path, each with one item pointing back to the original unit.
Takes about 0.8 s on my machine.
2018-12-10 11:57:26 +01:00
William A. Kennington III
e4a71bf36f networkd: Static neighbor support
When using networkd we currently have no way of ensuring that static
neighbor entries are set when our link comes up. This change adds a new
section to the network definition that allows multiple static neighbors
to be set on a link.
2018-12-09 16:56:37 -08:00
Alexey Bogdanenko
1e5548c0e0 udev-test: fix missing directory test/run
Fixes the following error:

    Failed to mount test /run: No such file or directory

By the time command "./test-udev check" calls function "fake_filesystems",
directory "test/run" must be present.
2018-12-09 20:53:11 +03:00
Alexey Bogdanenko
7935dae547 udev-test: fix test skip condition
When there is a failure to setup the environment, the following happens:

1. Command "./test-udev check" exits with non-zero code.
2. Perl function "system" returns the code.
3. The code is evaluated as true by Perl.

Then we stop the test.
2018-12-09 19:22:47 +03:00
Lennart Poettering
bf246ba00e networkd-test: add mkosi snippet for building and running networkd-tets.py in a network namespaced container
This provides us with an easy command line to test this script. Because
the test was so difficult to get running noone ever did, hence it broke
badly quickly. Let's fix that.
2018-12-07 12:25:24 +01:00
Lennart Poettering
0373fc5b6f networkd-test: change test_transient_hostname_with_static to use an explicit static hostname
Previously, the test would use the existing static hostname. However,
this woud not work as expected in the static hostname was "localhost"
because the transient hostname will override the static one in that case
anyway, as the assumption hostnamed makes is that "localhost" is a
non-initialized hostname.

Hence when testing this, let's first set the static hostname to
something specific first (that is not "localhost").
2018-12-07 12:25:24 +01:00
Lennart Poettering
8e0ba0c984 networkd-test: restart hostnamed after reverting /etc/hostname too
Otherwise hostnamed will not report the right data in the next test
2018-12-07 12:25:24 +01:00
Lennart Poettering
fef740aed3 networkd-test: add write_config()
The call was removed in ec89276c2a, but is
still used. Not sure why noone noticed this.
2018-12-07 12:25:24 +01:00
Lennart Poettering
ff7507295d networkd-test: set right access modes for /run/systemd/netif
Otherwise networkd isn't happy.

Let's also make addition of the "systemd-network" non-fatal. The user
exists on many machines anyway, hence it shouldn't fail if it already
exists.
2018-12-07 12:25:24 +01:00
Yu Watanabe
131717cbb4 test-network: make search_words_in_file() hit multi words 2018-12-06 16:48:42 +01:00
Yu Watanabe
e4eacdb09f test-network: delete rules before running next test 2018-12-06 16:48:42 +01:00
Yu Watanabe
fa7cd60281 test-network: add a line break after starting networkd
This may be ugly. But otherwise, outputs of several check commands
are shown without new line...
2018-12-06 16:48:42 +01:00
Yu Watanabe
e40a58b5bc test-network: check link before starting dnsmasq 2018-12-06 16:48:42 +01:00
Yu Watanabe
14ecd604a4 test-network: show command outputs 2018-12-06 16:48:41 +01:00
Yu Watanabe
a9bc5e370e test-network: sort imported modules 2018-12-06 16:48:41 +01:00
Yu Watanabe
09ea6724e7 test-network: sort links and units 2018-12-06 16:48:41 +01:00
Yu Watanabe
14dc033574 test-network: fix typo in class name 2018-12-06 16:48:41 +01:00
Yu Watanabe
801503d22b
Merge pull request #10988 from ssahani/IFLA_BRPORT_MCAST_TO_UCAST
networkd: bridge add support to configure multicast_to_unicast
2018-12-06 14:32:52 +01:00
Susant Sahani
4d7ed14f9f test-network: add test for bridge MulticastToUnicast 2018-12-06 11:54:14 +05:30
Susant Sahani
efecf9cd15 test-network: Add test for invert RPDB rule 2018-12-06 11:00:36 +05:30