Commit Graph

1845 Commits

Author SHA1 Message Date
Lennart Poettering a60d5b2f38 test: add tpm2 and fido2 libs to dlopen test 2020-12-17 20:02:24 +01:00
Zbigniew Jędrzejewski-Szmek 68f18549c5
Merge pull request #18001 from systemd/wip/hadess/unsupported-dmi
meson: Disable dmi_memory_id on arches without DMI
2020-12-17 09:16:33 +01:00
Frantisek Sumsal 0ce96f4152
Merge pull request #17998 from mrc0mmand/qemu-drop-trailing-whitespace
test: drop the trailing whitespace from the QEMU version check
2020-12-16 23:48:17 +01:00
Bastien Nocera 2bfb92a978 meson: Disable dmi_memory_id on arches without DMI 2020-12-16 19:21:19 +01:00
Bastien Nocera 4dd465cb4e udev: Extract RAM properties from DMI information
Add memory_id program to set properties about the physical memory
devices in the system. This is useful on machines with removable memory
modules to show how the machine can be upgraded, and on all devices to
detect the actual RAM size, without relying on the OS accessible amount.

Closes: #16651
2020-12-16 18:32:29 +01:00
Yu Watanabe 84a1ff9457 tree-wide: fix typo 2020-12-16 18:30:15 +01:00
Zbigniew Jędrzejewski-Szmek 199f75205b
Merge pull request #17799 from yuwata/oss-fuzz-25353
logs-show: skip non-utf8 name entries
2020-12-16 17:52:35 +01:00
Frantisek Sumsal 26b127245a test: s/MUMA/NUMA/ 2020-12-16 16:38:44 +01:00
Frantisek Sumsal f26d091460 test: drop the trailing whitespace from the QEMU version check
I suspect the original version of the regex was written on a system,
which prints both the QEMU version and the QEMU package version in the
--version output, like Fedora:

$ /bin/qemu-system-x86_64 --version
QEMU emulator version 4.2.1 (qemu-4.2.1-1.fc32)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

However, Arch Linux prints only the QEMU version:
$ /bin/qemu-system-x86_64 --version
QEMU emulator version 5.2.0
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers

This causes the awk regex to not match the version string, since there's
no whitespace after it, causing the version check to fail (as well as the
TEST-36-NUMAPOLICY) as well.

Follow-up for 43b49470d1.
2020-12-16 16:38:26 +01:00
Yu Watanabe a7c52e1ee1
Merge pull request #17968 from yuwata/purge-libudev
udev: do not link with libudev
2020-12-16 12:07:46 +09:00
Susant Sahani 937e305e93 network: Allow to configure interface promiscuous mode 2020-12-15 20:25:08 +00:00
Christian Ehrhardt 43b49470d1 test: use modern qemu numa arguments
Upgrading to qemu 5.2 breaks TEST-36-NUMAPOLICY like:
  qemu-system-x86_64: total memory for NUMA nodes (0x0) should
  equal RAM size (0x20000000)

Use the new (as in >=2014) form of memdev in test 36:
 -object memory-backend-ram,id=mem0,size=512M -numa node,memdev=mem0,nodeid=0

Since some target systems are as old as qemu 1.5.3 (CentOS7) but the new
kind to specify was added in qemu 2.1 this needs to add version parsing and
add the argument only when qemu is >=5.2.

Fixes #17986.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2020-12-16 05:16:41 +09:00
Yu Watanabe f2bd032044 journal: refuse data which contain invalid fields
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25353.
2020-12-16 04:56:35 +09:00
Yu Watanabe 90ac73eb1b rules: drop broken links 2020-12-16 02:31:44 +09:00
Dan Streetman b226c15cfb test-network: increase wait_online timeout to handle longer dhcpv4 transient timeout
Previous commits changed the dhcpv4 retransmission algorithm to be
slightly slower, changing the amount of time it takes to notify
systemd-networkd that the dhcpv4 configuration has (transiently)
failed from around 14 second up to 28 seconds.

Since the test_dhcp_client_with_ipv4ll_without_dhcp_server test
configures an interface to use dhcpv4 without any operating dhcpv4
server running, it must increase the amount of time it waits for
the test interface to reach degraded state.
2020-12-14 18:19:32 -05:00
Yu Watanabe 28423d9a75 tree-wide: fix typo 2020-12-14 12:05:55 +00:00
Yu Watanabe 8d80f27530 sd-device: make TAGS= property prefixed and suffixed with ":"
The commit 6f3ac0d517 drops the prefix and
suffix in TAGS= property. But there exists several rules that have like
`TAGS=="*:tag:*"`. So, the property must be always prefixed and suffixed
with ":".

Fixes #17930.
2020-12-14 14:04:53 +09:00
Zbigniew Jędrzejewski-Szmek 6bfbfce795 networkd-test: add final newlines in generated files, use .format() 2020-12-10 14:31:39 +09:00
Luca Boccassi b7fca1b059 test: pull in weak deps into tests
(Pulled from @bluca's comment here:
https://github.com/systemd/systemd/pull/17884#issuecomment-740005624 and
turned into a commit by @poettering)
2020-12-09 13:34:49 +01:00
Yu Watanabe 6f3ac0d517 sd-device: use set_strjoin()
This slightly changes TAGS= and CURRENT_TAGS= properties:

Before
E: TAGS=:aaa:bbb:

After
E: TAGS=aaa:bbb
2020-12-08 12:28:58 +09:00
Luca Boccassi 32c7f02bb4
Merge pull request #17829 from anitazha/testoomdfix
test: fix TEST-56-OOMD thresholds for linux 5.9 changes
2020-12-04 12:22:46 +00:00
Yu Watanabe 452d86a532 test-network: add tests for IPv6 routes with reject type 2020-12-04 16:50:35 +09:00
Yu Watanabe 37b9c79e5d test-network: sleep 1s after reloading configs
As interfaces will be reconfigured asynchronously after `networkctl reload`.
So, right after `networkctl reload` is finished, interfaces may be still
in 'configured' state with the old .network files.
2020-12-04 11:28:52 +09:00
Lennart Poettering 6dd16814a5
Merge pull request #17079 from keszybz/late-exec-resolution
Resolve executable paths before execution, use fexecve()
2020-12-03 14:58:20 +01:00
Anita Zhang 14d044da23 test: fix TEST-56-OOMD thresholds for linux 5.9 changes
Fixes #17533

The memory pressure values of the units in TEST-56-OOMD seemed to be a
lot lower after updating to linux 5.9. This is likely due to a fix from
e22c6ed90a.

To account for this, I lowered memory.high on testbloat.service to
throttle it even more. This was enough to generate the 50%+ value to trigger
oomd for the test, but as an extra precaution I also lowered the oomd
threshold to 1% so it's certain to try and kill testbloat.service.
2020-12-02 15:27:15 -08:00
Zbigniew Jędrzejewski-Szmek efbbdf2923
Merge pull request #17798 from yuwata/ipv4ll-follow-ups
network: improve debug logs and add tests for IPv4LL
2020-12-02 14:59:33 +01:00
walbit-de 2d453f3597
network: add Protocol= to vlan netdev (#17794) 2020-12-02 14:58:02 +01:00
Yu Watanabe da115b935a tree-wide: fix typos 2020-12-02 10:53:33 +01:00
Yu Watanabe 240e41372e test-network: confirm that IPv4ll address is dropped after DHCPv4 lease is acquired 2020-12-02 18:50:13 +09:00
Zbigniew Jędrzejewski-Szmek 0107b769b1 networkd: start ipv4ll when dhcp has trouble getting a lease
Fixes #13316.
2020-11-30 12:37:36 +09:00
Zbigniew Jędrzejewski-Szmek 3ca1fab70a networkd: merge ll addressing fallback modes into normal "boolean" values
They are not really boolean, because we have both ipv4 and ipv6, but
for each protocol we have either unset, no, and yes.

From https://github.com/systemd/systemd/issues/13316#issuecomment-582906817:
LinkLocalAddressing must be a boolean option, at least for ipv4:
- LinkLocalAddressing=no => no LL at all.

- LinkLocalAddressing=yes + Static Address => invalid configuration, warn and
  interpret as LinkLocalAddressing=no, no LL at all.

(we check that during parsing and reject)

- LinkLocalAddressing=yes + DHCP => LL process should be subordinated to the
  DHCP one, an LL address must be acquired at start or after a short N
  unsuccessful DHCP attemps, and must not stop DHCP to keeping trying. When a
  DHCP address is acquired, drop the LL address. If the DHCP address is lost,
  re-adquire a new LL address.

(next patch will move in this direction)

- LinkLocalAddressing=fallback has no reason to exist, because LL address must
  always be allocated as a fallback option when using DHCP. Having both DHCP
  and LL address at the same time is an RFC violation, so
  LinkLocalAdressing=yes correctly implemented is already the "fallback"
  behavior. The fallback option must be deprecated and if present in older
  configs must be interpreted as LinkLocalAddressing=yes.

(removed)

- And for IPv6, the LinkLocalAddress option has any sense at all? IPv6-LL
  address aren't required to be always set for every IPv6 enabled interface (in
  this case, coexisting with static or dynamic address if any)? Shouldn't be
  always =yes?

(good question)

This effectively reverts 29e81083bd. There is no
special "fallback" mode now, so the check doesn't make sense anymore.
2020-11-30 12:37:36 +09:00
Yu Watanabe dca63b5b46
Merge pull request #17474 from yuwata/network-drop-link-deserialization-logic
network: drop link deserialization logic
2020-11-27 09:08:01 +09:00
Pavel Sapezhko 6d8325f66a resolved: allow cache responses from local DNS servers 2020-11-27 09:03:42 +09:00
Lennart Poettering e2c5e698c0 mkosi: make sure our mkosi files work with f33 2020-11-25 13:18:36 +01:00
Dan Streetman 3965279c67 test/test-functions: copy /usr/lib/pam.d into $initdir
The systemd-user file has been moved from /etc/pam.d into /usr/lib/pam.d,
so test-functions needs to copy it from /usr/lib/pam.d instead.

This will copy it from either location.
2020-11-23 17:17:19 -05:00
Zbigniew Jędrzejewski-Szmek d407638382 test/udev-test: gracefully exit when imports fail
In Fedora rawhide various perl modules are now available as separate
packages that are not pulled in by dependencies. If we don't have some
package, skip the tests.

This ugly code is apparently the way to do conditional imports:
https://www.cs.ait.ac.th/~on/O/oreilly/perl/cookbook/ch12_03.htm.
2020-11-18 03:50:17 +09:00
Zbigniew Jędrzejewski-Szmek ffe3533eb7
Merge pull request #17599 from yuwata/meson-fuzz-tests
meson: do not build fuzzers when -Dfuzz-tests=false
2020-11-17 10:16:47 +01:00
Yu Watanabe 1763ef1d49 meson: do not build fuzzers when fuzz-tests=false
Closes #17578.
2020-11-13 18:15:37 +09:00
Yu Watanabe d3f044ddf4 test: fix typo 2020-11-13 16:29:00 +09:00
Yu Watanabe faa73d4e0c license: LGPL-2.1+ -> LGPL-2.1-or-later
Follow-up for db9ecf0501.
2020-11-12 10:50:23 +01:00
Lennart Poettering 394131d5be
Merge pull request #17497 from anitazha/randomizeonce
timer: add new feature FixedRandomDelay=
2020-11-10 13:29:04 +01:00
Zbigniew Jędrzejewski-Szmek b8aac5014c
Merge pull request #17431 from msekletar/udev-link-update-race
udev: make algorithm that selects highest priority devlink less susceptible to race conditions
2020-11-10 09:41:57 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Zbigniew Jędrzejewski-Szmek f98ca3a11d test-execute: make sure shell execs the child
echo is a built-in, so we were testing execve in our own code, and not in
the running child.
2020-11-06 15:20:34 +01:00
Zbigniew Jędrzejewski-Szmek a6d9111c67 core/execute: fall back to execve() for scripts
fexecve() fails with ENOENT and we need a fallback. Add appropriate test.
2020-11-06 15:14:13 +01:00
Kristijan Gjoshev acf24a1a84 timer: add new feature FixedRandomDelay=
FixedRandomDelay=yes will use
`siphash24(sd_id128_get_machine() || MANAGER_IS_SYSTEM(m) || getuid() || u->id)`,
where || is concatenation, instead of a random number to choose a value between
0 and RandomizedDelaySec= as the timer delay.
This essentially sets up a fixed, but seemingly random, offset for each timer
iteration rather than having a random offset recalculated each time it fires.

Closes #10355

Co-author: Anita Zhang <the.anitazha@gmail.com>
2020-11-05 10:59:33 -08:00
Martin Wilck dec8e6cfb4 test/sys-script.py: add missing DEVNAME entries to uevents 2020-11-02 11:43:15 +01:00
Martin Wilck cbeb23d863 test/udev_test.pl: add "expected good" count
Since 'test/udev-test.pl: count "good" results', we know how many
checks succeeded. Add an "expected good" count to make that number
more meaningful.
2020-11-02 11:43:15 +01:00
Martin Wilck f1cb086054 test/udev-test.pl: suppress umount error message at startup
umount emits an error message "no mount point specified" if the
tmpfs isn't mounted yet, which is the normal case.
Suppress that by redirecting stderr.
2020-11-02 11:43:15 +01:00
Martin Wilck 0ed1b64469 test/sd-script.py: new helper script for udev testing
Script for generating LOTS of SCSI disk and partition devices in
the fake sysfs we use for udev testing.

This script is supposed to be run after sys-script.py. It uses
code from sys-script.py as template to generate additional SCSI disk data
structures. Together with the "generator" code in udev-test.pl
added in the previous patch, it allows to run udev tests with almost
arbitrarily many devices, and thus to do performance scaling tests.
2020-11-02 11:43:15 +01:00