1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

2921 Commits

Author SHA1 Message Date
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
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
Yu Watanabe
b17947d9cf test-network: drop meaningless test
On DHCPv6 lease renew, the kernel do not drop static routes, and hence
we do not try to reassign them. Hence, the test is mostly meaningless.
2022-07-09 11:44:25 +09:00
Yu Watanabe
063c7e9b13 test-network: introduce read_dnsmasq_log_file() helper function
This reduces the number of times that the log file is read.
Also, dropped unnecessary dump of the log file.
2022-07-09 11:44:25 +09:00
Yu Watanabe
a102a52c34 test-network: shorten sleep time a bit
Network interfaces will be ready after lease is acquired.
Hence, it is not necessary to wait more than lease time.
2022-07-09 11:44:25 +09:00
Yu Watanabe
1a8e1d7853 test-network: introduce read_link_state_file() helper function 2022-07-09 11:44:21 +09:00
Yu Watanabe
9d9fd4ad0a test: start test user session before idle action setting is changed
Otherwise, idle action may be triggered before starting the test user
session.

This also introduce create_session() and cleanup_session() helper
functions.

Fixes #23952.
2022-07-08 16:14:38 +00:00
Yu Watanabe
18f2638f48 test-network: merge DHCP client tests to improve performance 2022-07-08 13:04:02 +00:00
Yu Watanabe
74af762551 test: use timeout command to improve performance
c.f. #23723.
2022-07-08 07:02:13 +09:00
Yu Watanabe
d64c7623ab test: remove /failed and /testok before running test script 2022-07-08 07:00:02 +09:00
Yu Watanabe
0d6217efc1
Merge pull request #23937 from mrc0mmand/test-tweaks
Several ASan-related test suite tweaks
2022-07-08 06:25:57 +09:00
Frantisek Sumsal
8fec14a7d3 test: use PBKDF2 with capped iterations instead of Argon2
to reduce the amount of resources the test needs (similarly to TEST-24
where we do the same thing).
2022-07-07 20:54:41 +02:00
Frantisek Sumsal
1e42972958 test: make TEST-64 a bit more ASan friendly
Reduce the number of iterations in some of the test cases, since they
generate a huge amount of uevents and basically DoS udev (which can't
keep up while being slowed down by ASan). To avoid this, let's reduce
the number of iterations and bump the timeout when running under ASan,
since we're not interested in performance in such cases.
2022-07-07 20:54:41 +02:00
Frantisek Sumsal
0a62b8f705 test: avoid overriding an already existing EXIT handler
TEST-70 specified its own EXIT handler, which replaced the
`cleanup_loopdev` handler, so the loop device was always hanging around
once this test was run. Let's use the new `add_at_exit_handler()` stuff
to mitigate this.
2022-07-07 20:17:34 +02:00
Frantisek Sumsal
b92c3df242 test: allow multiple handlers for the EXIT signal
Bash allows only one handler per signal, so let's overcome this
limitation by having one dedicated EXIT signal which runs all registered
handlers from all over the place.
2022-07-07 20:17:34 +02:00
Frantisek Sumsal
98b27937cb test: bump the data partition size if we don't strip binaries
so we can run TEST-24 under sanitizers as well.

Also, when at it, use the 'named-fields' sfdisk format to make the code
a bit more descriptive without needing a manual.
2022-07-07 19:17:05 +02:00
Frantisek Sumsal
fdb70dd922 test: create an ASan wrapper for getent and su
since they "suffer" from the same issue as `login` and other binaries
that load PAM stuff
2022-07-07 19:17:05 +02:00
Yu Watanabe
63663a0f0f test: several cleanups for TEST-35-LOGIN
- use test_append_files() to install additional commands
- drop use of expect
- include assert.sh and use assertions at several places
- use timeout command at several places
- always use logind-test-user
- etc
2022-07-07 13:15:00 +00:00
Michal Sekletar
bf40417c7c tests: add test for handling of background sessions 2022-07-07 10:11:43 +09:00
Yu Watanabe
948fce5118 test: fix typo 2022-07-07 09:33:11 +09:00
Yu Watanabe
99080ed3f0
Merge pull request #23396 from msekletar/fix-idle-action-lock
logind: remember our idle state and use it to detect idle level transitions
2022-07-07 07:42:51 +09:00
Yu Watanabe
917c6bb4b3
Merge pull request #23916 from keszybz/assorted-patches
Assorted patches
2022-07-06 14:15:50 +09:00
Zbigniew Jędrzejewski-Szmek
cec3e9a774 fuzz: rename samples to avoid long test names 2022-07-05 21:49:12 +02:00
nl6720
0e68582323 tree-wide: link to docs.kernel.org for kernel documentation
https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520

These URLs are shorter and nicer looking.
2022-07-04 19:56:53 +02:00