Commit Graph

1875 Commits

Author SHA1 Message Date
Yu Watanabe 63b00fa77d
Merge pull request #15619 from ddstreet/ignore_carrier_loss_default
Set IgnoreCarrierLoss= default to value of ConfigureWithoutCarrier=
2020-05-29 10:04:00 +09:00
Lennart Poettering a3d19f5d99 core: add new PassPacketInfo= socket unit property 2020-05-27 22:40:38 +02:00
Lennart Poettering bb2294e454
Merge pull request #15669 from andir/systemd-ipv6-pd-subnet-id
networkd: subnet id support for ipv6 prefix delegation
2020-05-27 18:47:26 +02:00
Lennart Poettering 6bce17455e
Merge pull request #15226 from benzea/benzea/xdg-autostart-generator
xdg-autostart-generator: a generator for XDG autostart files
2020-05-27 18:41:01 +02:00
Frantisek Sumsal ffbb0fb9cb meson: support building fuzzers with meson <0.48.0 2020-05-27 12:27:45 +02:00
Benjamin Berg 2ad7597e44 fuzz: Add an XDG desktop file fuzzer
To test the XDG parser used by the xdg-autostart-generator.

Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-05-27 09:02:10 +02:00
Frantisek Sumsal 2991fa41e4 test: create public images by default
Let's create new images public by default and then symlink/copy them
into the respective private directories afterwards, not the other way
around. This should fix a nasty race condition in parallel runs where
one tests attempts to copy the backing public image at the same moment
another test is already modifying it.
2020-05-27 08:41:02 +02:00
Frantisek Sumsal 8441ff6886 test: make the systemd-run calls synchronous
Otherwise we might be checking results of such calls before they even
finish, causing nasty races like:

```
[   15.656530] testsuite-43.sh[303]: + su testuser -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID exec "$@"' -- sh systemd-run --user --unit=test-unprotected-home -P touch /home/testuser/works.txt
...
[   15.757744] testsuite-43.sh[324]: Running as unit: test-unprotected-home.service
[   15.775611] systemd[296]: Started /usr/bin/touch /home/testuser/works.txt.
[   15.783597] testsuite-43.sh[303]: + test -e /home/testuser/works.txt
[   15.787542] systemd[296]: test-unprotected-home.service: Succeeded.
...
[   15.787684] systemd[1]: Received SIGCHLD from PID 303 (bash).
[   15.787790] systemd[1]: Child 303 (bash) died (code=exited, status=1/FAILURE)
[   15.787881] systemd[1]: testsuite-43.service: Child 303 belongs to testsuite-43.service.
[   15.788040] systemd[1]: testsuite-43.service: Main process exited, code=exited, status=1/FAILURE
[   15.788224] systemd[1]: testsuite-43.service: Failed with result 'exit-code'.
[   15.788333] systemd[1]: testsuite-43.service: Service will not restart (restart setting)
[   15.788421] systemd[1]: testsuite-43.service: Changed start -> failed
[   15.788790] systemd[1]: testsuite-43.service: Job 160 testsuite-43.service/start finished, result=failed
[   15.788995] systemd[1]: Failed to start testsuite-43.service.
```
2020-05-27 08:36:57 +02:00
Dan Streetman 0fc0d85fae test: add bridge configure-without-carrier test
Verify configure-without-carrier works, and retains configuration
across carrier losses/gains.
2020-05-26 09:52:55 -04:00
Dan Streetman 9bacf4313e test: expand configure-without-carrier test
The test currently doesn't actually test configure-without-carrier since
it does have carrier for the entire test.  It now forces carrier down
before starting the network portion of the test. Also, it tests to verify
the configuration is retained across future carrier losses/gains.
2020-05-26 09:52:55 -04:00
Andreas Rammhold 02e9e34bd9
networkd: Add support for setting a preferred subnet id for IPv6 PD leases
This allows users to configure a subnet id that should be used instead
of automatically (sequentially) assigned subnets. The previous attempt
had the downside that the subnet id would not be the same between
networkd restarts. In some setups it is desirable to have predictable
subnet ids across restarts of services and systems.

The code for the assignment had to be broken up into two pieces. One of
them is the old (sequential) assignment of prefixes and the other is the
new assignment based on configured subnet ids. The new assignment code
has to be executed first and has to be taken into account when (later
on) allocating the "old" subnets from the same pool.

Instead of having one iteration through the links we are now trying to
allocate a prefix for every link on every delegated prefix, unless they
received an assignment in a previous iteration.
2020-05-26 12:41:22 +02:00
Evgeny Vereshchagin e5af586f49 add a test triggering https://github.com/systemd/systemd/issues/15907 2020-05-26 09:01:26 +02:00
Lennart Poettering 1283366a90
Merge pull request #15167 from ssahani/address-gen-mode
networkctl: Add a range to address genmode
2020-05-25 17:32:00 +02:00
Topi Miettinen cc1c85fbc3 login: limit nr_inodes for /run/user/$UID
Limit number of inodes for tmpfs mounts on /run/user/$UID. Default is
RuntimeDirectorySize= divided by 4096.
2020-05-24 22:54:17 +02:00
Evgeny Vereshchagin 3c60fb077f
Merge pull request #15886 from mrc0mmand/travis-enable-fuzz-tests
travis: enable fuzzer regression tests under sanitizers
2020-05-23 19:21:44 +03:00
Frantisek Sumsal 87666b31f9 meson: pass the optimization level to the fuzzer build 2020-05-23 14:19:25 +02:00
Evgeny Vereshchagin 0d5266541c tests: add a testcase for https://github.com/systemd/systemd/issues/15885 2020-05-22 13:35:00 +02:00
Zbigniew Jędrzejewski-Szmek 766507972b
Merge pull request #15433 from mrc0mmand/test-reintroduce-parallelization
test: copy the test image instead of symlinking it
2020-05-21 17:56:33 +02:00
Susant Sahani a6f1848a23 network: Allow to configure addr_gen_mode
Defines how link-local and autoconf addresses are generated.

	0: generate address based on EUI64 (default)
	1: do no generate a link-local address, use EUI64 for addresses generated
	   from autoconf
	2: generate stable privacy addresses, using the secret from
	   stable_secret (RFC7217)
	3: generate stable privacy addresses, using a random secret if unset
2020-05-21 14:41:04 +02:00
Evgeny Vereshchagin a88dce2bdd
Merge pull request #15865 from evverx/ubsan-to-the-rescue
build-system: build the fuzz targets with both ASan and UBSan
2020-05-21 03:17:20 +03:00
Zbigniew Jędrzejewski-Szmek 929d07ddcb
Merge pull request #15274 from ssahani/network-issue-9610
DHCP4: Allow lease time to be set when missing from offer
2020-05-20 16:39:41 +02:00
Lennart Poettering 400530c1e2
Merge pull request #15490 from ssahani/dhcpv6-vendor-class
network: DHCPv6 - Add support to send vendor class information
2020-05-20 16:18:18 +02:00
Evgeny Vereshchagin 8976715804 build-system: build the fuzz targets with both ASan and UBSan
Just a follow-up to https://github.com/systemd/systemd/pull/15860
2020-05-20 16:07:13 +02:00
Zbigniew Jędrzejewski-Szmek a94d11cc66
Merge pull request #15860 from keszybz/bus-message-empty-fields
Fix crash on message with empty fields structure
2020-05-20 15:53:28 +02:00
Zbigniew Jędrzejewski-Szmek bb94ded693
Merge pull request #15661 from hundeboll/mount-read-write-only
Mount read write only
2020-05-20 15:48:04 +02:00
Zbigniew Jędrzejewski-Szmek e0c17a7d1b bus-message: fix negative offset with ~empty message
In the linked reproducer, m->fields_size == 0, and we calculate ri == -1, which
of course doesn't end well. Skip the whole calculation if m->fields_size == 0,
and also check that we don't go negative even if it is non-zero.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19446 and #15583.
2020-05-20 09:33:54 +02:00
Susant Sahani ed0d1b2e99 network: DHCPv6 - Add support to send vendor class information
Frame 1: 177 bytes on wire (1416 bits), 177 bytes captured (1416 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x5ca46b
    Rapid Commit
    Identity Association for Non-temporary Address
    Fully Qualified Domain Name
    Vendor Class
        Option: Vendor Class (16)
        Length: 23
        Value: 0000ab11000048656c6c6f3a686f773a6172653a796f75
        Enterprise ID: Tom Gundersen (systemd) (43793)
        vendor-class-data: Hello:how:are:you
    Identity Association for Prefix Delegation
    Option Request
    Client Identifier
    Elapsed time
2020-05-20 07:58:03 +02:00
Susant Sahani d6463307e0 network: DHCPv4- Allow to set DHCP lease lifetime 2020-05-20 06:32:26 +02:00
Susant Sahani f37f2a6b8a network: DHCPv6 - Add support to send user class
Frame 115: 171 bytes on wire (1368 bits), 171 bytes captured (1368 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x673257
    Rapid Commit
        Option: Rapid Commit (14)
        Length: 0
    Identity Association for Non-temporary Address
        Option: Identity Association for Non-temporary Address (3)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Fully Qualified Domain Name
        Option: Fully Qualified Domain Name (39)
        Length: 6
        Value: 01045a657573
        0000 0... = Reserved: 0x00
        .... .0.. = N bit: Server should perform DNS updates
        .... ..0. = O bit: Server has not overridden client's S bit preference
        .... ...1 = S bit: Server should perform forward DNS updates
        Client FQDN: Zeus
    User Class
        Option: User Class (15)
        Length: 17
        Value: 000f68656c6c6f30313233343031323334
    Identity Association for Prefix Delegation
        Option: Identity Association for Prefix Delegation (25)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Option Request
        Option: Option Request (6)
        Length: 10
        Value: 001700180038001f000e
        Requested Option code: DNS recursive name server (23)
        Requested Option code: Domain Search List (24)
        Requested Option code: NTP Server (56)
        Requested Option code: Simple Network Time Protocol Server (31)
        Requested Option code: Rapid Commit (14)
    Client Identifier
        Option: Client Identifier (1)
        Length: 14
        Value: 00020000ab11d258482fc7eee651
        DUID: 00020000ab11d258482fc7eee651
        DUID Type: assigned by vendor based on Enterprise number (2)
        Enterprise ID: Tom Gundersen (systemd) (43793)
        Identifier: d258482fc7eee651
    Elapsed time
        Option: Elapsed time (8)
        Length: 2
        Value: 0bd0
        Elapsed time: 30240ms
2020-05-19 11:48:30 +02:00
Susant Sahani 35f6a5cb44 network: DHCPv6 - Add support set arbitary request options 2020-05-17 11:18:29 +02:00
Frantisek Sumsal 7a57256c73 test: introduce TEST_PARALLELIZE to support running tests in parallel
Support running tests in parallel by switching to copying of the
base image instead of symlinking it..

This still requires some setup steps, like running `make setup` on tests
which have unique $IMAGE_NAME beforehand (and sequentially), otherwise
they'll all try to create the same base image when started in parallel,
leading to nasty issues. However, as running the integration tests in
parallel is such an unusual use case it should be good enough, for now.
2020-05-17 10:48:16 +02:00
Frantisek Sumsal e89450921f test: fix public/private image detection and prefer the latter one 2020-05-17 10:46:34 +02:00
Frantisek Sumsal 3be6f50117 test: unify quotation around image names 2020-05-17 10:43:08 +02:00
Frantisek Sumsal c07f18ffd4 shared: fix integer overflow in calendarspec
Fixes: oss-fuzz#22208

```
test/fuzz/fuzz-calendarspec/oss-fuzz-22208... ../src/shared/calendarspec.c:666:48: runtime error: signed integer overflow: 2147000000 + 1000000 cannot be represented in type 'int'
    #0 0x7f0b9f6cc56a in prepend_component ../src/shared/calendarspec.c:666
    #1 0x7f0b9f6cd03a in parse_chain ../src/shared/calendarspec.c:718
    #2 0x7f0b9f6cea1c in parse_calendar_time ../src/shared/calendarspec.c:845
    #3 0x7f0b9f6d1397 in calendar_spec_from_string ../src/shared/calendarspec.c:1084
    #4 0x401570 in LLVMFuzzerTestOneInput ../src/fuzz/fuzz-calendarspec.c:17
    #5 0x401ae0 in main ../src/fuzz/fuzz-main.c:39
    #6 0x7f0b9e31b1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
    #7 0x40122d in _start (/home/fsumsal/repos/systemd/build/fuzz-calendarspec+0x40122d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/shared/calendarspec.c:666:48 in
```
2020-05-15 16:07:29 +02:00
Susant Sahani 89fe653544 network: Add support to group links.
Link groups are similar to port ranges found in managed switches.
You can add network interfaces to a numbered group and perform operations
on all the interfaces from that group at once.
2020-05-15 15:27:07 +02:00
Rubens Figueiredo 4df4df5b56 network: allow setting VLAN protocol on bridges
Signed-off-by: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
2020-05-14 17:59:57 +02:00
Benjamin Robin d38b3b74db test: Stricter test case for #15654 (Add more checks)
Check:
 - There is only 3 messages logged with type stdout
 - Check all messages logged does not have new line: LINE_BREAK=eof
 - Check that the 3 messages are logged from a different PID
 - Check the 3 MESSAGE= content
2020-05-13 21:32:45 +02:00
Benjamin Robin c11d8fd1da test: Add a test case for #15654 2020-05-13 21:32:42 +02:00
Andrew Doran e7d5fe17db DHCP client: make SendOption work for DHCPv6 too. 2020-05-11 16:31:08 +02:00
Michael Chapman 708961c701 core/path: recheck path specs when triggered unit changes state
As documented in systemd.path(5):

    When a service unit triggered by a path unit terminates (regardless
    whether it exited successfully or failed), monitored paths are
    checked immediately again, and the service accordingly restarted
    instantly.

This commit implements this behaviour for PathExists=, PathExistsGlob=,
and DirectoryNotEmpty=. These predicates are essentially
"level-triggered": the service should be activated whenever the
predicate is true. PathChanged= and PathModified=, on the other hand,
are "edge-triggered": the service should only be activated when the
predicate *becomes* true.

The behaviour has been broken since at least as far back as commit
8fca6944c2 ("path: stop watching path specs once we triggered the target
unit"). This commit had systemd stop monitoring inotify whenever the
triggered unit was activated. Unfortunately this meant it never updated
the ->inotify_triggered flag, so it never rechecked the path specs when
the triggered unit deactivated.

With this commit, systemd rechecks all paths specs whenever the
triggered unit deactivates. If any PathExists=, PathExistsGlob= or
DirectoryNotEmpty= predicate passes, the triggered unit is reactivated.

If the target unit is activated by something outside of the path unit,
the path unit immediately transitions to a running state. This ensures
the path unit stops monitoring inotify in this situation.

With this change in place, commit d7cf8c24d4 ("core/path: fix spurious
triggering of PathExists= on restart/reload") is no longer necessary.
The path unit (and its triggered unit) is now always active whenever
the PathExists= predicate passes, so there is no spurious restart when
systemd is reloaded or restarted.
2020-05-05 13:56:02 +10:00
Martin Hundebøll c600357ba6 mount: add ReadWriteOnly property to fail on read-only mounts
Systems where a mount point is expected to be read-write needs a way to
fail mount units that fallback as read-only.

Add a property to allow setting the -w option when calling mount(8).
2020-05-01 13:23:30 +02:00
Zbigniew Jędrzejewski-Szmek b76ef59756
Merge pull request #13512 from msekletar/freezer
core: introduce support for cgroup freezer
2020-05-01 07:52:29 +02:00
Dan Streetman cad6727906 test: find path for systemd-journal-remote
As Debian/Ubuntu use /lib/systemd instead of /usr/lib/systemd,
add systemd-journal-remote to the list of programs that test-functions
detects the correct path to, and replace its direct usage with
$SYSTEMD_JOURNAL_REMOTE

Also use $JOURNALCTL instead of journalctl.

Also minor correction in install_plymouth() to look in /lib/... as
well as /usr/lib/... and /etc/...
2020-04-30 22:33:47 +02:00
Michal Sekletár d446ae89c0 test: add test for cgroup v2 freezer support 2020-04-30 19:02:55 +02:00
nabijaczleweli e81f5fc4e8
link: Allow configuring RX mini and jumbo ring sizes, too
This now covers all ethtool_ringparam configurables (as of v5.6;
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/ethtool.h?h=v5.6#n488)
2020-04-29 18:57:13 +02:00
Lennart Poettering b70cc80ffb
Merge pull request #15544 from poettering/fix-journalctl-namespace
sd-journal: fix namespace check
2020-04-23 12:19:25 +02:00
Zbigniew Jędrzejewski-Szmek ca57eed2e1
Merge pull request #15527 from Werkov/mkosi-opensuse
Add mkosi config for openSUSE Tumbleweed
2020-04-23 11:00:02 +02:00
Kumar Kartikeya Dwivedi 5c568be167 test: add a test case for #15528 2020-04-23 09:24:17 +02:00
Zbigniew Jędrzejewski-Szmek 73781de41f
Merge pull request #15530 from ssahani/lpr-dhcpv4-option-9
network: add support to DHCPv4 server/client option 9 LPR
2020-04-23 09:10:14 +02:00
Susant Sahani d361b3730a network: Add support send and receive LPR servers 2020-04-22 14:49:27 +02:00
Michal Koutný 9acb2964d7 test: Simplify hostname checking
Both hostname and uname utilities boil down to uname(2) syscall. Reduce
tests dependency footprint by using uname for checking hostname too.
2020-04-22 10:35:12 +02:00
Frantisek Sumsal 80b44b38b5 test: correctly clean up test artifacts
Remove the artifact files indicating test result (testok, failed, and
skipped) just before running the test so we always get the latest and
most relevant result instead of incorrectly consuming previous results.

Discovered in https://github.com/systemd/systemd/pull/15378#issuecomment-616801873
2020-04-22 08:57:38 +02:00
Zbigniew Jędrzejewski-Szmek 2807b68019
Merge pull request #15520 from mrc0mmand/various-codebase-improvements
tree-wide: various codebase improvements
2020-04-22 08:41:38 +02:00
Dan Streetman 06c2b0c76b test: verify RoutesToDNS= is independent of UseGateway= 2020-04-21 17:21:37 -04:00
Frantisek Sumsal 86b52a3958 tree-wide: fix spelling errors
Based on a report from Fossies.org using Codespell.

Followup to #15436
2020-04-21 23:21:08 +02:00
Dan Streetman 7c0d36ff5f test: modify/add tests for UseRoutes= and UseGateway= configuration
The last commit changed the UseGateway= default to the value of UseRoutes=
so the tests need to check for all combinations of the two parameters.
2020-04-21 17:15:02 -04:00
Frantisek Sumsal ff3518f1f4 test: drop Disk (Size|Free|Floor|Ceiling) fields prior comparing
The disk attributes can take some time to update on certain filesystems,
so let's strip them from inputs of both `homectl` and `userdbctl` before
comparing them to avoid unexpected fails.

Also, switch from `cmp` to `diff` to make a potential test fail a bit more
debuggable.

Fixes: #14755
2020-04-21 22:09:35 +02:00
Zbigniew Jędrzejewski-Szmek 2cb9a8b963 test-resolve: add a bunch more packets for testing
Let's append the date to the domain in the file name, to be able
to have multiple versions for the same domain.

There is no particular rhyme or reason to the domains being used:
I just pulled a few domains that happened to be present in issues reported
on github, even though the issues were not about pretty printing.
2020-04-17 18:29:15 +02:00
Lennart Poettering e46736fbb6 units: use correct path to refer to plymouth
This doesn't really matter, since in non-/usr-merged systems plymouth
needs to be in /bin and on merged ones it doesn't matter, but it is
still prettier to insert the right path, and avoid /bin on merged
systems, since it's just a compat symlink.

Replaces: #15351
2020-04-16 16:33:01 +02:00
Zbigniew Jędrzejewski-Szmek 8cf85bb575
Merge pull request #15281 from keszybz/functional-test-rework
Post-merge tweaks to the functional tests
2020-04-12 19:31:53 +02:00
Anita Zhang dc487c9801
Merge pull request #15361 from mrc0mmand/yet-another-TEST-47-tweak
test: wait a bit after stopping the test service
2020-04-09 14:18:37 -07:00
Lennart Poettering f58921bde3
Merge pull request #15332 from keszybz/coredump-filter
CoredumpFilter=
2020-04-09 17:15:26 +02:00
Zbigniew Jędrzejewski-Szmek ad21e542b2 manager: add CoredumpFilter= setting
Fixes #6685.
2020-04-09 14:08:48 +02:00
Frantisek Sumsal e00e2e0b50 test: wait a bit after stopping the test service
Give systemd a chance to process the stop event before checking if the
PID has indeed leaked. This should fix the intermittent test fails in CI
even with a fixed systemd version, like this one:

```
Apr 08 10:22:09 testsuite-47.sh[345]: ++ cat /leakedtestpid
Apr 08 10:22:09 testsuite-47.sh[334]: + leaked_pid=342
Apr 08 10:22:09 testsuite-47.sh[334]: + systemctl stop testsuite-47-repro
Apr 08 10:22:10 testsuite-47.sh[334]: + ps -p 342
Apr 08 10:22:10 testsuite-47.sh[348]:     PID TTY          TIME CMD
Apr 08 10:22:10 testsuite-47.sh[348]:     342 ?        00:00:00 sleep
Apr 08 10:22:10 testsuite-47.sh[334]: + exit 42
```

Followup to 197298ff9f
2020-04-08 12:15:52 +02:00
Susant Sahani e9a8c550c1 LLDP: Add support to transmit MUD URL 2020-04-08 00:20:54 +02:00
Lennart Poettering 4c39820562
Merge pull request #15298 from keszybz/show-property-value
systemctl --property-value as shortcut for --property --value
2020-04-04 11:22:59 +02:00
Zbigniew Jędrzejewski-Szmek 5522e628f5 test: use show -P in places
Not all places are converted on purpose, to also test the other option
name.
2020-04-03 18:24:21 +02:00
Zbigniew Jędrzejewski-Szmek c51c6f2f57
Merge pull request #15252 from ssahani/dhcpv6-mud
DHCPv6: Add support to send MUD URL
2020-04-02 10:23:15 +02:00
Zbigniew Jędrzejewski-Szmek 4e561c6200
Merge pull request #15109 from keszybz/units-make-installable
Make homed/userdbd/repart services installable (to allow uninstalling)
2020-04-02 10:21:29 +02:00
Richard Petri 7e025e9cdb network: can: add support for CAN-FD related properties 2020-04-01 20:07:20 +02:00
Susant Sahani 3175a8c21b network: DHCPv6 Add support to send MUD URL 2020-04-01 17:01:12 +02:00
Zbigniew Jędrzejewski-Szmek 20f938ff7f test: print path to build directory on misconfiguration
This way it's easier to see when a wrong $BUILD_DIR was passed.
2020-03-31 15:13:13 +02:00
Zbigniew Jędrzejewski-Szmek 5ef9eda17f units: make systemd-homed.service installable
Fixes #15083. Users might want to disable homed if not used to save resources.
2020-03-31 14:55:14 +02:00
Zbigniew Jędrzejewski-Szmek 73abf7ae06 run-integration-tests: only do the clean operation in the beginning
When doing 'make clean', we remove the cached image. So doing
'make -C TEST-NN-foo clean setup run clean-again' in a loop is very slow.
Let's filter out the 'clean' target (if specified), and do the cleaning
in the beginning, and then run other targets in a loop as before.
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 6e5b51d94a test: run loop device cleanup in more cases 2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 5a89d7b39c run-integration-tests: print times 2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek e00fca8c2e TEST-13-*: remove containers created in test before running the test
The test would fail when run again from the same image. So let's
rename the stuff we create to be more unique, and remove it before
running the test. (Removing it after would be more elegant, but it's
hard to make sure that everything is removed when things fail halfway.
Cleanup *before* tests is much more rebust.)
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek 68a7705e35 TEST-06-*: also try the installation path for Debian
https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream
used sed to adjust the path. I think it's better to make our script more
flexible.
2020-03-31 14:37:20 +02:00
Zbigniew Jędrzejewski-Szmek f1416431b6 test: optionally print the journal after tests
This is hopefully the last bit of functionality from
https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream.
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek f9eb2d51da test: use systemd-journal-remote for journal copying, support $ARTIFACT_DIRECTORY
Using s-j-remote fixes the following issue: when coalescing files from multiple
inputs, simply copying all files with into the the same directory might
potentially mess things up, because a newer system.journal might overwrite an
older journal. This happens because we run multiple tests from the same image,
and need to clean out the directory after each run.

By using systemd-journal-remote, we nicely coalesce all files. This has the
advantage that if there aren't too many logs, we end up with just one journal
file.

ARTIFACT_DIRECTORY is for ubuntuautopackagetests, where the journal files are
copied to a separate directory to preserve after tests have been run. This
functionality can now be recreated by setting
ARTIFACT_DIRECTORY=$AUTOPKGTEST_ARTIFACTS.
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek 8943daf813 test: use a helper function to move the journal files 2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek 3597bf7550 run-integration-tests: add support for blacklisting
This was done downstream in debian and ubuntu [1]. I want to change the
downstream file to use run-integration-tests so we can change the way tests
work more easily. Let's start moving downstream functionality upstream.

$ sudo BLACKLIST_MARKERS='blacklist-ubuntu-ci-arm64 blacklist-ubuntu-ci' \
   BUILD_DIR=build test/run-integration-tests.sh

[1] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream
2020-03-31 12:31:10 +02:00
Zbigniew Jędrzejewski-Szmek a455e75a30 test: use systemd.status-unit-format=name in all but one test
We want to test the traditional output, but the non-default one is generally
much nicer for debugging (and takes less space...).
2020-03-31 12:31:10 +02:00
Susant Sahani 7b8d23a9bb network: DHCPv4 - introduce The Manufacturer Usage Description (MUD) 2020-03-30 20:27:48 +02:00
Lennart Poettering 1f4faf21e8
Merge pull request #15197 from ssahani/smtp-dhcp
DHCP4: Add support to emit and receive SMTP servers.
2020-03-30 18:58:26 +02:00
Frantisek Sumsal 15529f5cea
Merge pull request #14338 from keszybz/functional-test-rework
Functional test rework
2020-03-30 16:25:12 +02:00
Susant Sahani f6269fe7bb network: DHCP - add support to emit and receive SMTP server information 2020-03-29 22:59:11 +02:00
Zbigniew Jędrzejewski-Szmek 8af10ca3fc test: print test of name in output 2020-03-28 12:37:28 +01:00
Zbigniew Jędrzejewski-Szmek f4c7bf9e90 test: run unittests with newlines in /proc/cmdline
This should help catch this class of errors.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 1506edca91 test: stop caching loopdev
It is more trouble than it is worth. The setup is of a loopback device
is very quick, so it's better to always create it when needed and
immediately drop afterwards.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 693ad298e9 test: perform partial cleanup after each test is run
This causes the unprivileged-nspawn-root directory to be removed
after running one test. The advantage is that we reduce the maximum
disk-space use quite a bit (47*400 MB → about 18GB).
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 108d00a6b2 test: simplify the Makefiles
has-overflow was a temporary hack that was removed in
844da987ef (Oct. 2016). All the makefiles
can be the same, and all the targets can be handled identically.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek ec43f6862e test: run tests directly from the loopback device
Before, we'd copy the test tree into nspawn-root, and run the tests from there.
This is OK, and doesn't actually take much extra time. But it uses quite a lot
of extra disk space. So let's make things a bit more efficient by running
directly from the image file.

We still run the unprivileged nspawn tests from a copy. Once the kernel
implements fs shift, we can do away with that too.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek eb1290ef35 test: wipe journal files after test
Otherwise they accumulate and create noise.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek b74a306197 test: echo a message when the tests fails
Sometimes it is not clear from the preceding output that there was a
failure.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 9d84eb2053 test/TEST-01: allow running w/o -Dinstall-tests=true
This is useful for sanitizer builds under CI, see
https://github.com/systemd/systemd-centos-ci/pull/202#issuecomment-566476592.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 8c3534b5db test: rework how images are created
Before, we'd create a separate image for each test, in
/var/tmp/systemd-test.XXXXX/rootdisk.img. Most of the images
where very similar, except that each one had some unit files installed
specifically for the test. The installation of those custom unit files
was removed in previous commits (all the unit files are always installed).

The new approach is to only create as few distinct images as possible.
We have:
default.img: the "normal" image suitable for almost all the tests
basic.img: the same as default image but doesn't mask any services
cryptsetup.img: p2 is used for encrypted /var
badid.img: /etc/machine-id is overwritten with stuff
selinux.img: with selinux added for fun and fun
and a few others:

ls -l build/test/*img
lrwxrwxrwx 1 root root 38 Mar 21 21:23 build/test/badid.img -> /var/tmp/systemd-test.PJFFeo/badid.img
lrwxrwxrwx 1 root root 38 Mar 21 21:17 build/test/basic.img -> /var/tmp/systemd-test.na0xOI/basic.img
lrwxrwxrwx 1 root root 43 Mar 21 21:18 build/test/cryptsetup.img -> /var/tmp/systemd-test.Tzjv06/cryptsetup.img
lrwxrwxrwx 1 root root 40 Mar 21 21:19 build/test/default.img -> /var/tmp/systemd-test.EscAsS/default.img
lrwxrwxrwx 1 root root 39 Mar 21 21:22 build/test/nspawn.img -> /var/tmp/systemd-test.HSebKo/nspawn.img
lrwxrwxrwx 1 root root 40 Mar 21 21:20 build/test/selinux.img -> /var/tmp/systemd-test.daBjbx/selinux.img
lrwxrwxrwx 1 root root 39 Mar 21 21:21 build/test/test08.img -> /var/tmp/systemd-test.OgnN8Z/test08.img

I considered trying to use the same image everywhere. It would probably be
possible, but it would be very brittle. By using separate images where it is
necessary we keep various orthogonal modifications independent.

The way that images are cached is complicated by the fact that we still
want to keep them in /var/tmp. Thus, an image is created on first use and
linked to from build/test/ so it can be found by other tests.

Tests cannot be run in parallel. I think that is an acceptable limitation.
Creation of the images was probably taking more resources then the actual
tests, so we should be better off anyway.
2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek de0162a95a test/TEST-28: avoid race in handling of /testok 2020-03-28 11:51:29 +01:00
Zbigniew Jędrzejewski-Szmek 4962ed9f33 test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
Zbigniew Jędrzejewski-Szmek 8a59e79c09 test: mount root rw and drop /etc/fstab
We had an fstab for the sole purpose of remounting "/" rw. Mounting root ro
is a pointless excercise in obsolete approaches. More importantly, the nspawn
image is now the same as the qemu one.
2020-03-28 11:51:13 +01:00
Zbigniew Jędrzejewski-Szmek 50b836518c test: drop cargo-cult line
p2 is only used in the cryptsetup test...
2020-03-28 11:51:13 +01:00
Zbigniew Jędrzejewski-Szmek 80c53fe7d5 test: improve reporting a bit 2020-03-28 11:51:13 +01:00
Zbigniew Jędrzejewski-Szmek 70ce817ccb test: de-duplicate test_setup() functions
Now we will run setup_nspawn_root() in some case where do don't need to.
2020-03-28 11:51:11 +01:00
Zbigniew Jędrzejewski-Szmek bdfa9657d0 test: move TEST-47-* to static files 2020-03-28 11:50:53 +01:00
Zbigniew Jędrzejewski-Szmek 2c75449a38 test: move TEST-46-HOMED to static files 2020-03-28 11:50:53 +01:00
Zbigniew Jędrzejewski-Szmek e29e4d5742 test: convert TEST-45 to a normal meson test
On my laptop, it now takes 0.23 s. We don't need the overhead of creating
an image and spawning a machine to mangle a file in /tmp.
2020-03-28 11:50:38 +01:00
Zbigniew Jędrzejewski-Szmek 07d16f438a test: move TEST-44-* to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek d0ac89a1e8 test: move TEST-43-* setup to static files
Setup of lingering is dropped. I don't think it's necessary for anything,
because the unit is still pulled in from the testsuite service.
2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek bdfd515ad1 test: move TEST-42-EXECSTOPPOST setup to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 0ac5dbf3ae test/TEST-41: use a file in /tmp and reset the contents
If the test was run a second time from the same root, it would fail.
2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 2b2eefee06 test: move TEST-41-ONESHOT-RESTART setup to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek d48b27bffd test: move TEST-40-EXEC-COMMAND-EX setup to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 7124ae207a test: move TEST-39-EXECRELOAD setup to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 4db7d044b8 test: move TEST-37-RUNTIMEDIRECTORYPRESERVE setup to static files 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 534a42705b test/TEST-36: move the config files to /run
This way we always start with a clean slate when running the test
repeatedly.
2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 097d8c6eb7 test: move TEST-36-NUMAPOLICY setup to static files
No need to call setup_nspawn_root() if we plan to only run under qemu.
2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek fbaa11372b test: convert TEST-35-NETWORK-GENERATOR into a unit test 2020-03-28 11:46:48 +01:00
Zbigniew Jędrzejewski-Szmek 01efa07960 test: move TEST-34-DYNAMICUSERMIGRATE setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek ff978cd24a test: move TEST-33-CLEAN-UNIT setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek c8937bed08 test: move TEST-32-OOMPOLICY setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 048d52d51e test: move TEST-31-DEVICE-ENUMERATION setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 7eeeab205d test: move TEST-30-ONCLOCKCHANGE setup to static files
The two timezone files are now installed in the global setup. I am not too
happy about this, but it still seems better than to create a completely
separate image just for this.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek e578ea4df4 test: move TEST-29-UDEV-ID_RENAMING setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 94370e627f test: move TEST-28-PERCENTJ-WANTEDBY setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 468874997a test: move TEST-27-STDOUTFILE setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek dfa633ca6a test: move TEST-26-SETENV setup to static files
Also run mask_supporting_services() here.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 68e2dc0f91 test/TEST-25: remove all images at the end of the test
scratch5 would be left behind, and trying to run the test again on the same
image would fail.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 6e796683df test: move TEST-25-IMPORT setup to static files
Also run mask_supporting_services() here.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek f4c40fd754 test: move TEST-24-UNIT-TESTS setup to static files
I picked the list of zone files to install by grepping through the code. This
is is a bit brittle, but installing all of them takes a while, and more
importantly, writes a lot of lines to the log.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek b49325d028 test: move TEST-23-TYPE-EXEC setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek c0b97b0fc8 test: move TEST-22-TMPFILES setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek c1d6c135bc test: move TEST-20-MAINPIDGAMES setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek e67a2644a8 test: move TEST-19-DELEGATE setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek dce2b8ce48 test: move TEST-18-FAILUREACTION setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 9911131a60 test: move TEST-17-WANTS setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek e5b0aaaf56 test/TEST-16: simplify how variables are set
The amount of lines doesn't change much, but I think it's much more
straightforward this way.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 2b5981b40a test: move TEST-16-EXTEND-TIMEOUT setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 1aa0f38491 test/TEST-15: call daemon-reload in two more places
Sometimes the test would fail there, nondeterministically. I'm not sure why,
but relying on PID1 not caching the file is clearly very brittle. Let's instead
call daemon-reload.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 4e2ac45a83 test/TEST-15: remove all created unit files
We would miss anything created under a template instance.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 2c7519c036 test: move TEST-15-DROPIN setup to static files
Unfortunately the services needed to be renamed because of conflicts with other
services that exist in the shared dir.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek afd9c55dcc test: move most of TEST-14-MACHINE-ID setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek e5badaf335 test: move most of TEST-13-NSPAWN-SMOKE setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek d10029bba4 test: move TEST-12-ISSUE-3171 setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 3ac189d8aa test: move TEST-11-ISSUE-3166 setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 8c6d58f65d test: move TEST-10-ISSUE-2467 setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 4110a6deb9 test: use shell arrays and remove duplicates
The tool lists are obviously not empty, so let's remove the test if they are.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek e88302002f test: move TEST-09-ISSUE-2691 setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek c84752398b test: move TEST-08-ISSUE-2730 setup to static files and meson scripts
Unfortunately meson does not install symlinks, but copies the symlink
destination instead. So symlinks need to be created by a script.
This commit adds both symlinks in test/testsuite-08.units/ and meson
scriptlet calls. Strictly speaking, the first is not necessary, since nothing
reads stuff directly from the source tree.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 58a1bdb467 test: move TEST-07-ISSUE-1981 setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 4caa1ac794 test/TEST-06: make autorelabel.service a static file too 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 1c76b5b5bb test/TEST-06: skip test if no selinux
I put SELINUX=disabled on my laptop, and the test fails with ENOENT when trying
to write to /sys/fs/selinux/enforce. It's a bit of a special case, but let's
avoid the failure.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 1ed5556e56 test: move most of TEST-06-* setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek ed024e1d98 test: move TEST-05-RLIMITS setup to static files
The test currently fails in the check for LimitNOFILESoft/LimitNOFILE. I see
default values there. This doesn't seem to be related to the changes in the
test suite, but rather to the recent changes to pid1.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 9901a6ad2e test: convert TEST-04-JOURNAL to generic image 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 41b1b2a563 test: move TEST-03-JOBS setup to static files 2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek 5964e39a69 test: move part of TEST-02-CRYPTSETUP setup to static files
Since we create an encrypted partition for this test, let's create a separate image here.
2020-03-28 11:46:47 +01:00
Zbigniew Jędrzejewski-Szmek fe85f2bb9c test: move TEST-01-BASIC setup to static files
After this commit, only tests that were converted will work, because the
interface to test_run() changed.
2020-03-28 11:46:47 +01:00
Susant Sahani 284e8fd0d7 DHCP: Add support to emit and retrieve POP3 server 2020-03-28 03:34:27 +01:00
Zbigniew Jędrzejewski-Szmek 5f28f3ddaf test: allow overriding EFI_MOUNT like other variables 2020-03-22 10:22:42 +01:00
Zbigniew Jędrzejewski-Szmek 80769cb66c meson: use install_subdir() to install files
This gives us slightly less control, but we don't need to update the
file list...
2020-03-22 10:22:42 +01:00
Zbigniew Jędrzejewski-Szmek f55198f034 test: replace symlinks with actual unit files
During installation, meson complains:
> Installing /home/zbyszek/src/systemd-work/test/units/sysinit.target to /var/tmp/systemd-test.Q1FSuj/root/usr/lib/systemd/tests/testdata/units
> Warning: trying to copy a symlink that points to a file. This will copy the file,
> but this will be changed in a future version of Meson to copy the symlink as is. Please update your
> build definitions so that it will not break when the change happens.

It *is* convenient to have those files as symlinks, but it is also confusing,
because symlinks create aliases, and it seems that in those cases we actually
don't want aliases (at least in the case of loopy*.service that'd make the test
pointless).
2020-03-22 10:22:42 +01:00
Zbigniew Jędrzejewski-Szmek 7b43295346 tests: move unit files to units/ subdirectory
We have a bazillion of those unit files, and keeping them all directly in tests/
has become rather unwieldy.
2020-03-19 16:23:27 +01:00
David Wood 7354900ddd network: Fix split in `SendOption=` on client and server
When specifying `DHCPv4.SendOption=`, it is used by systemd-networkd to
set the value of that option within the DHCP request that is sent out.
This differs to setting `DHCPServer.SendOption=`, which will place all
the options together as suboptions into the vendor-specific information
(code 43) option.

This commit adds two new config options, `DHCPv4.SendVendorOption=` and
`DHCPServer.SendVendorOption=`. These both have the behaviour of the old
`DHCPServer.SendOption=` flag, and set the value of the suboption in the
vendor-specific information option.

The behaviour of `DHCPServer.SendOption=` is then changed to reflect
that of `DHCPv4.SendOption=`. It will set the value of the corresponding
option in the DHCP request.
2020-03-19 09:08:40 +01:00
Zbigniew Jędrzejewski-Szmek 8c357762c7
Merge pull request #14749 from msekletar/cpu-aff-numa-v3
core: add support for setting CPUAffinity= to special "numa" value
2020-03-18 13:35:58 +01:00
Zbigniew Jędrzejewski-Szmek 34bc838f15
Merge pull request #15136 from yuwata/network-dhcp4-use-gateway
network: add a flag to ignore gateway provided by DHCP server
2020-03-17 16:51:18 +01:00
Yu Watanabe 74f0fb9095 network: can: add support for listen-only mode
Closes #15129.
2020-03-17 00:32:35 +09:00
Yu Watanabe 0d7bd445d2 test-network: add a test case for DHCPv4.UseGateway=no 2020-03-16 19:34:47 +09:00
Yu Watanabe b453122789 network: add a flag to ignore gateway provided by DHCP server
Closes #15117.
2020-03-16 19:34:43 +09:00
Michal Sekletár e2b2fb7f56 core: add support for setting CPUAffinity= to special "numa" value
systemd will automatically derive CPU affinity mask from NUMA node
mask.

Fixes #13248
2020-03-16 08:57:28 +01:00
Frantisek Sumsal 197298ff9f test: wait a bit after starting the test service
otherwise we might end up being faster than the unit itself, causing
unexpected fails, like:

```
testsuite.sh[297]: + systemctl start issue_14566_test
testsuite.sh[297]: + systemctl status issue_14566_test
testsuite.sh[304]: ● issue_14566_test.service - Issue 14566 Repro
testsuite.sh[304]:      Loaded: loaded (/etc/systemd/system/issue_14566_test.service; static; vendor preset: enabled)
testsuite.sh[304]:      Active: active (running) since Sat 2020-03-14 02:02:23 UTC; 417ms ago
testsuite.sh[304]:    Main PID: 301 ((repro.sh))
testsuite.sh[304]:       Tasks: 1 (limit: 535)
testsuite.sh[304]:      Memory: 180.0K
testsuite.sh[304]:         CPU: 122ms
testsuite.sh[304]:      CGroup: /system.slice/issue_14566_test.service
testsuite.sh[304]:              └─301 [(repro.sh)]
testsuite.sh[307]: ++ cat /leakedtestpid
testsuite.sh[307]: cat: /leakedtestpid: No such file or directory
testsuite.sh[297]: + leaked_pid=
```
2020-03-16 12:28:14 +09:00
Yu Watanabe 970ab1fcc0 test-network: add a test case for HHF 2020-03-12 15:47:03 +09:00
Susant Sahani 7f22402007 network: TC - introduce HHF
Please see https://lwn.net/Articles/577208/
2020-03-12 15:39:12 +09:00
Yu Watanabe 41bb371bb0 test-network: add a test case for PFIFOFast 2020-03-12 15:39:10 +09:00
Susant Sahani 1a95964bfa network: TC - introduce pfifo_fast
pfifo_fast - three-band first in, first out queue

Please see https://linux.die.net/man/8/tc-pfifo_fast
2020-03-12 15:38:18 +09:00
Yu Watanabe 73136507ac test-network: add a test case for PFIFOHeadDrop 2020-03-12 15:38:15 +09:00
Susant Sahani 053a2ddbb2 network: TC - introduce pfifo_head_drop
This adds the required changes to gain access to
the head drop classfull queuing discipline named
pfifo_head_drop.
2020-03-12 15:37:17 +09:00
Yu Watanabe 7b1a31a3d0 test-network: add a test case for BFIFO 2020-03-12 15:37:15 +09:00
Susant Sahani c853f594d4 network: TC - introduce BFIFO
bfifo - Byte limited First In, First Out queue
2020-03-12 15:35:51 +09:00
Yu Watanabe 557fa421ff test-network: add a test case for DRR 2020-03-12 15:35:51 +09:00
Yu Watanabe ad365c5de7 network: tc: introduce DRR class 2020-03-12 15:35:51 +09:00
Susant Sahani f5fc04417e network: TC - introduce DRR
Introduce the Deficit Round Robin Scheduler is a classful queuing discipline as
a more flexible replacement for Stochastic Fairness Queuing.

http://man7.org/linux/man-pages/man8/tc-drr.8.html
2020-03-12 15:35:51 +09:00
Yu Watanabe be94e591fb test-network: add test case for PIE 2020-03-12 15:34:46 +09:00
Susant Sahani bde4ae88c8 network: tc- introduce PIE
Proportional Integral controller-Enhanced (PIE) is a control
theoretic active queue management scheme. It is based on the
proportional integral controller but aims to control delay.

http://man7.org/linux/man-pages/man8/tc-pie.8.html
2020-03-12 13:58:35 +09:00
Anita Zhang c1566ef0d2 core: transition to FINAL_SIGTERM state after ExecStopPost=
Fixes #14566
2020-03-11 10:15:33 +01:00
Frantisek Sumsal e9cdcbed77 test: ignore IAB capabilities in `test-execute`
libcap v2.33 introduces a new capability set called IAB[0] which is shown
in the output of `capsh --print` and interferes with the test checks. Let's
drop the IAB set from the output, for now, to mitigate this.

This could be (and probably should be) replaced in the future by the
newly introduced testing options[1][2] in libcap v2.32, namely:
    --has-p=xxx
    --has-i=xxx
    --has-a=xxx

but this needs to wait until the respective libcap version gets a wider
adoption. Until then, let's stick with the relatively ugly sed.

Fixes: #15046

[0] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=943b011b5e53624eb9cab4e96c1985326e077cdd
[1] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=588d0439cb6495b03f0ab9f213f0b6b339e7d4b7
[2] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=e7709bbc1c4712f2ddfc6e6f42892928a8a03782
2020-03-09 18:22:16 +01:00
Yu Watanabe a834cb5247
Merge pull request #15036 from yuwata/can-termination-mod
network: add CAN Termination tristate option
2020-03-07 19:11:03 +09:00
Matt Ranostay 52aa38f14a network: add CAN Termination tristate option 2020-03-07 02:00:02 +09:00
Yu Watanabe bba1f90ff5
Merge pull request #14890 from yuwata/network-tc-next
network: tc-next
2020-03-07 01:44:15 +09:00
Yu Watanabe a34811e4ef udev: support to update flow control parameter
Closes #14770.
2020-03-07 01:43:26 +09:00
Yu Watanabe d739fddeb5 network: add setting to support RA without DHCPv6 client
Closes #13991.
2020-03-07 01:39:26 +09:00
Susant Sahani cd305af1fe network: Allow DHCPv6 client to start without router's managed flag. 2020-03-07 01:38:26 +09:00
Chris Down 5bb67b107f
Merge pull request #14956 from ssahani/delegated-prefix-14474
nettwork: introduce delegated prefix assign
2020-03-06 16:13:13 +00:00
Jörg Thalheim ff12a7954c treewide: more portable bash shebangs
As in 2a5fcfae02
and in 3e67e5c992
using /usr/bin/env allows bash to be looked up in PATH
rather than being hard-coded.

As with the previous changes the same arguments apply
- distributions have scripts to rewrite shebangs on installation and
  they know what locations to rely on.
- For tests/compilation we should rather rely on the user to have setup
  there PATH correctly.

In particular this makes testing from git easier on NixOS where do not provide
/bin/bash to improve compose-ability.
2020-03-05 17:27:07 +01:00
Zbigniew Jędrzejewski-Szmek 33eb1f2497 tree-wide: drop printk.devkmsg=on setting in various places
Since 6123dfaa72 this should not be necessary anymore.
2020-03-03 15:02:53 +01:00
Yu Watanabe f6c6af3811 test-network: add a test case for CAKE 2020-03-02 15:59:37 +09:00
Susant Sahani ad8352f4ff network: tc: introduce cake
CAKE (Common Applications Kept Enhanced)

Please see http://man7.org/linux/man-pages/man8/tc-cake.8.html
2020-03-02 15:59:37 +09:00
Yu Watanabe f2c5c1296a test-network: add a test case for sfb 2020-03-02 15:48:24 +09:00
Susant Sahani 982998b087 network: TC introduce sfb - Stochastic Fair Blue
Please see https://www.systutorials.com/docs/linux/man/8-tc-sfb/
2020-03-02 15:48:24 +09:00
Yu Watanabe 95edcf3fac test-network: add a test case for GRED 2020-03-02 15:48:24 +09:00
Susant Sahani 609e8340bb network: TC introduce GRED, Generic Random Early Detection
http://tldp.org/en/Traffic-Control-HOWTO/ar01s06.html
2020-03-02 15:48:24 +09:00
Yu Watanabe bc0769c9f7 test-network: add a test case for PFIFO 2020-03-02 15:48:11 +09:00
Susant Sahani a74760653c network: TC introduce PFIFO 2020-03-02 15:48:00 +09:00
Yu Watanabe f1de1eb3e3 test-network: add test case for HTB class 2020-03-02 15:46:28 +09:00
Yu Watanabe 19f86a6351 network: tc: support HTB class 2020-03-02 15:46:28 +09:00
Yu Watanabe 931c8c824a test-network: add a test case for HTB 2020-03-02 15:46:28 +09:00
Yu Watanabe b934ac3d6e network: tc: support Hierarchy Token Bucket (HTB) 2020-03-02 15:46:28 +09:00
Yu Watanabe 834ea1a466 test-network: remove unnecessary dummy interface 2020-03-02 15:44:03 +09:00
Yu Watanabe 4c2e1833ec test-network: add a test case for [DHCPv4] UseRoutes=no 2020-03-02 01:28:27 +09:00
Yu Watanabe 3c874fd79d test-network: add a test case for [IPv6Prefix] Assign=yes 2020-03-01 00:49:24 +09:00
Susant Sahani bd6379ec57 network: introduce IPv6 prefix assign
Expose a boolean flag to automatically add an address from the delegated prefix to the interface
2020-03-01 00:49:19 +09:00
Nate Jones ecf63c9102 execute: Make '+' exec prefix ignore PrivateTmp=yes
The man pages state that the '+' prefix in Exec* directives should
ignore filesystem namespacing options such as PrivateTmp. Now it does.

This is very similar to #8842, just with PrivateTmp instead of
PrivateDevices.
2020-02-29 19:32:01 +09:00
Yu Watanabe 40afe4916a test-network: add one more test case for VRF= 2020-02-26 19:21:53 +09:00
Yu Watanabe 1d6cfd25a2
Merge pull request #14833 from kpfleming/multiple-ipv6token-addresses
Support multiple IPv6Token 'static' addreses on an interface
2020-02-12 02:10:44 +09:00
Kevin P. Fleming c24c83dc67 network: Allow multiple IPv6Token 'static' items to generate addresses
This patch allows multiple addresses using 'static' IPv6Tokens to
be generated for a single network interface.
2020-02-10 18:40:57 +09:00
Yu Watanabe 38d1255a52 test-network: add tests for qdisc Handle= 2020-02-10 17:49:02 +09:00
Susant Sahani d8b2396d34 network: add support for qdisc handle 2020-02-10 17:48:53 +09:00
Yu Watanabe f7ada4b8ec test-network: tentatively stops .socket units for udevd
To suppress the following warning:
---
Warning: Stopping systemd-udevd.service, but it can still be activated by:
  systemd-udevd-control.socket
  systemd-udevd-kernel.socket
2020-02-10 00:51:00 +09:00
Kevin P. Fleming b241fa00e9 network: Add test for explicit 'static' IPv6Token
Add a test case for an explicitly-specified 'static' IPv6Token.

Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
2020-02-10 00:41:34 +09:00
Frantisek Sumsal 5f04f4e470 test: give systemd chance to actually start the unit
In certain cases the expected enqueue-start-replace-continue
sequence would end up as enqueue-replace-start-continue which causes
unexpected fails even though the serialization/deserialization part
works as expected. As we can't use `--wait` in this case, let's give
sysetmd a second to actually start the unit before replacing it with
another one.

Also, switch from the single-letter test output to a bit verbose format.

Fixes: #14632
2020-02-08 11:38:24 +01:00
Zbigniew Jędrzejewski-Szmek c3b41d8811
Merge pull request #14805 from yuwata/network-ipv6-token-follow-up
network: rename eui64 to static
2020-02-07 17:05:33 +01:00
Yu Watanabe 3d55b5a9de test-network: add test for teql 2020-02-07 17:41:49 +09:00
Yu Watanabe 9b749c11e2 network: tc: support teql
Closes #14792.
2020-02-07 17:41:49 +09:00
Yu Watanabe ab9dc1db47 test-network: add more tests for traffic control 2020-02-07 17:41:43 +09:00
Yu Watanabe f0c1ad308d network: fix ABRT
Fixes #14811 and oss-fuzz#20548.
2020-02-07 17:18:58 +09:00
Yu Watanabe 2ed5f6d5de network: introduce new [QDisc] section to support Parent=ingress
Follow-up for 18de0969c5.
2020-02-07 13:48:54 +09:00
Yu Watanabe e2c4070edf network: rename eui64 to static
See RFC 4291.

Follow-up for 5f506a5560.
2020-02-07 13:30:40 +09:00
Zbigniew Jędrzejewski-Szmek 5bbcff2a1d
Merge pull request #14415 from ssahani/prefixstable-rfc-7217-new
network: Allow to specify multiple IPv6Token for SLAAC
2020-02-05 17:05:33 +01:00
Frantisek Sumsal 9569e38503 test: adapt to the new capsh format
Since libcap v2.29 the format of cap_to_text() has been changed which
makes certain `test-execute` subtest fail. Let's remove the offending
part of the output (dropped capabilities) to make it compatible with
both the old and the new libcap.
2020-02-05 10:11:42 +01:00
Yu Watanabe 87bbebeab6 test-network: add tests for IPv6Token= 2020-02-05 17:44:42 +09:00
Yu Watanabe 641aa41200 test-network: use udevd in build directory
Fixes #14764.
2020-02-05 17:25:35 +09:00
Zbigniew Jędrzejewski-Szmek 427928caa4
network: change "Gateway=dhcp" to "Gateway=_dhcp" (#14774)
This way we avoid confusion with a DNS name. Fixes #14773.
2020-02-05 13:41:30 +09:00
Yu Watanabe f2f1b52c6f
Merge pull request #14767 from yuwata/network-split-qdisc-section
network: split TrafficControlQueueingDiscipline section into small pieces
2020-02-05 13:35:25 +09:00
Zbigniew Jędrzejewski-Szmek ca58d00c68 network: FairQueueTrafficPolicing→FairQueueing
This never made into a release, so we can change the name with impunity.
Suggested by Davide Pesavento.

I opted to add the "ing" ending. "Fair queuing" is the name of the general
concept and algorithm, and "Fair queue" is mostly used for the implementation
name.
2020-02-04 17:37:16 +01:00
Zbigniew Jędrzejewski-Szmek 60ed2dcfc7 network: TokenBufferFilter→TokenBucketFilter
This never made into a release, so we can change the name with impunity.
Noticed by Davide Pesavento.
2020-02-04 17:28:15 +01:00
Yu Watanabe 18de0969c5 network: split TrafficControlQueueingDiscipline section into small pieces
Closes #14763.
2020-02-04 21:45:39 +09:00
Yu Watanabe 41fd8fe716 test-network: add a test case for IPv6PrefixDelegation.DNS=linklocal 2020-02-04 13:57:12 +09:00
Yu Watanabe bf2334c054 udev: add {Receive,Transmit}ChecksumOffload= settings
Closes #14661.
2020-02-03 12:31:31 +09:00
Naïm Favier 53e1ba280f
network: add SuppressPrefixLength option to RoutingPolicyRule (#14736)
Closes #14724.
2020-02-03 08:25:48 +09:00
David Michael 649916d356 sysusers: support creating users with a specific primary group
This extends the "uid:gid" syntax for "u" lines so that a group
name can be given instead of a GID.  This requires that the group
is either queued for creation by sysusers, or it is already defined
on the system.

Closes #14340
2020-02-02 16:53:22 +01:00
Yu Watanabe 6be8e78e32 test-network: add test for UID based routing policy 2020-02-02 22:43:38 +09:00
Yu Watanabe ea471a4695 network: support UID based routing policy
Closes #14666.
2020-02-02 22:43:38 +09:00
Frantisek Sumsal 2273ecfeda test: don't install /etc/securetty
Having /etc/securetty in test containers prevents root from logging into
them:

```
Jan 31 10:15:11 systemd-testsuite login[69]: pam_securetty(login:auth): access denied: tty 'pts/0' is not secure !
Jan 31 10:15:11 systemd-testsuite login[69]: FAILED LOGIN 1 FROM pts/0 FOR root, Authentication failure
```
2020-02-01 11:55:17 +01:00
Lennart Poettering db23d83bd4 test: add simple test for log namespaces 2020-01-31 15:04:05 +01:00
Evgeny Vereshchagin 9a1862bfa6 tests: unset LD_PRELOAD in testsuite.service when it's run under ASan
This should help to address the "grep" issue we ran into in
https://github.com/systemd/systemd-centos-ci/pull/217.
2020-01-31 13:13:04 +01:00
Lennart Poettering 6ead39170a test: add test case for homed 2020-01-28 22:36:51 +01:00
Yu Watanabe a05a6e8bba test-network: fix test_qdisc2()
quantum and initial_quantum may suffixed with 'b'.
2020-01-28 22:33:31 +01:00
Yu Watanabe 11a182aa1e test: drop sector-size line from output of sfdisk
The following commit adds 'sector-size' line to the output of sfdisk
command:
e56ca06815

Fixes #14664.
2020-01-28 15:16:13 +01:00
dann frazier 37b9966e25 test: Synchronize journal before reading from it
There's a race condition in the sysuser test where it may try to read
entries from the journal before they are available. Fix it by adding a
`journalctl --sync` call.

BugLink: https://bugs.launchpad.net/bugs/1776654
2020-01-28 15:11:58 +01:00
Zbigniew Jędrzejewski-Szmek 5e176a4dee Merge pull request #14368 from poettering/repart 2020-01-23 19:07:02 +01:00
Lennart Poettering 2f62a8c688 test: add repart test 2020-01-20 17:42:03 +01:00
Lennart Poettering e56a8790a0 test: add test for https://github.com/systemd/systemd/issues/14560 2020-01-20 17:19:51 +01:00
Dan Streetman 0c020321c8 test-network: simplify wait_online() by calling wait_operstate()
The wait_operstate() function now rechecks the condition for a timeout,
so the wait_online() function can simply call it to check for the
setup_state.
2020-01-09 15:19:19 -05:00
Dan Streetman a4632dc7d1 test-network: convert wait_operstate() to recheck condition for timeout seconds
Failing after a single check leads to extra sleeps scattered through
test cases, and can also lead to false failures.  Instead perform a
recheck for a number of seconds until the state matches, and fail only
if the timeout is exceeded.

This allows removing all the manual sleeps in the testcases.
2020-01-09 15:19:19 -05:00
Dan Streetman 19cf3143cf test-network: rename check_operstate() to wait_operstate()
Rename only, no functional change; this makes following patches easier
to read.
2020-01-09 15:19:19 -05:00
Lennart Poettering 0aa9bffe10
Merge pull request #14448 from yuwata/network-permanent-mac-address
network, udev: support permanent mac address
2020-01-08 15:36:27 +01:00
Zbigniew Jędrzejewski-Szmek 629548c405
Merge pull request #14488 from yuwata/networkctl-show-logs
networkctl: status command also shows logs of networkd
2020-01-08 10:49:39 +01:00
Yu Watanabe 4bb7cc8287 network, udev: introduce PermanentMACAddress= setting in [Match] section
Closes #13983.
2020-01-08 17:54:54 +09:00
Anita Zhang ffe61e19cb
Merge pull request #14472 from poettering/test-43-fixes
Various robustness fixes for TEST-43-PRIVATEUSER-UNPRIV
2020-01-07 10:53:13 -08:00
Yu Watanabe fc79e6ff5e test-network: suppress logs in status command 2020-01-07 22:20:43 +09:00
Yu Watanabe 214c5bae09 test-network: add test for Gateway=DHCP 2020-01-07 19:11:19 +09:00
Lennart Poettering f9aefc91f1 testsuite: drop "systemctl is-system-running --wait" invocation
We wait for "basic.target" being reached in the user instance anyway
before allowing the user's session to start, hence doing such a wait is
unnecessary, since that would just mean we'd wait for "default.target"
on top of "basic.target", but we shouldn#t need anything of that...

Hence, let's simplify this, reduce explicit sync points.
2020-01-06 13:41:56 +01:00
Lennart Poettering e9786a5c01 test: don't rely on "nobody" user for TEST-43
The name is not as universal as we want, still, hence let's use our own
user we create with sysusers.d/. That should yield same behaviour
everywhere (and also test sysusers a bit as side effect).
2020-01-06 13:25:33 +01:00
Lennart Poettering 6e0ed2865e test: hardcode shell to use
let's make sure we always invoke our commands through /bin/sh, since
on some distros su will use /bin/nologin (or whatever is listed in
/etc/passwd) as shell otherwise and we don#t want that.
2020-01-06 13:25:33 +01:00
Lennart Poettering ff963ea6ba test: use symlinks for Makefiles
for some reason the newer tests used file copyies instead of symlinks.
let's fix that.
2020-01-03 21:36:58 +01:00
Lennart Poettering dc5737470e
Merge pull request #14194 from yuwata/network-multipath-routing-12541
network: introduce multipath routing
2020-01-03 15:38:03 +01:00
Lennart Poettering 49d418d4ab
Merge pull request #14444 from yuwata/network-codel-more
network: more CoDel settings
2020-01-02 14:51:55 +01:00
Lennart Poettering cb68406c6a
Merge pull request #14441 from GothAck/gothack_type.d_dropin_test_master
Fix type.d drop-in ordering for #14439 - duplicate against master
2020-01-02 13:41:16 +01:00
Yu Watanabe a3d3565451 test-network: add a test case for CoDel 2019-12-28 22:25:49 +09:00
Yu Watanabe b078e52855 network: add more settings for CoDel 2019-12-28 22:25:12 +09:00
Susant Sahani c695dcf929 network: Add support to configure DHCPv4 route MTU
This is useful for transitioning systems from small frames to jumbo frames.

Closes #14302
2019-12-28 21:37:26 +09:00
Susant Sahani a9a5d632da network: tc introduce codel
Please see http://man7.org/linux/man-pages/man8/tc-codel.8.html
2019-12-28 21:35:39 +09:00
Greg "GothAck" Miell f5dd6e50a7 Add failing test to show service.d global drop-in does not get overridden by more specific dropins 2019-12-27 14:53:32 +00:00
Yu Watanabe 0fd8b71809 test-network: add a test case for DHCPv4.SendDecline= 2019-12-21 00:26:44 +09:00
Susant Sahani 0f3ff4eae2 network: DHCP4 introduce send decline 2019-12-21 00:26:44 +09:00
Anita Zhang b6657e2c53 test: add test case for PrivateDevices=y and Group=daemon
For root, group enforcement needs to come after PrivateDevices=y set up
according to 096424d123. Add a test to
verify this is the case.
2019-12-18 11:09:30 -08:00
Anita Zhang e5f10cafe0 core: create inaccessible nodes for users when making runtime dirs
To support ProtectHome=y in a user namespace (which mounts the inaccessible
nodes), the nodes need to be accessible by the user. Create these paths and
devices in the user runtime directory so they can be used later if needed.
2019-12-18 11:09:30 -08:00
Filipe Brandenburger a49ad4c482 core: add test case for PrivateUsers=true in user manager
The test exercises that PrivateTmp=yes and ProtectHome={read-only,tmpfs}
directives work as expected when PrivateUsers=yes in a user manager.

Some code is also added to test-functions to help set up test cases that
exercise the user manager.
2019-12-18 11:09:30 -08:00
Yu Watanabe de697db05b network: introduce AddPrefixRoute= and deprecate PrefixRoute=
PrefixRoute= was added by e63be0847c,
but unfortunately, the meaning of PrefixRoute= is inverted; when true
IFA_F_NOPREFIXROUTE flag is added. This introduces AddPrefixRoute=
setting.
2019-12-18 16:32:31 +01:00
Yu Watanabe a0ce990e71 test-network: add test case for multipath routing 2019-12-18 22:12:57 +09:00
Yu Watanabe 6ff5cc6b7a network: introduce multipath route
Closes #12541.
2019-12-18 22:12:57 +09:00
Topi Miettinen 7a670b1dd9 shared/dropin: fix assert for invalid drop-in
Don't try to show top level drop-in for non-existent units or when trying to
instantiate non-instantiated units:

$ systemctl cat nonexistent@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
$ systemctl cat systemd-journald@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
2019-12-18 08:43:40 +01:00
Yu Watanabe 6e5df4036f
Merge pull request #14337 from yuwata/network-tc-fq-more
network: tc: introduce more FQ settings
2019-12-17 23:30:10 +09:00
Anita Zhang 1209ef94bd [import] fix stdin/stdout pipe behavior in import/export tar/raw
The code existed in machinectl to use stdin/stdout if the path for
import/export tar/raw was empty or dash (-) but a check to
`fd_verify_regular` in importd prevented it from working.

Update the check instead to explicitly check for regular file or
pipe/fifo.

Fixes #14346
2019-12-17 23:14:53 +09:00
Yu Watanabe ef1d2c07f9 udev: introduce AlternativeNamesPolicy= setting 2019-12-17 15:44:43 +09:00
Lennart Poettering 3b5cd25f4d
Merge pull request #14196 from keszybz/gpt-auto-generator-debugging
gpt-auto-generator debugging
2019-12-16 09:24:02 +01:00
Yu Watanabe 7a2f6fb6f1 test-network: pass environment variables to networkctl 2019-12-16 10:56:02 +09:00
Yu Watanabe 6934ace05d test-network: add a test case for netdev altname 2019-12-16 10:56:02 +09:00
Yu Watanabe a5053a158b udev: support AlternativeName= setting in .link file 2019-12-16 10:52:22 +09:00
Yu Watanabe 4ef289250f test-network: add a test case for new FQ settings 2019-12-14 12:33:37 +09:00
Yu Watanabe e83562e51e network: tc: add more settings for FQ 2019-12-13 23:36:17 +09:00
Yu Watanabe 2e048b14eb
Merge pull request #13915 from ddstreet/ipv6_mtu
Set ipv6 mtu after link-up or device mtu change
2019-12-13 18:33:04 +09:00
Yu Watanabe f7c79f0911
Merge pull request #14320 from yuwata/network-tc-fq_codel-more
network: tc: introduce more FQ-CoDel settings
2019-12-13 11:09:36 +09:00
Christian Ehrhardt eae1ef076d test: increase qemu timeout for TEST-08 and TEST-09
These tests two have shown to be flaky in Ubuntu test infrastructure,
but got more reliable with increased timeouts of 300 seconds each.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2019-12-12 19:42:04 +01:00
Shengjing Zhu 679ecd3616 nspawn: allow combination of private-network and network-namespace-path
Fixes: #14289
2019-12-12 19:26:32 +01:00
Lennart Poettering 3e761fe2c9
Merge pull request #14321 from yuwata/network-generator-14319
network-generator: allow empty hostname
2019-12-12 17:52:09 +01:00
Yu Watanabe 9401e48855 test-network: add a test case for the new settings of FQ-CoDel 2019-12-12 23:37:03 +09:00
Yu Watanabe ac810b75c1 network: tc: support more attributes for FQ-CoDel 2019-12-12 23:36:48 +09:00
Yu Watanabe dd1e09971b test: add a test case for network-generator 2019-12-12 19:02:25 +09:00
Yu Watanabe 0baddbd5ee test-network: add a test case for FQ 2019-12-12 17:26:31 +09:00
Susant Sahani 7234b91596 network tc: inroduce FQ - Fair Queue traffic policing
Please see http://man7.org/linux/man-pages/man8/tc-fq.8.html
2019-12-12 17:26:20 +09:00
Yu Watanabe 40821c2ac3 test-network: add a test case for fq-codel 2019-12-11 00:06:31 +09:00
Susant Sahani 4e5ef14919 network tc: Add support to conkfigure CoDel - Controlled-Delay Active Queue Management algorithm
```
$ tc qdisc show dev dummy99
qdisc fq_codel 8005: dev dummy99 root refcnt 2 limit 1000p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb ecn
$ network cat dumm99.network
[Match]
Name=dummy99

[TrafficControlQueueingDiscipline]
Parent=root
FairQueuingControlledDelayPacketLimit=1000

```
2019-12-11 00:06:31 +09:00
Yu Watanabe bfb68540d5
Merge pull request #14280 from yuwata/network-tbf-more
network: tc: add more options for TBF
2019-12-11 00:02:43 +09:00
Yu Watanabe 886e07a9cf test-network: add tests for new TBF settings 2019-12-10 01:28:38 +09:00
Yu Watanabe dcfc23ae77 network: tc: add more options for TBF 2019-12-10 01:28:38 +09:00
Yu Watanabe 0810e6d787 test-network: add a test case for SendOption= 2019-12-10 01:28:09 +09:00
Yu Watanabe bc942f69aa test-network: make test_bind_carrier more stable 2019-12-08 19:52:01 +00:00
Yu Watanabe debda5a4e5
Merge pull request #14273 from ssahani/ifb
network: introduce IFB
2019-12-08 05:13:08 +09:00
Yu Watanabe b076d5d76d test-network: add test case for IFB 2019-12-08 00:03:29 +09:00
Yu Watanabe dc7d3c5fd4 test-network: add test case for IPv4 DAD 2019-12-06 23:29:28 +09:00
Dan Streetman 7db0544705 test-network: add tests to verify IPv6MTUBytes 2019-12-05 17:53:10 -05:00
Dan Streetman 3e82152543 test-network: disable restart limiting for networkd
Some of the tests restart networkd rapidly, so restart limiting
must be disabled to avoid start ratelimiting from causing test
failures.
2019-12-05 17:53:10 -05:00
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