Commit graph

2943 commits

Author SHA1 Message Date
Yu Watanabe 54d5c126d3 test: do not restart getty@tty2 automatically 2022-07-31 00:15:47 +09:00
Yu Watanabe fe9d58b25a test: terminate session and user on cleanup 2022-07-31 00:15:47 +09:00
Lennart Poettering 8f304b991c
Merge pull request #23991 from yuwata/udev-reload
udev: reload rules and builtins only when mtime of a config changed
2022-07-25 11:20:08 +02:00
Quentin Deslandes e88748c17e sysctl: add --strict option to fail if sysctl does not exists
systemd-sysctl currently fails silently under any of these conditions:
- Missing permission to write a sysctl.
- Invalid sysctl (path doesn't exists).
- Ignore failure flag ('-' in front of the sysctl name).

Because of this behaviour, configuration issues can go unnoticed as
there is no way to detect those unless going through the logs.

--strict option forces systemd-sysctl to fail if a sysctl is invalid or
if permission are insufficient. Errors on sysctl marked as "ignore
failure" will still be ignored.
2022-07-25 10:15:43 +02:00
Yu Watanabe 32ab27afe8 test-network: reload udevd when .link file is copied/removed 2022-07-23 15:05:22 +09:00
Yu Watanabe c9fbe0bd10
Merge pull request #24074 from yuwata/network-dhcp6-rapid-commit
network: dhcp6: re-introduce RapidCommit= setting
2022-07-23 08:10:01 +09:00
Yu Watanabe 8015e25870 test: wait for user service or slice to be finished
Hopefully fixes #24040.
2022-07-22 19:47:09 +00:00
Yu Watanabe 91a7afdeae test-network: add tests for RapidCommit= 2022-07-22 21:28:24 +09:00
Yu Watanabe b1eaae53a2 test-network: drop unnecessary call of systemctl
As the units are not started at that stage.
2022-07-22 10:36:00 +09:00
Yu Watanabe 249b7eccf7 test-network: drop unnecessary default argument 2022-07-22 10:34:33 +09:00
Yu Watanabe 87b308c825 test-network: do not stop/restart udevd and related socket units
That's not necessary. Moreover, if the socket units are stopped in
`setUpModule()`, then there exists a short timespan that we cannot call
`udevadm control`, as the control socket may not be opened yet.

If we run whole tests, then the first test is
NetworkctlTests.test_altname, and it calls `udevadm control` in `setUp()`.
Hence, the test may fail.

Fixes https://github.com/systemd/systemd-centos-ci/pull/512#issuecomment-1191591008.
2022-07-22 10:31:38 +09:00
Lennart Poettering a0f4426d0f tmpfiles: automatically provision /etc/issue.d/ + /etc/motd.d/ + /etc/hosts from credentials 2022-07-21 00:06:22 +02:00
Lennart Poettering 1d77721f30 tmpfiles: accept additional tmpfiles lines via credential 2022-07-20 23:53:22 +02:00
Evgeny Vereshchagin e99e4e4fec
Merge pull request #24025 from DaanDeMeyer/mkosi-sanitizers
mkosi: Changes to allow booting with sanitizers in mkosi
2022-07-18 19:24:51 +03:00
Daan De Meyer 7ca9563ca1 mkosi: Remove usage of deprecated option names/sections 2022-07-18 16:54:58 +02:00
Yu Watanabe 5509518193
Merge pull request #24047 from dtardon/list-users-linger
Add linger status to `loginctl list-users`
2022-07-18 15:05:25 +09:00
David Tardon 283db37a20 test: merge grep | awk calls 2022-07-17 20:26:09 +02:00
David Tardon 6083f7a604 test: add a simple test for list-users 2022-07-17 20:26:09 +02:00
Lennart Poettering 3acb6edef3 sysusers: allow defining additional sysusers lines via credentials 2022-07-16 00:47:22 +09:00
Lennart Poettering 9fbb7df7bc
Merge pull request #24011 from poettering/condition-cred
pid1: add new condition type "ConditionCredential=" for checking for credentials passed into the system
2022-07-15 15:03:49 +02:00
Lennart Poettering 708daf42d8 tmpfiles: optionally, decode string to write to files with base64
This is useful to use "f" or "w" to write arbitrary binary files to
disk, or files with newlines and similar (for example to provision SSH
host keys and similar).
2022-07-15 11:55:03 +02:00
Lennart Poettering 351f7d5143 fuzz: add ConditionCredential= to fuzz files, and sort their sections 2022-07-15 10:53:45 +02:00
Lennart Poettering 4f80cfca5e pid1: add mechanism for conditionalizing units/network/netdev/link based on credentials passed in
This is useful when provisioning systems via nspawn/qemu and running
specific services only if specific data is passed into the system.
2022-07-15 10:53:45 +02:00
Lennart Poettering 8de7de462b pid1: import creds from SMBIOS too, not just qemu's fw_cfg
This imports credentials also via SMBIOS' "OEM vendor string" section,
similar to the existing import logic from fw_cfg.

Functionality-wise this is very similar to the existing fw_cfg logic,
both of which are easily settable on the qemu command line.

Pros and cons of each:

SMBIOS OEM vendor strings:
   - pro: fast, because memory mapped
   - pro: somewhat VMM independent, at least in theory
   - pro: qemu upstream sees this as the future
   - pro: no additional kernel module needed
   - con: strings only, thus binary data is base64 encoded

fw_cfg:
   - pro: has been supported for longer in qemu
   - pro: supports binary data
   - con: slow, because IO port based
   - con: only qemu
   - con: requires qemu_fw_cfg.ko kernel module
   - con: qemu upstream sees this as legacy
2022-07-15 08:31:34 +09:00
Yu Watanabe 3f5ef8aeac
Merge pull request #24019 from yuwata/network-ipv4ll
network: refuse 169.254.0.0/24 and 169.254.255.0/24
2022-07-15 07:59:13 +09:00
Yu Watanabe dfeb5a076a
Merge pull request #24016 from poettering/sysctl-cred-extra
sysctl: also process sysctl requests via the "sysctl.extra" credential
2022-07-15 04:20:35 +09:00
Yu Watanabe 72c747e6d1 test-network: add a test case for IPv4LLStartAddress= 2022-07-15 04:01:56 +09:00
Yu Watanabe c1dd250f18
Merge pull request #23927 from AndreKalb/feature/ipv4-link-local-start-address
network: Feature IPv4 link-local start address
2022-07-15 03:21:26 +09:00
Lennart Poettering 39f0d1d2e7 sysctl: also process sysctl requests via the "sysctl.extra" credential 2022-07-14 18:02:58 +02:00
Michal Sekletar 527e0e8188 Revert "tests: add test for handling of background sessions"
This reverts commit bf40417c7c.
2022-07-14 11:07:13 +02:00
Andre Kalb 34b63c9e45 network: Add support to select an IPv4 link-local start address 2022-07-13 23:57:18 +02:00
David Tardon 9ac0855b61 test: add test for org.freedesktop.login1.Session SetType 2022-07-13 13:53:13 +02:00
David Tardon bd681a7eb0 test: ensure cleanup functions return success
Otherwise the return value of the last command is propagated, which may
cause spurious test failures. E.g., pkill returns 1 if no process
matched, which may be a problem in cleanup session:

cleanup_session() {
...

    pkill -u "$(id -u logind-test-user)"
    sleep 1
    pkill -KILL -u "$(id -u logind-test-user)"
}

If there are no remaining processes when the final pkill runs, it will
return 1 and therefore cleanup_session will return 1 as well.
2022-07-13 13:53:13 +02:00
Yu Watanabe f54dce2d4f test-network: save and restore timezone
Several DHCP client tests change the system timezone.
Let's save the current timezone at the beginning, and restore it with
the saved value at the end.
2022-07-13 10:30:48 +02:00
Yu Watanabe e11d0e3925 test-network: wait for L2TP tunnels being removed
Fixes #23985.
2022-07-13 02:36:14 +02:00
Yu Watanabe e755ad61ba test-network: support to remove routing policy rules with l3mdev flag 2022-07-11 22:39:26 +02:00
Yu Watanabe b5dac5b0de test-network: merge stdout and stderr of invoked command by call()
Otherwise, the logs may be messed up.
2022-07-11 22:38:21 +02:00
Yu Watanabe a962d85797 test-network: various cleanups
- introduce several helper functions
- do not list unit files, but remove the runtime unit directory in
  tearDown().
- do not list used interfaces, but remove all interfaces previously not
  exists in tearDown().
- save routes and routing policy rules before running tests, and flush
  unnecessary routes and rules in each tearDown() calls.
- drop many time.sleep() calls.
- call tearDown() after each sub tests.
- shorten code.
- several coding style fixes.
- etc, etc...

Hopefully, this improves performance of the test.
2022-07-11 19:57:24 +02:00
Yu Watanabe 286bf3a940 test-network: extend timeout for DHCP lease to be expired
Fixes #23964.
2022-07-11 16:54:45 +02:00
Yu Watanabe 37611ccb19 test-network: use wait_operstate() at one more place 2022-07-09 12:20:11 +09:00
Yu Watanabe 894ff7d1ab test-network: suppress periodic output in wait_operstate() 2022-07-09 12:19:52 +09:00
Yu Watanabe 163d095fc3 test-network: disable debugging logs from networkctl, resolvectl, and so on 2022-07-09 12:19:20 +09:00
Yu Watanabe 589af70b87 test-network: merge two DHCPv6 client tests 2022-07-09 11:44:25 +09:00
Yu Watanabe 4b31fc88ac test-network: replace sleep with wait_address() and wait_address_dropped() 2022-07-09 11:44:25 +09:00
Yu Watanabe 0730e3767d test-network: merge two more tests with test_dhcp_client_ipv4_only 2022-07-09 11:44:25 +09:00
Yu Watanabe 3d8e0aa2de test-network: merge tests for UseDNS= 2022-07-09 11:44:25 +09:00
Yu Watanabe 2d7a594fee test-network: merge two IPv4LL tests 2022-07-09 11:44:25 +09:00
Yu Watanabe 15519a81ac test-network: drop test_dhcp_client_ipv4_ipv6
As the test is covered by test_dhcp_client_reuse_address_as_static.
2022-07-09 11:44:25 +09:00
Yu Watanabe 2b6a24a602 test-network: check DHCPv4 address in more detail
Also, this drops redundant address check through networkctl.
2022-07-09 11:44:25 +09:00
Yu Watanabe e81083f2d8 test-network: drop 25-dhcp-v4-server-veth-peer.network 2022-07-09 11:44:25 +09:00