Commit graph

1563 commits

Author SHA1 Message Date
Dan Streetman fd372b1a68 test-network: in wait_online() allow a few seconds to reach setup_state 2019-12-05 17:53:03 -05:00
Dan Streetman befd4b8b60 test-network: read link attribute at any depth 2019-12-05 17:50:15 -05:00
Dan Streetman 9dfc1a9339 test-network: allow specifying only individual drop-in files 2019-12-05 17:50:10 -05:00
Yu Watanabe 0ab9279132 test-network: add a test case for SFQ 2019-12-04 20:58:33 +09:00
Susant Sahani 9942b71089 network: tc introduce sfq - Stochastic Fairness Queueing
Stochastic Fairness Queueing is a classless queueing discipline.
SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'.
The goal is to ensure fairness so that each flow is able to send data in turn,
thus preventing any single flow from drowning out the rest.
2019-12-04 20:58:17 +09:00
Yu Watanabe 1b628c4f64 test-network: add test case for TBF 2019-12-04 20:57:48 +09:00
Susant Sahani ba5841b520 networkd tc: introduce tbf
See https://linux.die.net/man/8/tc-tbf
2019-12-04 20:55:48 +09:00
Zbigniew Jędrzejewski-Szmek 46c41478c9 tree-wise: standarize on "auto-detection" spelling 2019-11-30 17:42:13 +01:00
Lennart Poettering 5bb4503d3a test-functions: make sure we use the right library path for binaries without RPATH
Meson appears to set the rpath only for some binaries it builds, but not
all. (The rules are not clear to me, but that's besides the point of
this commit).

Let's make sure if our test script operates on a binary that has no
rpath set we fall back preferably to the BUILD_DIR rather than directly
to the host.

This matters if a test uses a libsystemd symbol introduced in a version
newer than the one on the host. In that case "ldd" will not work on the
test binary if rpath is not set. With this fix that behaviour is
corrected, and "ldd" works correctly even in this case.

(Or in other words: before this fix on binaries lacking rpath we'd base
dependency info on the libraries of the host, not the buidl tree, if
they exist in both.)
2019-11-28 09:20:40 +01:00
Zbigniew Jędrzejewski-Szmek 83dbb4df99 fuzz-unit-file: add new items to the corpus 2019-11-25 14:02:58 +01:00
Lennart Poettering 4e67759960 core: be more lenient when checking whether sandboxing is necessary
In some containers unshare() is made unavailable entirely. Let's deal
with this that more gracefully and disable our sandboxing of services
then, so that we work in a container, under the assumption the container
manager is then responsible for sandboxing if we can't do it ourselves.

Previously, we'd insist on sandboxing as soon as any form of BindPath=
is used. With this change we only insist on it if we have a setting like
that where source and destination differ, i.e. there's a mapping
established that actually rearranges things, and thus would result in
systematically different behaviour if skipped (as opposed to mappings
that just make stuff read-only/writable that otherwise arent').

(Let's also update a test that intended to test for this behaviour with
a more specific configuration that still triggers the behaviour with
this change in place)

Fixes: #13955

(For testing purposes unshare() can easily be blocked with
systemd-nspawn --system-call-filter=~unshare.)
2019-11-20 12:30:04 +01:00
Lennart Poettering b82e818f5c test: make sure our tests get exclusive TTY access
This sould make our test suite a bit more robust if it is slow running.
A few of our test services use StandardOutput=tty or StandardError=tty
in the tests in order to connect test services to the container console.
This gets into conflict with the container getty which wants exclusive
access to the console. Since the container getty is started with
Type=idle it typically gets started after a timeout only if the TTY is
already used, which hence introduces a race: if the test finishes
earlier all is good, if not, then the test gets kicked off the TTY which
then causes bash to abort since it cannot write any error messages
anymore.

Let's fix this hence: all tests that connect to the tty are now
synchronized to getty-pre.target, so they finish before any getty is
started.
2019-11-20 09:39:54 +01:00
Yu Watanabe d8b736bd0c network: rename SendRawOption= to SendOption=
As DHCPv4.SendOption= and DHCPServer.SendRawOption= take the same
format.
2019-11-18 23:35:48 +09:00
Lennart Poettering 8af381679d
Merge pull request #13940 from keur/protect_kernel_logs
Add ProtectKernelLogs to systemd.exec
2019-11-15 16:26:10 +01:00
Filipe Brandenburger 14e0259b49 test: Disable LUKS devices from initramfs in QEMU tests
We currently use the host's kernel and initramfs in our QEMU tests.

If the host is running on an encrypted LUKS partition, then the initramfs
will have a crypttab setup looking for the particular root disk it needs to
encrypt before booting into the system.

However, this disk obviously doesn't exist in our QEMU VM, so it turns out
our tests end up waiting for this device to become available, which will
never actually happen, and boot hangs for 90s until that service times out.

[***   ] A start job is running for /dev/disk/by-uuid/01234567-abcd-1234-abcd-0123456789ab (20s / 1min 30s)

In order to prevent this issue, let's pass "rd.luks=0" to disable LUKS in
the initramfs only as part of our default kernel command-line in our QEMU
tests.

This is enough to disable this behavior and prevent the timeout, while at
the same time doesn't conflict with our tests that actually check for LUKS
behavior in the systemd running under test (such as TEST-02-CRYPTSETUP).

Tested: `sudo make -C TEST-02-CRYPTSETUP/ clean setup run`
2019-11-13 19:55:18 -08:00
Kevin Kuehler 07cab0f72b tests: Add capability tests for ProtectKernelLogs 2019-11-11 12:12:02 -08:00
Anita Zhang 3e1db806b0 core: change top-level drop-in from -.service.d to service.d
Discussed in #13743, the -.service semantic conflicts with the
existing root mount and slice names, making this feature not
uniformly extensible to all types. Change the name to be
<type>.d instead.

Updating to this format also extends the top-level dropin to
unit types.
2019-11-07 08:34:53 +01:00
Yu Watanabe c631c3d6a3
Merge pull request #13939 from yuwata/network-fix-memleak-and-13938
network: fix memleak and invalid free function
2019-11-05 20:16:06 +09:00
Lorenz Bauer 09d0b46ab6 journal: refresh cached credentials of stdout streams
journald assumes that getsockopt(SO_PEERCRED) correctly identifies the
process on the remote end of the socket. However, this is incorrect
according to man 7 socket:

    The returned  credentials  are  those that were in effect at the
    time of the call to connect(2) or socketpair(2).

This becomes a problem when a new process inherits the stdout stream
from a parent. First, log messages from the child process will
be attributed to the parent. Second, the struct ucred used by journald
becomes invalid as soon as the parent exits. Further sendmsg calls then
fail with ENOENT. Logs for the child process then vanish from the journal.

Fix this by using recvmsg on the stdout stream, and refreshing the cached
struct ucred if SCM_CREDENTIALS indicate a new process.

Fixes #13708
2019-11-05 10:41:03 +01:00
Yu Watanabe c1ed516cde test: add testcase for issue #13938 2019-11-05 10:49:07 +09:00
Dan Streetman 426654d728 test-network: Remove/replace non-capturing group regex
The systemd-networkd-tests.py has some regex that uses non-capturing
groups, but there is no need to use that with assertRegex; the
groups aren't referenced so it doesn't matter if it's capturing or
non-capturing.  However, there are a few places where optional groups
should have been used instead, so this changes that.

Specifically, groups like this:
(?:whatever |)
should actually be:
(whatever )?

Additionally, this is specifically needed for these tests to run on
Debian systems, because this assertRegex:
'Link File: (?:/usr)/lib/systemd/network/99-default.link'
needs to be:
'Link File: (/usr)?/lib/systemd/network/99-default.link'
2019-11-01 12:32:49 -04:00
Dan Streetman 7471bcb06e test: check /usr/lib and /lib for systemd binaries
Fedora uses /usr/lib while Debian uses /lib; find the right location
2019-11-01 12:00:57 -04:00
Dan Streetman 856423f14d test/test-network/systemd-networkd-tests.py: suppress stderr for functionality checks 2019-11-01 12:00:53 -04:00
Susant Sahani b9c5aa3c65 qdisc: netem add support to duplicate packets.
using this option the chosen percent of packets is duplicated before
queuing them
2019-10-31 10:36:28 +01:00
Susant Sahani 564ca98484 networkd: dhcp server Support Vendor specific 43
Implementes https://tools.ietf.org/html/rfc2132

```
[DHCPServer]
SendRawOption=26:uint32:1400
SendRawOption=23:uint8:10

```
Frame 448: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11
User Datagram Protocol, Src Port: 67, Dst Port: 68
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x71f8de9d
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 192.168.5.11
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (3600s) 1 hour
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 192.168.5.1
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 192.168.5.1
    Option: (42) Network Time Protocol Servers
        Length: 4
        Network Time Protocol Server: 192.168.5.1
    Option: (101) TCode
        Length: 13
        TZ TCode: Europe/Berlin
    Option: (43) Vendor-Specific Information
        Length: 9
        Value: 1701311a0431343030
    Option: (54) DHCP Server Identifier (192.168.5.1)
        Length: 4
        DHCP Server Identifier: 192.168.5.1
    Option: (255) End
        Option End: 255

```
2019-10-31 09:03:43 +09:00
Zbigniew Jędrzejewski-Szmek 864edb39cf network: rename SendOptions= to SendOption=
The name with plural made more sense where multiple options could be specified
in one line. After changes in the pull request, this option only accepts one
value, so from users' POV it should be singular.

(The field in the data structure remains plural, because it actually stores
multiple values.)
2019-10-30 08:56:18 +01:00
Yu Watanabe ef3c8a92b7 test-network: add tests for qdisc 2019-10-30 09:33:51 +09:00
Susant Sahani 0f5bd7fe24 network: introduce TrafficControl
Add network delay to a interface
2019-10-30 09:33:51 +09:00
Zbigniew Jędrzejewski-Szmek a5f6f346d3
Merge pull request #13423 from pwithnall/12035-session-time-limits
Add `RuntimeMaxSec=` support to scope units (time-limited login sessions)
2019-10-28 14:57:00 +01:00
Philip Withnall 9ed7de605d scope: Support RuntimeMaxSec= directive in scope units
Just as `RuntimeMaxSec=` is supported for service units, add support for
it to scope units. This will gracefully kill a scope after the timeout
expires from the moment the scope enters the running state.

This could be used for time-limited login sessions, for example.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #12035
2019-10-28 09:44:31 +01:00
Yu Watanabe 78404d22cc network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
Zbigniew Jędrzejewski-Szmek 1048436869
Merge pull request #13452 from yuwata/network-reload
network: add networkctl reload and reconfigure
2019-10-24 11:07:24 +02:00
Yu Watanabe 235ecb6d75 test: drop duplicated 's'
This fixes the following log message
```
Container TEST-07-ISSUE-1981 terminated by signal KILL.
E: test timed out after 30s s
```
2019-10-24 08:39:31 +02:00
Yu Watanabe dcd9f07ccf network: add tests for "networkctl reconfigure" 2019-10-24 14:23:17 +09:00
Yu Watanabe 66de86712c test-network: add tests for "networkctl reload" 2019-10-24 14:20:48 +09:00
Zbigniew Jędrzejewski-Szmek 510c4bb31f
Merge pull request #13142 from yuwata/network-wifi-ssid-support-nl80211
network: wifi ssid support with nl80211
2019-10-23 14:51:23 +02:00
Dan Streetman dfec314d41 test: correct TEST-41 StartLimitBurst test
TEST-41 verifies that the StartLimitBurst property will correctly
limit the number of unit restarts, but the test currently doesn't
adjust the StartLimitIntervalSec which defaults to 10 seconds.

On Ubuntu CI, running under un-accelerated qemu, it can take more than
10 seconds to perform all 3 restarts, which avoids the burst limit,
and fails the test.

Instead, specify a long StartLimitIntervalSec in the test, so we can
be sure to correctly test StartLimitBurst even on slow testbeds.

Fixes #13794.
2019-10-18 15:51:43 -04:00
David Tardon 02baf239d8 add test for ExecStopPost
This is a follow-up to #4843.
2019-10-18 16:13:47 +02:00
Dan Streetman 626fbf7f70 test: blacklist TEST-41 on Ubuntu CI
This test has been failing on Ubuntu CI since introduced, let's
blacklist it until we can debug what's causing it to fail.
2019-10-18 15:21:32 +02:00
Jan Synacek a7ab6b7e6b rule-syntax-check: add CONST 2019-10-18 10:02:35 +09:00
Chris Down 959daf9bfc
Merge pull request #13743 from anitazha/dropin_all_the_things
core: support top level drop-ins through -.service.d for service units
2019-10-16 23:10:05 -04:00
Anita Zhang d727acb650
Merge pull request #13754 from claudiozz/master
Allow restart for oneshot units
2019-10-16 14:21:59 -07:00
Claudio Zumbo 10e72727ee Allow restart for oneshot units
Picked up from https://github.com/systemd/systemd/pull/7474 , so
coauthored by @robermorales.
2019-10-16 09:44:20 -07:00
Zbigniew Jędrzejewski-Szmek c8966bffdd
Merge pull request #13663 from ssahani/dhcp-send-option-data
network: DHCPv4 client- add support to send arbitary option and data
2019-10-16 11:31:22 +02:00
Anita Zhang d272467882 shared/dropin: support -.service.d/ top level drop-in for service units
Closes #12830
2019-10-15 11:14:54 -07:00
Yu Watanabe 277ba8d1ab network: add support matching based on BSSID= 2019-10-15 01:59:56 +09:00
Yu Watanabe 8d968fdd99 network: support matching based on wifi SSID 2019-10-15 01:59:06 +09:00
Yu Watanabe 7acb7707ff test-network: disable IPv6AcceptRA= to speed up tests 2019-10-15 00:14:09 +09:00
Susant Sahani cb29c15605 network: DHCPv4 client: add support to send arbitary option and data 2019-10-15 00:14:02 +09:00
Yu Watanabe 086bcf5dca test-network: add a test case for nexthop 2019-10-14 21:55:57 +09:00
Susant Sahani c16c780804 network: introduce ip nexthop routing
Used to manipulate entries in the kernel's nexthop tables.
Example:
```
[NextHop]
Id=3
Gateway=192.168.5.1
```
2019-10-14 21:32:48 +09:00
Zbigniew Jędrzejewski-Szmek 4f10b80786 Rename udev's hwdb/ to hwdb.d/
As in the parent commit, this makes the name consistent with the
rest of the source tree and the actuall installation path.
2019-10-10 00:53:09 +01:00
Balint Reczey bd89d03544 test: Pass personality test even when i686 userland runs on x86_64 kernel 2019-10-10 00:52:16 +01:00
Zbigniew Jędrzejewski-Szmek 7891aa0040
Merge pull request #13568 from ddstreet/ubuntu-ci-blacklists
test: add temporarily blacklisted tests
2019-10-09 12:04:42 +02:00
Zbigniew Jędrzejewski-Szmek fd3561bae0 test/TEST-31-DEVICE-ENUMERATION: do not use -x to avoid grep loop
https://github.com/systemd/systemd/pull/13746#issuecomment-539410752:
> [grep] now matches the grep command itself, as it's logged into journal as well, thanks to set -x.

Also, use journalctl --grep and -t to make things a bit quicker.
2019-10-08 11:11:49 +02:00
Zbigniew Jędrzejewski-Szmek 51fa85913c test: add function to reduce copied setup boilerplate
Many tests were also masking systemd-machined.service. But machined
should only start when activated, so having it not masked shouldn't be
noticable. TEST-25-IMPORT needs it.
2019-10-08 09:10:12 +02:00
Zbigniew Jędrzejewski-Szmek 0f714a34c4 test: drop redirection to tty in integration tests
I *think* this was originally added to make it easier to see what was happening
in tests. Later we added the functionality to print the journal on failure, so
this redirection has stopped being useful.

In https://github.com/systemd/systemd/pull/13719#issuecomment-539292650
@filbranden shows that grep tries to write to stdout and fails. In general,
we should not assume that writing to the console it always possible. We have
special code to handle this in pid1 after all:

99    19:22:10.731965 fstat(1,  <unfinished ...>
99    19:22:10.731993 <... fstat resumed>{st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
99    19:22:10.732070 write(1, "ExecStartPost={ path=/bin/echo ; argv[]=/bin/echo ${4_four_ex} ; ignore_errors=no ; start_time=[Mon 2019-10-07 19:22:10 PDT] ; stop_time=[Mon 209-10-07 19:22:10 PDT] ; pid=97 ; code=exited ; status=0 }\n", 203) = -1 EIO (Input/output error)
99    19:22:10.732174 write(2, "grep: ", 6) = -1 EIO (Input/output error)
99    19:22:10.732226 write(2, "write error", 11) = -1 EIO (Input/output error)
99    19:22:10.732263 write(2, ": Input/output error", 20) = -1 EIO (Input/output error)
99    19:22:10.732298 write(2, "\n", 1 <unfinished ...>
99    19:22:10.732325 <... write resumed>) = -1 EIO (Input/output error)
99    19:22:10.732349 exit_group(2)     = ?
99    19:22:10.732424 +++ exited with 2 +++

Removing the redirection should make the tests less flakey.

Replaces #13719.

While at it, also drop NotifyAccess=all. I think it was added purposefully in
TEST-20-MAINPIDGAMES, and then cargo culted to newer tests.
2019-10-08 08:48:48 +02:00
Balint Reczey f6084ab0e2 test-execute: Filter /dev/.lxc in exec-dynamicuser-statedir.service
It appears in nested LXC containers and broke the test in Ubuntu CI.

BugLink: https://bugs.launchpad.net/bugs/1845337
2019-10-04 11:56:29 +02:00
Dan Streetman b4532d650b test/README.testsuite: add section for Ubuntu CI blacklist files
Add some docs explaining how blacklist individual test/TEST-*
tests in Ubuntu CI using per-test blacklist files.
2019-10-03 11:01:23 -04:00
Dan Streetman a79505909f test: add temporarily blacklisted tests
This temporarily blacklists some tests when run under Ubuntu CI.

This is the upstream side of the Debian 'upstream' test MR:
https://salsa.debian.org/systemd-team/systemd/merge_requests/52

The tests blacklisted here should only be temporarily blacklisted
until they can be fixed; the intention is that these blacklist files
will be added and removed over time while debugging/fixing flaky
and/or regressed tests, without causing test failure noise for other
PRs.
2019-10-03 11:01:10 -04:00
Zbigniew Jędrzejewski-Szmek 5afe558cfd
Merge pull request #12818 from yuwata/network-issue-8726
network: disable kernel creating prefix route when RouteTable= is set
2019-10-03 15:21:35 +02:00
Zbigniew Jędrzejewski-Szmek 6e2d361d53
Merge pull request #13696 from keszybz/keep-dhcp-on-restart
Add a way to differentiate restart from stop and keep dhcp config on restart
2019-10-03 11:25:12 +02:00
Zbigniew Jędrzejewski-Szmek a232ebcc2c core: add support for RestartKillSignal= to override signal used for restart jobs
v2:
- if RestartKillSignal= is not specified, fall back to KillSignal=. This is necessary
  to preserve backwards compatibility (and keep KillSignal= generally useful).
2019-10-02 14:01:25 +02:00
Zbigniew Jędrzejewski-Szmek c78c095b1e nspawn: rename UNIFIED_CGROUP_HIERARCHY to SYSTEMD_NSPAWN_UNIFIED_HIERARCHY
We should never have used an unprefixed environment variable name.
All other systemd-nspawn variables have the "SYSTEMD_NSPAWN_" prefix,
and all other systemd variables have the "SYSTEMD_" prefix.

The new variable name takes precedence, but we fall back to checking the
old one. If only the old one is found, a warning is emitted.

In addition, SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="" is accepted as an override
to avoid looking for the old variable name.

We have a variable with the same name ($UNIFIED_CGROUP_HIERARCHY) in tests,
which governs both systemd-nspawn and qemu behaviour. It is not renamed.
2019-10-01 10:21:13 -07:00
Susant Sahani 2805536bff network: DHCPv6 client add support for prefix delegation hint
Add support for prefix hint lenth and prefix hint address
```
Frame 43: 177 bytes on wire (1416 bits), 177 bytes captured (1416 bits) on interface 0
Ethernet II, Src: f6:c1:08:4d:45:f1 (f6:c1:08:4d:45:f1), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::d250:c82:7f6e:28d6, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x5c7902
    Rapid Commit
    Identity Association for Non-temporary Address
    Fully Qualified Domain Name
    Identity Association for Prefix Delegation
        Option: Identity Association for Prefix Delegation (25)
        Length: 41
        Value: 1b97b1690000000000000000001a0019ffffffffffffffff…
        IAID: 1b97b169
        T1: 0
        T2: 0
        IA Prefix
            Option: IA Prefix (26)
            Length: 25
            Value: ffffffffffffffff3c000000000000000000000000000000…
            Preferred lifetime: infinity
            Valid lifetime: infinity
            Prefix length: 60
            Prefix address: ::
    Option Request
    Client Identifier
    Elapsed time
```
2019-10-01 23:52:40 +09:00
Frantisek Sumsal 501deda1ce test: allow use of nested KVM
Introduce TEST_NESTED_KVM variable, which allows use of nested KVM for
QEMU VMs (which is disabled by default by KVM autodetection).
2019-09-27 15:42:38 -07:00
Siddharth Chandrasekara afe42aef39 dhcp4: make IPServiceType configurable
IPServiceType set to CS6 (network control) causes problems on some old
network setups that continue to interpret the field as IP TOS.

Make DHCP work on such networks by allowing this field to be set to
CS4 (Realtime) instead, as this maps to IPTOS_LOWDELAY.

Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
2019-09-26 11:39:46 +09:00
Susant Sahani 224ded670f link: Add support to configure NIC ring buffer size 2019-09-24 16:33:35 +02:00
Susant Sahani 299d578f7f network: DHCP server Add support to transmit SIP server
1. DHCP server trasmit
2. Client parses and saves in leases
Implements http://www.rfc-editor.org/rfc/rfc3361.txt

```
Frame 134: 348 bytes on wire (2784 bits), 348 bytes captured (2784 bits) on interface 0
Ethernet II, Src: 42:65:85:d6:4e:32 (42:65:85:d6:4e:32), Dst: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11
User Datagram Protocol, Src Port: 67, Dst Port: 68
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x7cc87cb4
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 192.168.5.11
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (3600s) 1 hour
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 192.168.5.1
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 192.168.5.1
    Option: (42) Network Time Protocol Servers
        Length: 4
        Network Time Protocol Server: 192.168.1.1
    Option: (120) SIP Servers <=====here
        Length: 9
        SIP Server Encoding: IPv4 Address (1)
        SIP Server Address: 192.168.1.1
        SIP Server Address: 192.168.5.2
    Option: (101) TCode
        Length: 13
        TZ TCode: Europe/Berlin
    Option: (54) DHCP Server Identifier (192.168.5.1)
        Length: 4
        DHCP Server Identifier: 192.168.5.1
    Option: (255) End
        Option End: 255
```

```
cat /run/systemd/netif/state                                                                                                   ✔    3148  16:40:51
OPER_STATE=routable
CARRIER_STATE=carrier
ADDRESS_STATE=routable
DNS=192.168.94.2 192.168.5.1
NTP=192.168.5.1
SIP=192.168.1.1 192.168.5.2

```

aa
2019-09-20 21:22:23 +09:00
Susant Sahani 5bc945bec4 network dhcp4: Add support send request options in a generic manner 2019-09-20 21:05:48 +09:00
Susant Sahani 98f0e10429 test-network: Drop start dnsmasq 2019-09-20 08:09:25 +00:00
Yu Watanabe 0eb5e6d3f0 dhcp6: use unaligned_read_be32()
Closes #13591.
2019-09-20 08:04:15 +00:00
Yu Watanabe 6ffe71d0e2 dhcp6: add missing option length check
Closes #13578.
2019-09-17 18:29:20 +00:00
Anita Zhang 898fc00e79 core: add ExecXYZEx= bus hook ups to all exec command properties
The "Ex" variant was originally only added for ExecStartXYZ= but it makes
sense to have feature parity for the rest of the exec command properties
as well (e.g. ExecReload=, ExecStop=, etc).
2019-09-17 15:48:44 +00:00
Frantisek Sumsal 8813a8c332 test: rename TEST-EXECRELOAD to avoid name conflict 2019-09-18 00:14:43 +09:00
Yu Watanabe edfbf051e1
Merge pull request #13559 from ssahani/ipv6ra-route
network: make networkd able to advertise IPv6 routes on links
2019-09-18 00:13:08 +09:00
Susant Sahani 9633f977ea Add test for IPv6 Route advertisement 2019-09-17 12:10:19 +02:00
Susant Sahani 203d4df573 network: Add support to advertie ipv6 route
Implements https://tools.ietf.org/html/rfc4191

cat veth99.network
```
[Match]
Name=veth99

[Network]
DHCP=no
IPv6PrefixDelegation=yes
Address=2001:db8:0:1::1/64

[IPv6Prefix]
Prefix=2001:db8:0:1::4/64

[IPv6RoutePrefix]
Route=2001:db0:fff::/48

```
Wireshark

```
Frame 481: 142 bytes on wire (1136 bits), 142 bytes captured (1136 bits) on interface 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0xec77 [correct]
    [Checksum Status: Good]
    Cur hop limit: 0
    Flags: 0x00, Prf (Default Router Preference): Medium
    Router lifetime (s): 0
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 1e:04:f8:b8:2f:d4)
        Type: Source link-layer address (1)
        Length: 1 (8 bytes)
        Link-layer address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
    ICMPv6 Option (MTU : 1500)
        Type: MTU (5)
        Length: 1 (8 bytes)
        Reserved
        MTU: 1500
    ICMPv6 Option (Prefix information : 2001:db8:0:1::4/64)
        Type: Prefix information (3)
        Length: 4 (32 bytes)
        Prefix Length: 64
        Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
        Valid Lifetime: 2592000
        Preferred Lifetime: 604800
        Reserved
        Prefix: 2001:db8:0:1::4
    ICMPv6 Option (Route Information : Medium 2001:db0:fff::/48)
        Type: Route Information (24)
        Length: 3 (24 bytes)
        Prefix Length: 48
        Flag: 0x00, Route Preference: Medium
            ...0 0... = Route Preference: Medium (0)
            000. .000 = Reserved: 0
        Route Lifetime: 604800
        Prefix: 2001:db0:fff::
```
2019-09-17 12:09:59 +02:00
Zbigniew Jędrzejewski-Szmek 69cebea78a
Merge pull request #13300 from mrc0mmand/test-execreload
test: introduce TEST-37-EXECRELOAD
2019-09-17 10:54:18 +02:00
Yu Watanabe 7b3770a75f test-network: add one more test case for LinkLocalAddressing= 2019-09-17 09:45:22 +09:00
Yu Watanabe 2aa7d367ec network: do not create default route for ipv4 link local addressing
When nspawn container with private network starts, networkd creates
the default route for the interface. The route may cause problem on
the host side, and it can be created with DefaultRouteOnDevice= now.
Hence, this makes networkd not create the route implicitly any more.

Closes #13418.
2019-09-15 22:33:11 +09:00
Zbigniew Jędrzejewski-Szmek de5ae832f2
Merge pull request #13439 from yuwata/core-support-systemctl-clean-more
core: support systemctl clean more
2019-09-13 16:15:02 +02:00
Yu Watanabe 48d26c9085 test: add test cases for empty string match 2019-09-11 09:06:15 +09:00
Fabian Henneke d45ee2f31a udev: Add id program and rule for FIDO security tokens
Add a fido_id program meant to be run for devices in the hidraw
subsystem via an IMPORT directive. The program parses the HID report
descriptor and assigns the ID_SECURITY_TOKEN environment variable if a
declared usage matches the FIDO_CTAPHID_USAGE declared in the FIDO CTAP
specification. This replaces the previous approach of whitelisting all
known security token models manually.

This commit is accompanied by a test suite and a fuzzer target for the
descriptor parsing routine.

Fixes: #11996.
2019-09-07 02:23:58 +09:00
Yu Watanabe a3f8e4d94a test: add more tests for "systemctl clean" 2019-08-31 09:30:12 +02:00
Zbigniew Jędrzejewski-Szmek 6b4f7fb08c
Merge pull request #13385 from yuwata/core-remove-private-directories-13355
core: also remove private directories by systemctl clean
2019-08-31 09:28:39 +02:00
Zbigniew Jędrzejewski-Szmek 3a5a08bbb4
Merge pull request #13384 from yuwata/core-runtime-directory-preserve
core: make RuntimeDirectoryPreserve= works with non-service units
2019-08-30 13:00:57 +02:00
Yu Watanabe c238b616cf test: add tests for systemctl clean with DynamicUser=yes 2019-08-28 23:09:54 +09:00
Yu Watanabe 6c431a16c3
Merge pull request #13382 from keszybz/network-ipv6-enable
Network ipv6 enable
2019-08-28 00:29:29 +09:00
Zbigniew Jędrzejewski-Szmek 57ad760746 network: drop all checks of ipv6_disabled sysctl
*We* control the sysctl setting. If the user configured IPv6, then we apply the
settings, and just make sure that at some point during the configuration the
sysctl is disabled (i.e. ipv6 enabled) if we have IPv6 configured.

Replaces #13283.
2019-08-27 15:31:48 +02:00
Dan Streetman 58c1a34437 test/TEST-10-ISSUE-2467: remove testsuite.service TimeoutStartSec
This test runs under qemu, which may run on some testbeds without
acceleration; in those cases, a 10s timeout is frequently too short.

Simply removing the timeout to allow the default timeoutsec should
be enough time for the test to finish, even on very slow testbeds.
2019-08-26 12:47:15 +09:00
Dan Streetman 65c5f3d074 test/TEST-18-FAILUREACTION: fix typo to actually run firstphase action
The if test for running the firstphase of the test should be negated
so the firstphase is actually executed.
2019-08-26 12:46:39 +09:00
Dan Streetman adcc450f46 test/test-functions: use truncate instead of dd to create testbed image
This avoids unnecessary noise in the stderr logs which dd always produces,
such as:

0+0 records in
0+0 records out
0 bytes copied, 0.000155284 s, 0.0 kB/s

Using truncate should not result in any functional change; the image will
still be created as a sparse file of the size specified.
2019-08-25 15:37:51 +09:00
Dan Streetman 84c49ad197 test/test-functions: use binaries from $BUILD_DIR or installed system
In Ubuntu CI, we test binaries from the installed system, not from
$BUILD_DIR, so use the appropriate binary.  Most of the calls to the
binaries are part of checking/processing asan-built binaries, and so
did not apply to Ubuntu CI, except for generating noise in the stderr
log like:

objdump: '/tmp/autopkgtest.83yGoI/build.fHB/src/test/TEST-01-BASIC/systemd-journald': No such file

However this also applies to the call to systemd-nspawn, which the debian
upstream test wrapper was sed-adjusting to use the installed binary
instead of the binary in $BUILD_DIR.  This commit allows removing that
sed processing of the test-functions file during Ubuntu CI test.
2019-08-25 15:36:47 +09:00
Yu Watanabe 8246bb204c test: add tests for RuntimeDirectoryPreserve=yes 2019-08-23 00:22:54 +09:00
Zbigniew Jędrzejewski-Szmek 4eaa2486b8
Merge pull request #13235 from yuwata/network-routing-policy-rule-family-13233
network: add RoutingPolicyRule.Family= setting
2019-08-19 10:08:23 +02:00
Zbigniew Jędrzejewski-Szmek 165df4dcda
Merge pull request #13345 from yuwata/network-fix-preferred-lifetime-zero-13341
network: fix PreferredLifetime=0
2019-08-19 09:59:16 +02:00
Yu Watanabe 134075bf30
Merge pull request #13344 from ddstreet/test-functions
Minor/cosmetic changes to test/test-functions, some test.sh
2019-08-19 00:34:35 +09:00
Dan Streetman e24619fddd test: increase qemu timeout for TEST-18 and TEST-19
These tests runs under qemu, and on some testbeds, without acceleration.
On those systems, the current 180 second overall test timeout is too
short to run the test.

Increasing the timeout to 600s should be enough, even for slow
non-accelerated qemu testbeds.
2019-08-19 00:30:22 +09:00
Yu Watanabe e4783b548a test-network: update test for PreferredLifetime=0 2019-08-19 00:06:50 +09:00
Dan Streetman 8c03df36fe test/test-functions: add mkdir to import_initdir
This dir is created by create_empty_image_rootdir, as well as indirectly
by some other functions, but it should be created by import_initdir so
the newly-exported $initdir exists and can be used immediately without
relying on other functions to create it.
2019-08-17 12:29:15 -04:00
Dan Streetman 0036ce06cb test: replace $TESTDIR/root with $initdir
The $initdir var is already set to $TESTDIR/root, it should be used
instead of direct use of $TESTDIR/root.
2019-08-17 12:29:08 -04:00
Dan Streetman f422967529 test: TEST-33 and TEST-36 should use create_empty_image_rootdir
This recently added function handles mkdir and mounting of the empty image,
as well as umounting after test_setup.
2019-08-17 12:28:57 -04:00
Dan Streetman 9e19a8b028 test/test-functions: avoid stderr noise, only umount on cleanup if mountpoint
Only umount it during cleanup if the $TESTDIR/root dir is a mountpoint.
This avoids adding noise to the stderr log such as:

mountpoint: /var/tmp/systemd-test.waLOFT/root: No such file or directory
2019-08-17 12:28:41 -04:00
Yu Watanabe 65c24cd087 test-network: add tests for RoutingPolicyRule.Family=ipv6 and both 2019-08-16 22:02:17 +09:00
Yu Watanabe f6c6ff97f5 network: add RoutingPolicyRule.Family= setting
Closes #13233.
2019-08-16 22:02:17 +09:00
Daniel Black f364a17dd1 test: ppc64* qemu is qemu-system-ppc64 2019-08-14 07:43:29 +00:00
Frantisek Sumsal 215bffe1b8 test: store coredumps in journal
To make debugging much easier, especially for crashes in tests under
QEMU, let's store the entire coredump bundle in the systemd journal,
which is usually kept around by various CIs. Right now, we usually end
up with a journal, but without the coredump itself, which is pretty
useless.
2019-08-13 07:09:57 +00:00
William A. Kennington III d1bdafd214 networkd: Keep track of static neighbors
We need to keep track of the static neighbors that are configured on the
interface so that we can delete stale entries that were removed.
2019-08-12 20:28:19 +09:00
Frantisek Sumsal 67c434b03f test: drop the missed || exit 1 expression
...as we've already done in the rest of the testsuite, see
cc469c3dfc
2019-08-11 09:38:49 +02:00
Frantisek Sumsal 38d8a12353 test: introduce TEST-37-EXECRELOAD
A simple test case for #13098
2019-08-10 16:03:07 +02:00
William A. Kennington III 0b1cd3e25a networkd: Routes should take the gateway into account
Otherwise, changing the default gateway doesn't purge old gateway routes
left on the system during daemon restart. This also fixes removing other
foreign gateway routes that don't match the expected configuration.

Tested:
    Changed gateway addresses prior to the patch and they lingered on
    the system during each reconfiguration. Applied this patch and
    reconfigured gateways and other routes multiple times and it removed
    the foreign routes that had gateways that didn't match.

Signed-off-by: William A. Kennington III <william@wkennington.com>
2019-08-07 20:32:36 +09:00
Frantisek Sumsal 92f8e97892 test: add a simple sanity check for systems without NUMA support 2019-08-05 15:05:32 +02:00
Frantisek Sumsal c7367d7cfd test: give strace some time to initialize
The `coproc` implementation seems to be a little bit different in older
bash versions, so the `strace` is sometimes started AFTER `systemctl
daemon-reload`, which causes unexpected fails. Let's help it a little by
sleeping for a bit.
2019-08-05 15:05:32 +02:00
Frantisek Sumsal b030847163 test: skip the test on systems without NUMA support 2019-08-05 15:05:32 +02:00
Frantisek Sumsal 56425e54a2 test: make sure the strace process is indeed dead
It may take a few moments for the strace process to properly terminate
and write all logs to the backing storage
2019-08-05 15:05:32 +02:00
Frantisek Sumsal ac14396d02 test: support MPOL_LOCAL matching in unpatched strace versions
The MPOL_LOCAL constant is not recognized in current strace versions.
Let's match at least the numerical value of this constant until the
strace patch is approved & merged.
2019-08-05 15:05:32 +02:00
Frantisek Sumsal d0b2178f3e test: replace tail -f with journal cursor which should be...
more reliable
2019-08-05 15:05:26 +02:00
Frantisek Sumsal 8f65e26508 test: introduce TEST-36-NUMAPOLICY 2019-08-05 13:48:29 +02:00
Frantisek Sumsal 761ce2a4ba test: allow overriding QEMU_OPTIONS from the outside 2019-08-05 13:48:29 +02:00
Frantisek Sumsal 345997f393 test: print an error when networkctl returns an unexpected EC
If networkctl crashes, like recently with SIGABRT, it returns absolutely
no output, which may be confusing during debugging. Help it a little
with a short informative message.
2019-07-31 16:33:12 +02:00
Frantisek Sumsal 2de705cd1c test: use useradd instead of adduser
`adduser` is in certain cases a standalone package which provides a
better user experience. In other cases it's just a symlink to `useradd`.
And some distributions don't have `adduser` at all, like Arch Linux.
Let's use the `useradd` binary instead, which should provide the same
functionality everywhere.
2019-07-30 20:26:25 +02:00
Lennart Poettering 5756bff6f1
Merge pull request #13119 from keszybz/unit-loading-2
Rework unit loading to take into account all aliases
2019-07-30 17:55:37 +02:00
Zbigniew Jędrzejewski-Szmek 9f4afc0154
Merge pull request #13189 from yuwata/network-initrd-generator-unit
unit: update initrd-network-generator.service
2019-07-30 16:38:59 +02:00
Zbigniew Jędrzejewski-Szmek e8630e6952 pid1: use a cache for all unit aliases
This reworks how we load units from disk. Instead of chasing symlinks every
time we are asked to load a unit by name, we slurp all symlinks from disk
and build two hashmaps:
1. from unit name to either alias target, or fragment on disk
   (if an alias, we put just the target name in the hashmap, if a fragment
    we put an absolute path, so we can distinguish both).
2. from a unit name to all aliases

Reading all this data can be pretty costly (40 ms) on my machine, so we keep it
around for reuse.

The advantage is that we can reliably know what all the aliases of a given unit
are. This means we can reliably load dropins under all names. This fixes #11972.
2019-07-30 14:01:46 +02:00
Zbigniew Jędrzejewski-Szmek 54f4403485 TEST-15-DROPIN: add test for details of unit aliasing
I adjusted the tests to pass. I don't think the behaviour makes much sense,
even if we ignore the issue with "lazy loading" of aliases. E.g. in the
last section, the fact that dropins for yup@.service and yup@3.service are
not loaded seems to be a plain old bug.
2019-07-30 13:51:18 +02:00
Zbigniew Jędrzejewski-Szmek 976ed3b621 test: use "ln -fs"
Without this, repeated runs of "make -C TEST/... setup" fail when trying
to create the symlink.
2019-07-30 13:27:06 +02:00
Yu Watanabe e8d456fba8 network-generator: rename generated unit files
The tool may be used in the initrd-less systems.
2019-07-30 02:30:09 +09:00
Yu Watanabe 36bc2ffbc1 test-network: add tests for new entries in "networkctl status" 2019-07-30 00:02:14 +09:00
Yu Watanabe e8489008cb network: rename IGMPVersion= -> MulticastIGMPVersion= 2019-07-26 11:00:56 +09:00
Yu Watanabe 4bd04e3dcb network: drop recently added settings from deprecated [DHCP] section 2019-07-25 12:39:33 +09:00
Yu Watanabe 72e04ea31c test-network: use [DHCPv4] and [DHCPv6] sections instead of deprecated [DHCP] section 2019-07-25 12:38:57 +09:00
Yu Watanabe c904709288 test-network: add test for Bridge.IGMPVersion= 2019-07-25 10:05:17 +09:00
Susant Sahani afa51e2dfb networkd: bridge add support to set IGMP version 2019-07-25 10:05:06 +09:00
Iago López Galeiras 5574181151 test: add some test for norbind
This regressed so let's add a test to make sure it doesn't happen again.
2019-07-24 17:20:29 +02:00
Luca Boccassi 65224c1d0e core: rename ShutdownWatchdogSec to RebootWatchdogSec
This option is only used on reboot, not on other types of shutdown
modes, so it is misleading.
Keep the old name working for backward compatibility, but remove it
from the documentation.
2019-07-23 20:29:03 +01:00
Luca Boccassi acafd7d8a6 core: add KExecWatchdogSec option
Rather than always enabling the shutdown WD on kexec, which might be
dangerous in case the kernel driver and/or the hardware implementation
does not reset the wd on kexec, add a new timer, disabled by default,
to let users optionally enable the shutdown WD on kexec separately
from the runtime and reboot ones. Advise in the documentation to
also use the runtime WD in conjunction with it.

Fixes: a637d0f9ec ("core: set shutdown watchdog on kexec too")
2019-07-23 20:29:03 +01:00
Yu Watanabe e3cbaeab86 test-network: add tests for issue #6088 2019-07-23 22:08:58 +09:00
Yu Watanabe dd9b10c84f network: add fallback logic for old kernels
It seems that old kernels do not support prefix routes with
non-default route tables. This adds a fallback logic when adding route
fails. In that case, prefix route is created by kernel and the default
route table is used.
2019-07-22 11:36:11 +09:00
Yu Watanabe 156ddf8df7 network: disable kernel creating prefix route when RouteTable= is set
Closes #8726.
2019-07-22 11:34:22 +09:00
Zbigniew Jędrzejewski-Szmek f7e7bb6546 Merge pull request #13070 from yuwata/network-set-route-to-dhcp-dns 2019-07-19 09:35:22 +02:00
Dan Streetman 65dd488fe1 test: convert all uses of '|| true' into '|| :'
No change in functionality; just use the shorter || :
2019-07-19 13:47:21 +09:00
Yu Watanabe fb2ba3305b test-network: add test for neighbor with ipv6 lladdr 2019-07-19 07:14:58 +09:00
Yu Watanabe 195a18c17d test-network: add tests for routes to DNS servers provided by DHCPv4 2019-07-19 01:56:14 +09:00
Yu Watanabe a24e12f020 network: add DHCPv4.RoutesToDNS= setting 2019-07-19 01:49:39 +09:00
Michael Biebl b333c4d101 test: replace Makefile copy with a symlink for TEST-28-PERCENTJ-WANTEDBY
TEST-28-PERCENTJ-WANTEDBY/Makefile is identical to
TEST-01-BASIC/Makefile so avoid duplication and use a symlink instead.
2019-07-18 12:49:41 +02:00
Michael Biebl 6db904625d meson: make nologin path build time configurable
Some distros install nologin as /usr/sbin/nologin, others as
/sbin/nologin.
Since we can't really on merged-usr everywhere (where the path wouldn't
matter), make the path build time configurable via -Dnologin-path=.

Closes #13028
2019-07-18 12:46:35 +02:00
Yu Watanabe 693283cd58 Revert "test-network: extend sleep time"
This reverts commit 7d7bb5c861.

Still the CIs are flaky and the commit just slow down them.
2019-07-17 23:13:40 +09:00
Dan Streetman 2a2aeed460 test/TEST-16: don't copy systemd-notify or lib from $BUILD_DIR
On Ubuntu CI, these don't exist because it tests installed
binaries, not just-built binaries.
2019-07-17 14:25:27 +02:00
Lennart Poettering 52f4b5ac8a
Merge pull request #12675 from yuwata/network-set-dns
resolvectl: support to modify interfaces managed by networkd
2019-07-17 12:07:39 +02:00
Anita Zhang 31cd5f63ce core: ExecCondition= for services
Closes #10596
2019-07-17 11:35:02 +02:00
Zbigniew Jędrzejewski-Szmek 4a747647b3
Merge pull request #13082 from ddstreet/minor
Minor fixes in test framework
2019-07-17 08:44:01 +02:00
Dan Streetman 59279e9618 test/test-functions: fix install_dmeventd to correctly install bin/libs 2019-07-17 08:34:48 +02:00
Dan Streetman e96386521c test/test-functions: instmods call to find should use -type f
without using -type f, the logs print an error such as:

E:  E: modprobe: FATAL: Module asymmetric_keys not found in directory /lib/modules/4.15.0-54-generic

while this doesn't appear to cause problems, it can be extremely
distracting when trying to debug real failures.
2019-07-16 18:05:15 -04:00
Dan Streetman d391ee10a0 test: when stripping binaries, ignore case in suppressing "File format not recognized"
The grep -v matches all lowercase, but "file" is captialized; just ignore case so
it's suppressed for either all lowercase or capital File.
2019-07-16 18:05:15 -04:00
Dan Streetman f85bc044e5 test: ignore errors during test cleanup, so cleanup can finish
Also move TESTDIR and STATEFILE removal into test_cleanup
2019-07-16 18:05:15 -04:00
Dan Streetman ec4cab49c9 test: add create_empty_image_rootdir() to simplify testcase setup
Almost all tests were manually mounting/unmounting $TESTDIR/root
from the loopback image; this moves all that into test-functions
so the test setup functions are simplier.

Also add test_setup_cleanup() function, to cleanup what is mounted
by create_empty_image_rootdir()
2019-07-16 18:05:15 -04:00
Yu Watanabe 217246a990 test-network: drop warn_about_firewalld() as it is not necessary any more 2019-07-17 06:59:12 +09:00
Yu Watanabe 2225e7fd88 test-network: stop firewalld in setUpModule() 2019-07-17 06:59:12 +09:00
Yu Watanabe 336d18f0ff test-network: add tests for link state file vs resolvectl or timedatectl 2019-07-17 06:59:12 +09:00
Yu Watanabe 26408c7d5f
Merge pull request #13069 from yuwata/network-do-not-set-routes-when-carrier-lost
network: do not configure routes when dropping addresses
2019-07-17 06:56:32 +09:00
Yu Watanabe 7d7bb5c861 test-network: extend sleep time
Even if addresses provided by DHCP is assigned, the state file may not
be written yet, or resolved may not receive the state change signal
yet, or resolved may not process the signal yet...
2019-07-17 01:01:10 +09:00
Evgeny Vereshchagin 038bf640e9 tests: bump up QEMU_MEM 2019-07-16 15:01:26 +00:00
Lennart Poettering 15bcd9fa09
Merge pull request #12925 from yuwata/network-generator
network-generator: introduce new tool systemd-network-generator
2019-07-16 16:23:42 +02:00
Yu Watanabe e2aea43f31 test-network: make wait_online() check setup state
Previously, event if link's setup state is in failed, tests may pass,
as systemd-networkd-wait-online success if the state is in failed state.
This makes tests be checked more strictly.
2019-07-16 01:32:24 +09:00
Yu Watanabe e0c1341df2 test-network: add tests for DHCPv4.UseDomains= 2019-07-15 00:43:15 +09:00
Yu Watanabe 12fc80bed5 test: add TEST-35-NETWORK-GENERATOR 2019-07-14 10:59:54 +09:00
Yu Watanabe 6d60f9dbe6 test-network: add tests for route with type local, multicast, anycast, or broadcast 2019-07-12 09:39:43 +09:00
Yu Watanabe 5424fd9573 test-network: test more bridge properties
Imported from networkd-test.py
2019-07-12 09:39:43 +09:00
Yu Watanabe 6fa0524133
Merge pull request #12971 from yuwata/network-reassign-static-routes
network: reassign static routes and process reply address messages
2019-07-12 09:36:16 +09:00
Lennart Poettering be9d8212a5
Merge pull request #13017 from yuwata/network-neighbor-lladdr-13015
network: rename Neighbor.MACAddress= and also support IPv4 address
2019-07-11 19:23:29 +02:00
Lennart Poettering 2e8e1a1ab6
Merge pull request #12461 from Werkov/fix-job-ordering
Refactor job ordering implementation (and fix cycle detection)
2019-07-11 16:43:58 +02:00
Yu Watanabe c1b01a62d1 test-network: add test for route reassignment 2019-07-11 22:37:58 +09:00
Yu Watanabe 74761cf37e test-network: add testcase that Neighbor.LinkLayerAddress= is IP address 2019-07-11 22:22:29 +09:00
Yu Watanabe d86f5c194c test-network: use Neighbor.LinkLayerAddress= instead of deprecated Neighbor.MACAddress= 2019-07-11 22:22:29 +09:00
Yu Watanabe b956364db0 network: rename Neighbor.MACAddress= to Neighbor.LinkLayerAddress=
And make it support IPv4 address.

Closes #13015.
2019-07-11 22:22:29 +09:00
Lennart Poettering 273fe5d3cb test: add testcase for new CleanUnit logic 2019-07-11 12:18:51 +02:00
Lennart Poettering 66d3159739
Merge pull request #13018 from yuwata/network-tunnel-follow-up-13016
network: drop assertions about Tunnel.family
2019-07-11 12:10:39 +02:00
Yu Watanabe cef94248ff test-network: drop test_udev_driver as it is unstable
The test unexpectedly succeeds on KVM with sanitizer CI.
At least tentatively, let's drop the test.
2019-07-11 11:17:20 +02:00
Lennart Poettering 7e82b4059b
Merge pull request #13006 from yuwata/network-split-dhcp-12917
networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
2019-07-11 10:28:03 +02:00
Yu Watanabe 42a29fcb12 test-network: add testcases Tunnel.Remote=any and Local=any 2019-07-11 15:09:50 +09:00
Yu Watanabe e64dc40615 test-network: add test for Xfrm netdev 2019-07-11 11:51:23 +09:00
Yu Watanabe 95082dbef5 test-network: add test for AssignToLoopback= setting 2019-07-11 09:59:06 +09:00
Yu Watanabe 8c9c703c55 network: add AssignToLoopback= setting to [Tunnel] section
networkd does not manage loopback interface lo. So, previously, we have
no way to assign tunnel devices to lo.
2019-07-11 09:59:06 +09:00
Yu Watanabe f392c06566
Merge pull request #12863 from 1848/if_xfrm
Added support for xfrm interfaces
2019-07-10 23:04:49 +09:00
1848 98d20a17a9 Added support for xfrm interfaces 2019-07-10 23:02:19 +09:00
Yu Watanabe e4443f9bfc network: fix memleak
set_put() does not return -EEXIST.

Fixes #12995 and oss-fuzz#15678.
2019-07-10 12:27:48 +02:00
Yu Watanabe e2d5aab32a test-network: add tests for UseDNS= in [DHCP] section 2019-07-10 17:44:43 +09:00
Yu Watanabe b6d587d1d2 test-network: enable systemd-resolved.service 2019-07-10 17:40:14 +09:00
Yu Watanabe 4f7331a85e network: rename [DHCP] section to [DHCPv4]
To keep the backward compatibility broken by the previous commit.
2019-07-10 17:33:09 +09:00
Susant Sahani caa8ca4286 networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
Closes https://github.com/systemd/systemd/issues/12917
2019-07-10 16:59:29 +09:00
Dan Streetman abb9cc50af test/udev-test.pl: cleanup if skipping test
In Ubuntu CI, udev-test.pl is run from the debian/test/udev script,
in a test dir created for it; but udev-test.pl setup mounts a
dir, so if it doesn't cleanup/unmount before exiting, the test dir
autopkgtest created for it can't be removed, and autopkgtest
aborts the entire test suite, for example this output (from a
test run inside an armhf container):

autopkgtest [12:45:36]: test udev: [-----------------------
umount: test/tmpfs: no mount point specified.
mknod: test/tmpfs/dev/null: Operation not permitted
unable to create test/tmpfs/dev/null at ./udev-test.pl line 1611.
Failed to set up the environment, skipping the test at ./udev-test.pl line 1731.
autopkgtest [12:45:41]: test udev: -----------------------]
autopkgtest [12:45:44]: test udev:  - - - - - - - - - - results - - - - - - - - - -
udev                 FAIL non-zero exit status 77
rm: cannot remove '/tmp/autopkgtest.ocPFA6/autopkgtest_tmp/test/tmpfs': Device or resource busy
autopkgtest [12:46:22]: ERROR: "rm -rf /tmp/autopkgtest.ocPFA6/udev-artifacts /tmp/autopkgtest.ocPFA6/autopkgtest_tmp" failed with stderr "rm:
2019-07-09 14:54:34 +09:00
Evgeny Vereshchagin 869250e6b8
Merge pull request #12992 from mrc0mmand/test-functions-fixes
Various test/test-functions fixes/improvements
2019-07-09 02:27:39 +03:00
Frantisek Sumsal cc469c3dfc test: drop || return 1 expression which is incompatible with set -e
The `set -e` option is incompatible with a subshell/compound command,
which is followed by || <EXPR>. In such case, the -e option is ignored
in all affected subshells/functions (see man bash(1) for command `set`).
2019-07-08 21:11:32 +02:00
Frantisek Sumsal 71a0de36e5 test: be a little bit more verbose when installing service binaries 2019-07-08 21:10:21 +02:00
Frantisek Sumsal 3cdb93d07b test: correctly handle installation of newly introduced binaries
In certain cases we might attempt to install a binary which is already
present in the test image, yet it's missing from the host system.
In such cases, let's check if the binary indeed exists in the image
before doing any other chcecks. If it does, immediately return with
success.

This was discovered during installation of
/usr/lib/systemd/systemd-bless-boot, which was not present in Ubuntu CI
(as the installed systemd was from the Ubuntu repositories), and the
binary itself was already in the image thanks to `ninja install`.
However, during extraction of binaries from the systemd service files,
another attempt to install this binary was made, which failed due to
`find_binary` being unable to find it.
2019-07-08 21:05:51 +02:00
Frantisek Sumsal f5f8cc7aed test: make ASAN/UBSAN_OPTIONS overridable from the outside
This should allow us to tweak the ASAN_OPTIONS and UBSAN_OPTIONS env
variables for integration tests as well
2019-07-09 02:00:14 +09:00
Yu Watanabe 16e233d0bb
Merge pull request #12970 from ddstreet/gh12969
src/network/networkd-dhcp4.c: set prefsrc for classless or static routes
2019-07-08 21:18:04 +09:00
Yu Watanabe c38d2d4d59 test-network: add tests for DHCP.UseRoutes=no with custom route settings
This adds test for b5799eeb07.

Closes #12951.
2019-07-06 08:23:10 +09:00
Yu Watanabe 4c882c16be test-network: add testcase for DHCP client with static address
Testcase for #12969.
2019-07-06 07:39:23 +09:00
Yu Watanabe 6f94379833 test-network: add tests for BridgeVLAN 2019-07-05 16:39:39 +09:00
Yu Watanabe aaae57139b test-network: show debug logs of networkd 2019-07-05 02:47:42 +09:00
Yu Watanabe e28fd95ffb test-network: add udev related tests for networkctl 2019-07-02 09:43:21 +02:00
Yu Watanabe 6b9518a0e8 test-network: add test for Property= in [Match] section 2019-07-01 06:53:35 +09:00
Yu Watanabe 44005bfb4e network,udev: add Property= setting in [Match] section
Closes #5665.
2019-07-01 01:24:42 +09:00
Zbigniew Jędrzejewski-Szmek 910c6d0931 Treat kernel version condition as a list of quoted checks
Before only one comparison was allowed. Let's make this more flexible:
ConditionKernelVersion = ">=4.0" "<=4.5"

Fixes #12881.

This also fixes expressions like "ConditionKernelVersion=>" which would
evaluate as true.
2019-06-29 17:11:03 +02:00
Yu Watanabe fd4487f01a test-execute: add test for ConditionKernelVersion= with quotation 2019-06-29 17:09:07 +02:00
Michal Koutný 594057fd99 tests: Check trivial loop between two jobs
job_compare return value is undefined in case the jobs have a loop
between them, so better make a test to make sure transaction cycle
detection catches it.
2019-06-26 23:16:31 +02:00
Michal Koutný 804cdabc31 tests: Check job ordering on execution cycles
The test-engine Test2 tests the cycle detection when units a, b and d
all start at once

    ,-------------------after-----------------,
    v                                         |
    a/start ---after---> d/start ---after---> b/start

Extend the test with Test11 that adds i.service which causes a and d
stop (by unordered Conflicts=) while starting b. Because stops precede
starts, we effectively eliminate the job cycle and all transaction jobs
should be applicable.

    ,-------------------after-----------------,
    v                                         |
    a/stop <---after--- d/stop <---after--- b/start
    .                   .                     ^
    .                   .                     |
     '. . . . . . . . . i/start ---after------'
2019-06-26 23:16:31 +02:00
Lennart Poettering 528c365658 test: add test for DynamicUser=0 → =1 migration (and back) 2019-06-25 10:47:46 +02:00
Yu Watanabe 2cf6fdff19 test-network: change default sleep time of start_networkd() 2019-06-18 13:10:23 +09:00
Yu Watanabe 90e3bcbd4d test-network: use wait-online in NetworkdBridgeTests 2019-06-18 13:10:23 +09:00
Yu Watanabe 35a78c5131 test-network: use wait-online in NetworkdBondTests 2019-06-18 12:45:19 +09:00
Yu Watanabe 8d17c386d7 test-network: use setUp() and tearDown() to clear routing policy rule tables 2019-06-18 12:45:17 +09:00
Yu Watanabe ad78d7b027 test-network: rename l2tp_tunnel_remove -> remove_l2tp_tunnels 2019-06-18 11:35:12 +09:00
Yu Watanabe 4ef39b4991 test-network: remove all routing policy rules in specified table 2019-06-18 11:35:12 +09:00
Evgeny Vereshchagin 9bd2422ac3 travis: turn on nonnull-attribute on Fuzzit 2019-06-15 23:12:24 +02:00
Zbigniew Jędrzejewski-Szmek 4b381a9ef6
Merge pull request #12753 from jrouleau/fix/hibernate-resume-timeout
hibernate-resume: fix resume device timeout
2019-06-15 17:50:37 +02:00
Zbigniew Jędrzejewski-Szmek 6ea420a3b6
Merge pull request #12796 from yuwata/test-network-use-wait-online
test-network: several cleanups
2019-06-15 14:53:04 +02:00
Yu Watanabe 4c2459c692 test-network: drop redundant operstate checking 2019-06-14 16:50:07 +09:00
Yu Watanabe df7f9afaa7 test-network: replace check_link_exists() with wait_online() 2019-06-14 16:49:39 +09:00
Yu Watanabe 01943d43f4 test-network: explicitly set sleep time 2019-06-14 16:47:40 +09:00
Yu Watanabe 5239d7b34e test-network: suppress error message in cleanup process 2019-06-14 16:45:50 +09:00
Yu Watanabe 1285edf39c test-network: add test for ConfigureWithoutCarrier= 2019-06-14 05:25:35 +09:00
Yu Watanabe 4933b97d59 test-network: add more test cases when ipv6 is disabled 2019-06-12 11:04:10 +09:00
Yu Watanabe 1e498853a3 test-network: add tests for KeepConfiguration= 2019-06-06 23:36:27 +09:00
Susant Sahani 7da377ef16 networkd: add support to keep configuration 2019-06-06 22:50:29 +09:00
Zbigniew Jędrzejewski-Szmek 88aaf89ecb networkd-tests.py: properly escape pluses in regexps
Python warns that '\+' is an invalid escape. We need either '\\+' or r'\+'.
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek ec38833c75 networkd-tests.py: remove some java-style boilerplate
A class was used to put some utility functions under a namespace. But then this
namespace was inherited into classes, so the namespace split was undone. Let's
just define those functions in the module namespace.

(The Utilities class with a few functions still remain, because of the
unittest-style self.assert* craziness.)
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek cefd6b3db8 networkd-tests.py: use check_output() instead of unittests' assertEqual()
It's pretty much the same thing, but more in pytest style, without the
unittest boilerplate.
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek 371810d18a networkd-tests.py: add helpers to common subprocess call patterns
For normal shell calls, python syntax is quite verbose. We don't need to punish
ourselves like that. In some places we would fork a shell to do argument splitting
for us. We know that our arguments can be safely split on whitespace, so let's do
that ourselves in all cases, without forking a shell.

We also expect command output to be valid text, so let's always set
universal_newlines=True.

This makes things shorter and easier to read. Development is also easier because
it's possible to paste many of the commands directly to/from a shell.
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek 632037cf4a networkd-tests.py: remove unused import 2019-06-06 13:58:58 +02:00
Jonathan Rouleau 8b6805a25b hibernate-resume: add resumeflags= kernel option
Adds the resumeflags= kernel command line option to allow setting a
custom device timeout for the resume device (defaults to the same as the
root device).
2019-06-05 18:59:05 -06:00
Yu Watanabe d90f4f7d91 test-network: do not directly compare two results of "ip address"
As it contains lifetime of the address.
2019-06-05 19:42:12 +09:00
Yu Watanabe e16ffe7954 test-network: do not allow addresses in tentative state 2019-06-05 16:35:20 +09:00
Yu Watanabe 78690bb5d0 test-network: disable SystemCallFilter= when *SAN is enabled 2019-06-04 01:29:28 +09:00
Yu Watanabe 6d5b4efed2 test-network: add test for MTU field of 'networkctl status' 2019-06-04 01:29:28 +09:00
Yu Watanabe bee692fd38 test-network: add tests for "networkctl delete" 2019-06-04 01:29:28 +09:00
Yu Watanabe 1ca44d7dfd test-network: move networkctl related tests to NetworkctlTests class 2019-06-04 01:29:24 +09:00
Yu Watanabe 72917fcc65 test-network: show systemd-networkd.service
As there may exist some other drop-in configs.
2019-05-31 13:58:27 +09:00
Yu Watanabe d4fda2a55c test-network: stop service before editing unit file 2019-05-31 09:52:48 +09:00
Yu Watanabe fa4c6095d7 test-network: add --lsan-options option 2019-05-31 08:52:27 +09:00
Yu Watanabe 94c0312294 test-network: make the test take ASAN and UBSAN options 2019-05-30 20:51:35 +09:00
Yu Watanabe 9c1ae4844e test-network: make path to networkd or friends configurable 2019-05-30 20:49:56 +09:00
Zbigniew Jędrzejewski-Szmek 8e30a1af24
Merge pull request #12690 from yuwata/test-network-and-man-netdev
test-network,man: trivial cleanups
2019-05-29 12:39:58 +02:00
Yu Watanabe 53c32c2b9b test-network: bump time limit for wait_address()
Maximum time interval of DHCPv4 request is 63sec.
So, setting 100sec is enough.
2019-05-29 12:37:41 +02:00
Yu Watanabe 931d11057c test-network: drop 25-nlmon.network 2019-05-29 17:07:06 +09:00
Yu Watanabe 0feeac6418
Merge pull request #12635 from yuwata/nlmon-support
network: add nlmon support
2019-05-29 10:22:09 +09:00
Yu Watanabe 811f33d0b1 test-network: add a basic test for nlmon 2019-05-28 22:47:20 +09:00
Yu Watanabe 8ad8292452 test-network: use wait_online() in NetworkdDHCPServerTests or friends 2019-05-28 22:21:25 +09:00
Yu Watanabe fdcd1ec54a test-network: move test_domain() to NetworkdNetworkTests class 2019-05-28 22:21:24 +09:00
Yu Watanabe be68c2c965 test-network: rename needlessly long class names 2019-05-28 22:21:24 +09:00
Yu Watanabe 2629df4710 test-network: use wait_online() instead of waiting for 10 seconds
But some tests requires both IPv4 and IPv6 addresses are configured.
Only in that case wait for addresses to be configured.
2019-05-28 22:21:24 +09:00
Yu Watanabe 58df8fb7dc test-network: drop unused link 2019-05-28 22:21:24 +09:00
Yu Watanabe 350e05d274 test-network: rename link_remove() to remove_links() 2019-05-28 22:21:24 +09:00
Yu Watanabe 5f68a6a46a test-network: remove routes even on failure 2019-05-28 22:21:24 +09:00
Yu Watanabe 95c74b0aff test-network: use setUp() and tearDown() to delete routing policy rule tables 2019-05-28 22:21:24 +09:00
Yu Watanabe def9fc0d65 test-network: remove fou ports on failure 2019-05-28 22:21:24 +09:00
Yu Watanabe 9f10126f3c test-network: stop dnsmasq before removing links 2019-05-28 22:21:24 +09:00
Yu Watanabe 1836bedf92 test-network: warn when firewalld.service is running 2019-05-28 22:21:24 +09:00
Yu Watanabe b6efd6614c test-network: add tests for issue #12490 2019-05-28 22:21:23 +09:00
Zbigniew Jędrzejewski-Szmek 3f8841f286
Merge pull request #12653 from yuwata/test-network-improvements-2
network: fix configuring vxcan devices and several test-network follow-ups
2019-05-28 10:27:58 +02:00
Frantisek Sumsal d0533a319b test: correctly fail when system is borked
In certain situations, the systemctl commands may fail (e.g. due to
missing shared libraries), but the 'script' continues and creates a
/testok file, marking the test incorrectly as passed. Let's fix this and
bail out immediately when a command exits with a non-zero exit code.
2019-05-27 22:31:55 +03:00
Frantisek Sumsal 37ee8dc80f test: improve handling of ASan under clang
Running integration tests with ASan is somewhat tricky to begin with, as
we need to pre-load the ASan runtime DSO for certain services (like
dbus), otherwise they won't start or behave as expected. In case of gcc
this is pretty easy, as we need the runtime DSO during compilation, so
it's already present on the host system. For clang things get more
complicated, as ASan is compiled in statically by default, thus to
enable the necessary dynamic-ish behavior one needs to compile with
-shared-libasan and then correctly set LD_PRELOAD_PATH, as the runtime
libraries are not in a standard library path.
2019-05-27 17:46:07 +02:00
Lennart Poettering a429223d17 test-execute: turn off coredump generation in test services
These services are likely to coredump, and we expect that but aren't
interested in the coredump. Hence let's turn off processing by setting
RLIMIT_CORE to 0/0.
2019-05-24 10:48:28 +02:00
Lennart Poettering 05332e243c
Merge pull request #12590 from keszybz/unicode-cmdlines
Use unicode for cmdline printing
2019-05-24 10:41:30 +02:00
Yu Watanabe f63b14d35e test-network: add basic tests for vxcan device 2019-05-24 10:56:54 +09:00
Yu Watanabe 0aefa2274d test-network: add more tests for LinkLocalAddressing=yes on various netdevs 2019-05-24 10:54:53 +09:00
Yu Watanabe 241836a87c test-network: drop pure test for dummy device
The dummy device is well used in test-network. So, the dropped test
is completely redundant.
2019-05-23 23:55:57 +09:00
Yu Watanabe b08b056e19 test-network: drop redundant check_link_exists()
When wait_online() passes, then the link must exist.
2019-05-23 23:45:53 +09:00
Yu Watanabe a43b1f8267
Merge pull request #12618 from yuwata/test-network-improvements
network: several cleanups
2019-05-23 11:17:33 +09:00
Zbigniew Jędrzejewski-Szmek 9e099c9fd8
Merge pull request #12431 from poettering/tmpfiles-chmod-chown-order
tmpfiles: run chown() before chmod()
2019-05-22 17:23:28 +02:00
Yu Watanabe 17bcf0a09f test-network: drop wait_online() from test_ip6gre_tunnel() 2019-05-22 18:02:20 +09:00
Yu Watanabe be0e1ef9b5 test-network: wait for bridge slave to be enslaved in test_bridge_ignore_carrier_loss_frequent_loss_and_gain() 2019-05-22 17:59:39 +09:00
Yu Watanabe 0a5dced161 test-network: drop unused variable 2019-05-22 17:58:46 +09:00
Yu Watanabe a1b3559088 test-network: add test that vcan device can be configured state 2019-05-22 17:58:46 +09:00
Yu Watanabe 671dacdf0c test-network: add basic tests for veth interfaces 2019-05-22 17:58:46 +09:00
Yu Watanabe 2746d30797 test-network: add tests for flags of tun or tap devices 2019-05-22 17:58:46 +09:00
Yu Watanabe 75eed300a9 network: Allow IFF_VNET_HDR to also be set for tun devices
f5f07dbf06 adds VnetHeader= for tap
devices, but the flag is also used for tun devices.
This adds VnetHeader= setting in [Tun] section.
2019-05-22 17:58:46 +09:00
Yu Watanabe 077f9abc3a test-network: add tests for LinkLocalAddressing= on ipvlan or friends 2019-05-22 17:58:46 +09:00
Yu Watanabe 40921f0886 test-network: add tests for Flags= in [IPVTAP] 2019-05-22 17:58:46 +09:00
Yu Watanabe bc6dff6e25 test-network: add tests for Flags= in [IPVLAN] 2019-05-22 17:58:46 +09:00
Yu Watanabe 460feb6127 test-network: add tests for Mode= setting in [MACVTAP] section 2019-05-22 17:58:46 +09:00
Yu Watanabe dff9792b15 test-network: add tests for Mode= setting in [MACVLAN] section 2019-05-22 17:58:46 +09:00
Yu Watanabe 3d16512423 test-network: convert jiffies to sec 2019-05-22 17:58:46 +09:00
Yu Watanabe 8d7f098756 test-network: show interface status when wait_online() fails 2019-05-22 17:58:46 +09:00
Yu Watanabe a9a2ee6a96 test-network: use wait_online() more 2019-05-22 17:58:46 +09:00
Yu Watanabe e39cc4450d test-network: introduce check_link_exists() 2019-05-22 17:58:46 +09:00
Yu Watanabe c815f33e70 test-network: use wait_online() more 2019-05-22 17:58:46 +09:00
Yu Watanabe 881b1f358f test-network: use splitlines() at one more place 2019-05-22 17:58:46 +09:00
Zbigniew Jędrzejewski-Szmek 77599f06e1 cgtop,test: use consistent capitalization for CGroup 2019-05-21 10:57:23 +02:00
Yu Watanabe 826c4f35c6
Merge pull request #12612 from keszybz/bootctl-column
Rename TEST-31-OOMPOLICY to avoid conflict and look in $BOOT for kernels
2019-05-21 07:45:12 +09:00
Yu Watanabe a166cd3aac
Merge pull request #12603 from ssahani/ndisc-blacklist
networkd: Ability to selectively ignore IPv6 prefixes supplied via ro…
2019-05-19 23:19:27 +09:00
Susant Sahani e520ce6440 networkd: Ability to selectively ignore IPv6 prefixes supplied via router advertisement
Closes https://github.com/systemd/systemd/issues/10647
2019-05-19 22:23:06 +09:00
Zbigniew Jędrzejewski-Szmek d04876b143 TEST-32-OOMPOLICY: drop unneeded headers 2019-05-19 13:03:21 +02:00
Zbigniew Jędrzejewski-Szmek 5c305ce2db test: rename TEST-31-OOMPOLICY to TEST-32-OOMPOLICY
TEST-31-DEVICE-ENUMERATION got merged first.
2019-05-19 13:00:00 +02:00
Zbigniew Jędrzejewski-Szmek 95cff2a794 test: search $BOOT for kernel+initrd
$BOOT is the preferred location for kernel images. If $BOOT does not
exist, -x will print the path to ESP, so well fall back to previous
behaviour.
2019-05-19 12:05:21 +02:00
Yu Watanabe 2700d2c7dc test-network: wait for bond interface to be no-carrier operational state 2019-05-19 05:39:45 +09:00
Yu Watanabe ce87a19087 test-network: enable universal_newline= flag for subprocess.check_output() 2019-05-19 05:39:21 +09:00
Yu Watanabe 4b3cf93507 test-network: remove unnecessary links 2019-05-19 05:29:25 +09:00
Yu Watanabe 3ccf7af087 test-network: fix underlying device name 2019-05-19 05:27:56 +09:00
Yu Watanabe 791c1140c9 test-network: use check_operstate() helper function where applicable 2019-05-19 05:27:56 +09:00
Yu Watanabe 2be0b6fc5e test-network: add get_operstate() and check_operstate() helper functions 2019-05-19 05:27:46 +09:00
Yu Watanabe e7b621ee1f
Merge pull request #12586 from ssahani/route-properties
Route properties
2019-05-18 10:31:37 +09:00
Susant Sahani 9b88f20aba networkd: route add MPLS TTL propagate 2019-05-18 10:30:41 +09:00
Susant Sahani 8f02c9b085 networkd: FOU netdev add support to configure peer port 2019-05-18 10:25:36 +09:00
Zbigniew Jędrzejewski-Szmek be44e09162 shared/varlink: add missing setting of output_buffer_allocated
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14708,
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14735,
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14725,
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14720,
and probably others.
2019-05-17 15:09:32 +02:00
Yu Watanabe 8688c29b5a varlink: initialize Varlink with 0
Closes oss-fuzz#14688.
2019-05-16 18:51:33 +02:00
Yu Watanabe a32a00831c
Merge pull request #12574 from yuwata/network-mtu-issue-12552
network: do not always bump MTU with additional 4bytes
2019-05-16 08:25:48 +02:00
Yu Watanabe 4e14e54638
Merge pull request #12549 from yuwata/network-sittun-disable-link-local-addressing-12547
network: disable LinkLocalAddressing on sit devices
2019-05-16 05:11:05 +02:00
Yu Watanabe db439337f9
Merge pull request #12576 from ssahani/fou
networkd: FOU tunnel support Local and Peer tunnel addresses
2019-05-16 05:10:35 +02:00
Yu Watanabe 7d7be1b9d8 test-network: adjust mtu 2019-05-16 11:51:07 +09:00
Yu Watanabe 11309591a5 test-network: check tunnel netdevs become operstate 'routable' 2019-05-16 10:37:11 +09:00
Susant Sahani 4502a61c8a networkd: FOU tunnel support Local and Peer tunnel addresses 2019-05-16 10:24:48 +09:00
Yu Watanabe 956c8feca4 test-network: add a basic test for ipvtap 2019-05-16 09:48:53 +09:00
Susant Sahani 69c317a07f networkd: introduce netdev ipvtap
This patch adds netdev ipvtap that is based on the
IP-VLAN network interface, called ipvtap. An ipvtap device can be created
in the same way as an ipvlan device, using 'kind ipvtap', and then accessed
using the tap user space interface.
2019-05-16 09:48:53 +09:00
Yu Watanabe 2b00dff809 test-network: add a test for IPv4LLRoute= 2019-05-15 12:44:30 +09:00
Yu Watanabe 6543b7fd78 test-network: add tests for DefaultRouteOnDevice= 2019-05-15 12:44:30 +09:00
Yu Watanabe 5d5003ab35 network: add DefaultRouteOnDevice= setting in [Network] section
When enabled, then default route bound to the interface will be created.
This is useful when adding routes on point-to-point interfaces.

Closes #788.
2019-05-15 12:44:30 +09:00
Yu Watanabe 6e114a2475
Merge pull request #12555 from ssahani/route-properties
networkd: route add support to configure fastopen_no_cookie
2019-05-14 09:03:52 +02:00
Susant Sahani 1501b429a9 networkd: DHCP client add support to send RELEASE packet
closes #10820
2019-05-14 09:03:01 +02:00
Susant Sahani 633c725865 networkd: route add support to configure fastopen_no_cookie
This patch adds fastopen_no_cookie option to enable/disable TCP fastopen
without a cookie on a per-route basis.
2019-05-14 08:08:36 +05:30
Susant Sahani bdb397ed10 networkd: bridge FDB support more NTF_* flags
Add support to configure NTF_ROUTER and NTF_USE
2019-05-14 02:24:51 +02:00
Yu Watanabe d8f31d7d32
Merge pull request #12537 from yuwata/network-link-local-follow-ups
network: do not send ipv6 token to kernel
2019-05-14 02:22:18 +02:00
Evgeny Vereshchagin 1328a4bcc9
Merge pull request #12524 from evverx/UBSan-reports
tests: stop sending UBsan reports to /dev/null
2019-05-12 05:17:16 +03:00
Evgeny Vereshchagin a5372344ea tests: override a hard-coded timeout that kicks in too early (under ASan+UBSan)
The test has failed two times today: https://travis-ci.org/systemd/systemd/jobs/530750626
and https://travis-ci.org/systemd/systemd/jobs/530759465.
2019-05-12 03:37:36 +02:00
Evgeny Vereshchagin 6141c6c99b tests: redirect the stdout/stderr of journald to a file (under ASan+UBSan)
Sometimes UBSan sends its reports to stderr regardless of what is specified in log_path
Let's try to catch them by redirecting stderr (and stdout just in case) to a file
See https://github.com/systemd/systemd/pull/12524#issuecomment-491108821
2019-05-12 03:37:36 +02:00
Evgeny Vereshchagin abf9b52ccd tests: redirect UBsan reports to a file
so that they won't end up in /dev/null
2019-05-12 03:37:36 +02:00
Yu Watanabe 3a956d388a test-network: add a tiny test for IPv6Token= 2019-05-12 07:34:13 +09:00
Yu Watanabe cd43199671
Merge pull request #12520 from ssahani/geneve
networkd: Geneve add DF feature and allow TTL to bechosen by kernel
2019-05-10 19:47:19 +02:00
Evgeny Vereshchagin c778f8c992
Merge pull request #12521 from mrc0mmand/test-functions-tweaks-for-sanitizers
test: don't preload libasan for systemd-remount-fs.service
2019-05-10 17:17:23 +03:00
Susant Sahani aac350192b networkd: Geneve add support configure IP don't fragment 2019-05-10 22:45:26 +09:00
Yu Watanabe 5af7bc6f4c
Merge pull request #12480 from ssahani/proxy-arp
network: bridge add support to configure proxy ARP/WIFI
2019-05-10 15:30:41 +02:00
Susant Sahani 727b573418 networkd: Add support for blacklisting servers
closes #6260

fuzzer: Add DHCP support for blacklisting servers
2019-05-10 15:29:55 +02:00
Lennart Poettering d768467563 fuzzer: add varlink fuzzer 2019-05-09 14:14:20 -04:00
Frantisek Sumsal 54a3790ccb test: allow SKIP_INITRD override
Certain distributions (e.g. Arch Linux) require booting with initrd, as
they lack support for commonly used filesystems in the kernel (i.e. the
support is compiled in as modules)
2019-05-09 20:11:31 +02:00
Frantisek Sumsal aaef1ed21d test: don't preload libasan for systemd-remount-fs.service
The `mount` utility has an unexpected behavior when run with libasan,
causing false-positives during the integration testing.

For example, on Arch Linux with LD_PRELOAD pointing to libasan:
```
bash-5.0# mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
1
```
However:
```
bash-5.0# LD_PRELOAD= mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
0
```
Further investigation with strace shows a LeakSanitizer error:
```
bash-5.0# strace -s 512 mount -o remount,rw -v /
...
write(2, "==355==LeakSanitizer has encountered a fatal error.\n", 52) = -1 EBADF (Bad file descriptor)
write(2, "ReportFile::Write() can't output requested buffer!\n", 51) = -1 EBADF (Bad file descriptor)
exit_group(1)                           = ?
+++ exited with 1 +++
```

Let's workaround this by clearing the LD_PRELOAD variable for
systemd-remount-fs.service
2019-05-09 20:11:20 +02:00
Susant Sahani 0fadb2a46f network: add support to configure proxy ARP/WIFI 2019-05-09 15:03:04 +09:00
Susant Sahani 1189c00a3c networkd: VXLAN add support to configure IP Don't fragment.
Allow users to set the IPv4 DF bit in outgoing packets, or to inherit its
value from the IPv4 inner header. If the encapsulated protocol is IPv6 and
DF is configured to be inherited, always set it.
2019-05-09 06:40:33 +02:00
Susant Sahani 1087623bac networkd: Add support to configure proxy ARP and proxy ARP Wifi 2019-05-09 01:44:26 +02:00
Chris Down 465ace74d9 cgroup: Test that it's possible to set memory protection to 0 again
The previous commit fixes this up, and this should prevent it
regressing.
2019-05-08 12:06:32 +01:00
Zbigniew Jędrzejewski-Szmek d1c377da0d
Merge pull request #12489 from ssahani/vxlan
networkd: VXLAN rename Id to VNI
2019-05-08 12:02:54 +02:00
Susant Sahani 61b824c561 networkd: bridge fdb add support to configure VXLAN VNI 2019-05-08 03:43:43 +02:00
Zbigniew Jędrzejewski-Szmek 29e19a6f19 fuzz: fix spelling of MACsec and MACAddress in the corpus 2019-05-08 06:53:07 +05:30
Susant Sahani 4cc0fd7531 networkd: VXLAN add support to configure Generic Protocol Extension
See https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07
2019-05-08 06:52:42 +05:30
Zbigniew Jędrzejewski-Szmek 9175aabfb6
Merge pull request #12481 from ssahani/dhcp-max-retry
networkd: Allow DHCP4 client to set the number to attempt to configure/reconfigure
2019-05-07 19:58:40 +02:00
Susant Sahani 6f213e4a34 networkd: VXLAN rename Id to VNI
It makes more sense to call VXLAN ID as

1. the VXLAN Network Identifier (VNI) (or VXLAN Segment ID)
2. test-network: rename VXLAN Id to VNI
3. fuzzer: Add VXLAN VNI directive to fuzzer
2019-05-07 20:52:11 +05:30
Yu Watanabe 117a55c755 test-network: add one more test for LinkLocalAddressing=fallback 2019-05-07 17:12:09 +02:00
Susant Sahani 715cedfbf0 networkd: Allow DHCP4 client to set the number to attempt to reconfigure.
Otherwise current value is 6 and after 6 it will give up.
2019-05-07 17:12:04 +02:00
Yu Watanabe b30160ff7f
Merge pull request #12478 from yuwata/wireguard-fwmark
network: rename WireGuard.FwMark -> FirewallMark
2019-05-07 05:16:34 +02:00