1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

40436 Commits

Author SHA1 Message Date
Yu Watanabe
95355a281c network: add KeepConfiguration=dhcp-on-stop
The option prevents to drop lease address on stop.
By setting this, we can safely restart networkd.
2019-06-06 22:50:29 +09:00
Susant Sahani
7da377ef16 networkd: add support to keep configuration 2019-06-06 22:50:29 +09:00
Yu Watanabe
f0c53dfe3c
Merge pull request #12748 from keszybz/modernize-networkd-tests-style
Modernize networkd-tests.py style
2019-06-06 22:23:09 +09:00
Zbigniew Jędrzejewski-Szmek
9120e2bfdf NEWS: add note about the CPUAffinity= changes 2019-06-06 21:33:59 +09:00
Yu Watanabe
042526868a
Merge pull request #12508 from keszybz/no-root-checks
Drop many root checks
2019-06-06 21:31:19 +09:00
Zbigniew Jędrzejewski-Szmek
88aaf89ecb networkd-tests.py: properly escape pluses in regexps
Python warns that '\+' is an invalid escape. We need either '\\+' or r'\+'.
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek
ec38833c75 networkd-tests.py: remove some java-style boilerplate
A class was used to put some utility functions under a namespace. But then this
namespace was inherited into classes, so the namespace split was undone. Let's
just define those functions in the module namespace.

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

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

This makes things shorter and easier to read. Development is also easier because
it's possible to paste many of the commands directly to/from a shell.
2019-06-06 14:11:28 +02:00
Zbigniew Jędrzejewski-Szmek
632037cf4a networkd-tests.py: remove unused import 2019-06-06 13:58:58 +02:00
Yu Watanabe
9ee92e7ed8 network: check stored object is euivalent to what we want to remove
When object A is stored in Manager::rules and B is in ::rules_foreign,
and compare function for the object cannot distinguish them,
then freeing A causes B to be removed from rules_foreign or vice versa.

Hopefully fixes #12731.
2019-06-06 00:45:46 +09:00
Michael Biebl
c0d11245d2 Drop no longer needed halt-local.service.in
Follow-up for commit 4450894653.
2019-06-05 14:32:44 +02:00
Zbigniew Jędrzejewski-Szmek
341b19da90
Merge pull request #12744 from yuwata/test-network-stability-dhcp-tests
test-network: improve stability of DHCP client tests
2019-06-05 14:31:24 +02:00
Yu Watanabe
d90f4f7d91 test-network: do not directly compare two results of "ip address"
As it contains lifetime of the address.
2019-06-05 19:42:12 +09:00
Chris Down
eab5049520
Merge pull request #11778 from anitazha/rfe_11654_dbus
core: add ExecStartXYZEx= with dbus support for executable prefixes
2019-06-05 10:02:00 +01:00
Yu Watanabe
99058cd66a udev: propagate errors in udev_event_execute_rules()
And do not set initialized flag to the device.
2019-06-05 10:44:17 +02:00
Zbigniew Jędrzejewski-Szmek
97afc0351a udevadm trigger: log errors and return first failure
When udevadm trigger is called, the list of devices to trigger is always
generated through enumeration, and devices can come and go, so we should not
treat -ENOENT as a failure. But other types of failure should be logged.
It seems they were logged until baa30fbc2c.

Also, return the first error. (I'm not sure if there are other failure modes
which we want to ignore. If they are, they'll need to be whitelisted like
-ENOENT.).
2019-06-05 09:54:54 +02:00
Yu Watanabe
e16ffe7954 test-network: do not allow addresses in tentative state 2019-06-05 16:35:20 +09:00
Zbigniew Jędrzejewski-Szmek
7e95efb508 man: mention quoting in description of Parameters=
Also add a short example how to translate nspawn command line to .nspawn settings.

Fixes #12703.
2019-06-05 04:23:18 +09:00
Yu Watanabe
277cb7631e
Merge pull request #12741 from keszybz/bpf-firewall-warning
Silence BPF firewall warning when not useful
2019-06-05 04:01:44 +09:00
Yu Watanabe
e8b88eb94c
Merge pull request #12737 from keszybz/meson-man-nspawn
meson: escape dots in man/man helper
2019-06-05 02:45:39 +09:00
Yu Watanabe
56dacb8d2e
Merge pull request #12661 from mrc0mmand/debug-journalctl-flush
journal: disable varlink timeout for journalctl --flush or friends
2019-06-05 00:46:29 +09:00
Zbigniew Jędrzejewski-Szmek
4fb334113b man/man: refer to the right build directory in the helpers
I have no idea how this one slipped through.
2019-06-04 17:33:59 +02:00
Zbigniew Jędrzejewski-Szmek
f140ed02f7 Silence warning about BPF firewall in containers
We'd get a warning on every nspawn invocation:
dev-hugepages.mount: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
(This warning is only shown for the first unit using IP firewalling.)

Before the previous commit, I'd generally get a warning about systemd-udev.service, even though that service is
not started in containers. But are still many other units which that declare a
firewall, which is currently unsupported in containers. Let's stop warning
about this.

The warning is still emitted e.g. if legacy cgroups are used. This is something
that can be configured, so it makes more sense to emit the warning.
2019-06-04 17:22:37 +02:00
Zbigniew Jędrzejewski-Szmek
84d2744bc5 Move warning about unsupported BPF firewall right before the firewall would be created
There's no need to warn about the firewall when parsing, because the unit might
not be started at all. Let's warn only when we're actually preparing to start
the firewall.

This changes behaviour:
- the warning is printed just once for all unit types, and not once
  for normal units and once for transient units.
- on repeat warnings, the message is not printed at all. There's already
  detailed debug info from bpf_firewall_compile(), so we don't need to repeat
  ourselves.
- when we are not root, let's say precisely that, not "lack of necessary privileges"
  and "the local system does not support BPF/cgroup firewalling".

Fixes #12673.
2019-06-04 17:22:37 +02:00
Yu Watanabe
0bd3c2102f journalctl: make 'journalctl --flush' or friends not fail with varlink timeout
Closes #12570.
2019-06-04 23:27:26 +09:00
Zbigniew Jędrzejewski-Szmek
90f003a39f meson: escape dots in man/man helper
It was impossible to view systemd.nspawn(5), because systemd-nspawn(1) was matched
also, and happened to be earlier in the list. The solution in this patch is pretty
crude, but is should be enough for our purposes, since we don't have any regexp
special characters in man page names except for the dot.
2019-06-04 12:56:26 +02:00
Zbigniew Jędrzejewski-Szmek
aafec74d04
Merge pull request #12733 from keszybz/sd-bus-error-reporting
Bus error reporting improvements
2019-06-04 12:01:52 +02:00
Zbigniew Jędrzejewski-Szmek
33f724f427
Merge pull request #12734 from keszybz/cpu-set-util-on-i386
Fixes for test-cpu-set-util on i386
2019-06-04 12:01:20 +02:00
Yu Watanabe
ca866a32fb bash-completion: support "networkctl delete" 2019-06-04 12:00:49 +02:00
Yu Watanabe
f2083c718b journalctl: mention --smart-relinquish-var in log message 2019-06-04 17:04:35 +09:00
Yu Watanabe
17087340c3 journalctl: fix error cause in log message
If varlink_call() returns negative errno, then `error` is null.
2019-06-04 17:03:36 +09:00
Zbigniew Jędrzejewski-Szmek
64412970ac test-cpu-set-util: fix allocation size check on i386
We get just 28 bytes not 32 as on 64-bit architectures (__cpu_set_t is 4 bytes,
we need at least 26, so 28 satisfies the constraints).
2019-06-04 09:40:38 +02:00
Zbigniew Jędrzejewski-Szmek
a299ce058b test-cpu-set-util: fix comparison for allocation size
On i386, __cpu_mask is 4 bytes, so we'd check if c.allocated >= 0, and
gcc would warn about a bogus comparison. Let's round up.

Fixes #12726.
2019-06-04 09:23:34 +02:00
Yu Watanabe
9f08a578a8 network: remove unused argument in routing_policy_rule_configure() 2019-06-04 16:23:18 +09:00
Yu Watanabe
d26267ddf1 network: fix double free on error path 2019-06-04 16:23:18 +09:00
Yu Watanabe
3681d63935 network: fix UBSAN issue
Closes #12724.
2019-06-04 09:12:44 +02:00
Yu Watanabe
38b9af6154 networkctl: re-cast value stored in Set with INT_TO_PTR() 2019-06-04 09:08:55 +02:00
Zbigniew Jędrzejewski-Szmek
37dc34f702 shared/generator: voidify mkdir_parents() call
To appease coverity: CID#1401752.
2019-06-04 08:57:54 +02:00
Zbigniew Jędrzejewski-Szmek
24a4e7ff9d busctl: always prefix bus error message with local string
The message we get from the bus can be pretty bare-bones, and the user might be
confused which operation failed. Since we don't control the other side, let's
prefix the remote message with an informative prefix.
2019-06-04 08:37:24 +02:00
Zbigniew Jędrzejewski-Szmek
9e5205d2f7 sd-bus: improve bus error message for uknown properties
"Unknown interface or property." →
"Unknown interface org.freedesktop.network1.Link or property BitRates."
(I don't think the quotes are necessary. Dbus names have pretty strict rules.)
2019-06-04 08:37:04 +02:00
Zbigniew Jędrzejewski-Szmek
8210a61ad5 networkctl: log quietly if we fail to get bit rates
If we query older networked, they will be missing. This is not an error.
Also, make the error more informative, because the bus error itself might
be just "Unknown interface or property" which is not enough to understand
what is going on.
2019-06-04 08:37:04 +02:00
Michal Sekletar
71923237b1 cpu-set-util: use %d-%d format in cpu_set_to_range_string() only for actual ranges 2019-06-03 22:36:58 +02:00
Zbigniew Jędrzejewski-Szmek
4a6a2092d3 test-sleep: also print parsed modes and states
This allows the parser to be verified against on-disk config.
2019-06-04 04:15:09 +09:00
Yu Watanabe
3c2c30ebab
Merge pull request #12708 from yuwata/test-network-networkctl-tests
udevadm: add --wait-for-initialization option and use it in systemd-networkd-tests.py
2019-06-04 03:58:47 +09:00
Yu Watanabe
78690bb5d0 test-network: disable SystemCallFilter= when *SAN is enabled 2019-06-04 01:29:28 +09:00
Yu Watanabe
6d5b4efed2 test-network: add test for MTU field of 'networkctl status' 2019-06-04 01:29:28 +09:00
Yu Watanabe
bee692fd38 test-network: add tests for "networkctl delete" 2019-06-04 01:29:28 +09:00
Yu Watanabe
1ca44d7dfd test-network: move networkctl related tests to NetworkctlTests class 2019-06-04 01:29:24 +09:00
Yu Watanabe
ae760f4b16 udevadm: add --wait-for-initialization option to "udevadm info" 2019-06-04 01:28:30 +09:00