Commit graph

686 commits

Author SHA1 Message Date
Susant Sahani fde60a424e netdev bond: add support to configure tlb_dynamic_lb
Closes https://github.com/systemd/systemd/issues/11135

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

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

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

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

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

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

Let's also make addition of the "systemd-network" non-fatal. The user
exists on many machines anyway, hence it shouldn't fail if it already
exists.
2018-12-07 12:25:24 +01:00
Yu Watanabe 131717cbb4 test-network: make search_words_in_file() hit multi words 2018-12-06 16:48:42 +01:00
Yu Watanabe e4eacdb09f test-network: delete rules before running next test 2018-12-06 16:48:42 +01:00
Yu Watanabe fa7cd60281 test-network: add a line break after starting networkd
This may be ugly. But otherwise, outputs of several check commands
are shown without new line...
2018-12-06 16:48:42 +01:00
Yu Watanabe e40a58b5bc test-network: check link before starting dnsmasq 2018-12-06 16:48:42 +01:00
Yu Watanabe 14ecd604a4 test-network: show command outputs 2018-12-06 16:48:41 +01:00
Yu Watanabe a9bc5e370e test-network: sort imported modules 2018-12-06 16:48:41 +01:00
Yu Watanabe 09ea6724e7 test-network: sort links and units 2018-12-06 16:48:41 +01:00
Yu Watanabe 14dc033574 test-network: fix typo in class name 2018-12-06 16:48:41 +01:00
Yu Watanabe 801503d22b
Merge pull request #10988 from ssahani/IFLA_BRPORT_MCAST_TO_UCAST
networkd: bridge add support to configure multicast_to_unicast
2018-12-06 14:32:52 +01:00
Susant Sahani 4d7ed14f9f test-network: add test for bridge MulticastToUnicast 2018-12-06 11:54:14 +05:30
Susant Sahani efecf9cd15 test-network: Add test for invert RPDB rule 2018-12-06 11:00:36 +05:30
Susant Sahani 8b220643b1 networkd: RPDB rule - add support to configure inverted rule.
Closes #10706
2018-12-06 10:42:36 +05:30
Yu Watanabe 253de60634
Merge pull request #11021 from ssahani/isatap
networkd: Add support to configure ISATAP tunnel
2018-12-05 23:13:17 +01:00
Susant Sahani d3aa8b49e5 networkd: bridge add support to configure multicast_to_unicast
closes #10649
2018-12-03 23:49:46 +05:30
Chris Down c72703e26d cgroup: Add DisableControllers= directive to disable controller in subtree
Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.

This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.

Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.

This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.
2018-12-03 15:40:31 +00:00
Susant Sahani d0e728b6cd test-network: add test for ISATAP 2018-12-03 09:16:06 +05:30
Susant Sahani 918049ad53 networkd: Add support to configure ISATAP tunnel
Let's just reuse the code of sit tunnel to create a ISATAP tunnel.
Matter of turning a flag

Please see https://elixir.bootlin.com/linux/v4.19.6/source/net/ipv6/sit.c#L208
2018-12-03 09:15:24 +05:30
Yu Watanabe 97f9df9e30 network: rename Protocol= in [RoutingPolicyRule] to IPProtocol= 2018-12-02 06:13:47 +01:00
Zbigniew Jędrzejewski-Szmek 401faa3533
Merge pull request #10357 from poettering/import-fs
machinectl import-fs command and other fixes
2018-11-29 16:38:46 +01:00
Evgeny Vereshchagin c90c39ff7b catalog: reject entries where the language is too short early
Closes https://oss-fuzz.com/testcase-detail/5674475278827520
2018-11-29 13:41:40 +09:00
Yu Watanabe c0bf673376 test-network: stop systemd-networkd.socket during testing
To suppress noisy warning messages.
2018-11-28 22:00:40 +01:00
Yu Watanabe bad4969bba test-network: clear state file before starting networkd
Otherwise, some tests may disturb others, e.g.,
NetworkdNetWorkTests.test_routing_policy_rule_port_range and
NetworkdNetWorkTests.test_routing_policy_rule.
2018-11-28 21:40:57 +01:00
Yu Watanabe d486a2d0c1 test-network: use /run instead of legacy /var/run 2018-11-28 19:55:01 +01:00
Yu Watanabe fab57f7f13
Merge pull request #10948 from ssahani/iprule-port-proto
networkd: add support to configure ip rule port range and protocol.
2018-11-29 03:17:36 +09:00
Susant Sahani 926062f083 networkd: add support to configure ip rule port range and protocol.
Please see:

iprule: support for ip_proto, sport and dport match options
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858

Closes 10622
2018-11-28 20:06:28 +05:30
Susant Sahani 0d34228fc0 fix: systemd-networkd reverse route ordering
We missing a default route. Add gateway first.

This fixes https://github.com/systemd/systemd/issues/5430
2018-11-28 23:19:00 +09:00
Yu Watanabe 66e3834010
Merge pull request #10967 from evverx/check-directives
travis: make sure that *.perf and directives.* files are in sync
2018-11-28 14:02:42 +09:00
Evgeny Vereshchagin 5260482d4c tests: update test/fuzz/fuzz-netdev-parser/directives.netdev
This is a follow-up to 2266864b04.
2018-11-28 05:19:12 +01:00
Lennart Poettering 324ca05459 test: make TEST-27 non-racy
Not sure how I missed this, but we of course need to wait for the
"systemd-run" commands to finish before we can check the output files
this generated.
2018-11-28 13:05:54 +09:00
Lennart Poettering 196b0a11f3 test: add a test for StandardError=file:…
This deserves a test of its, given how broken on so many levels this
previously was.
2018-11-27 10:06:51 +01:00
Lennart Poettering 79411bbcce test: add test for setting service manager environment variables
This is a follow-up for #10594. I somehow forgot to commit this when I
worked on that.
2018-11-27 14:25:17 +09:00
Susant Sahani 2266864b04 networkd: Add support for ERSPAN tunnel
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan

[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
2018-11-27 11:04:42 +09:00
Yu Watanabe f5050e48ae test-network: add tests for #5430 and GatewayOnLink= 2018-11-26 18:47:52 +01:00
Lennart Poettering f5d9a12780
Merge pull request #10928 from yuwata/fix-9940
network: also load foo.netdev.d/*.conf
2018-11-26 18:46:47 +01:00
Lennart Poettering f5095a6af0 test: add simple test for importd
It tests importing and exporting, and a few other machinectl commands.

It currently does not test pulling (i.e. http downloads), but we might
want to add that later on.
2018-11-26 18:09:01 +01:00
Yu Watanabe d80734f7cd test-network: add one more test for netdev dropin .conf files
For netdev, config files are loaded twice, and the first time,
only Match and NetDev setions are read. So, the test given by
the previous commit covers only the second loading.
This adds another test that also covers the first loading.
2018-11-26 22:48:27 +09:00