Commit Graph

1369 Commits

Author SHA1 Message Date
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