Yu Watanabe
cfacd245e7
test-time-util: do not fail on DST change
2023-03-13 04:43:51 +09:00
Yu Watanabe
6bed374280
test: add more testcases for formatting/parsing timestamp
2023-03-13 04:43:51 +09:00
Yu Watanabe
bd5770da76
time-util: make USEC_TIMESTAMP_FORMATTABLE_MAX for 32bit system off by one day
...
As the same reason why we take one day off for 64bit case.
This also makes both upper bounds always defined for testing.
2023-03-13 04:43:19 +09:00
Yu Watanabe
c9501b03cd
Merge pull request #26641 from medhefgo/boot-elf2efi
...
boot: Drop gnu-efi / Add elf2efi.py
2023-03-11 17:15:01 +09:00
Lennart Poettering
d0ed83f3ae
Merge pull request #26737 from poettering/runtime-scope
...
add RuntimeScope enum, replacing LookupScope and various booleans indicating whether we are called in a per-system or per-user context
2023-03-10 13:09:40 +01:00
Jan Janssen
dfca5587cf
tree-wide: Drop gnu-efi
...
This drops all mentions of gnu-efi and its manual build machinery. A
future commit will bring bootloader builds back. A new bootloader meson
option is now used to control whether to build sd-boot and its userspace
tooling.
2023-03-10 11:41:03 +01:00
Lennart Poettering
f69edd6faf
Merge pull request #26331 from ddstreet/tpm2_pcr_read
...
Tpm2 pcr read
2023-03-10 10:24:39 +01:00
Lennart Poettering
4870133bfa
basic: add RuntimeScope enum
...
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
2023-03-10 09:47:39 +01:00
Lennart Poettering
6eda6f7e51
mountpoint-util: add new fstype_can_umask() helper
2023-03-09 21:56:42 +01:00
Lennart Poettering
034ebc47a2
mountpoint-util: move 'norecovery' detection into its own helper call
...
And let's also ask the kernel explicitly for support.
2023-03-09 21:56:42 +01:00
Lennart Poettering
4e6d305ae2
mountpoint-util: use mount_option_supported() to detect if 'discard' is support for an fs
2023-03-09 21:56:42 +01:00
Lennart Poettering
117e703447
mountpoint-util: generalize mount_option_supported()
2023-03-09 21:56:42 +01:00
Dan Streetman
e067a49fd1
test/test-tpm2: add tests for pcr selection functions
2023-03-09 10:46:19 -05:00
Dan Streetman
c69bd0abdb
tpm2: add/rename functions to manage pcr selections
...
This renames some functions to match other to/from_string() naming,
and allows better management of TPML_PCR_SELECTION and TPMS_PCR_SELECTION
structs.
2023-03-09 10:46:19 -05:00
Dan Streetman
5e31ddd11e
test/test-bitfield: add tests for bitfield macros
2023-03-09 10:46:12 -05:00
Lennart Poettering
7d3b157b77
mountpoint-util: add helper that checks if MS_NOSYMFOLLOW is supported
2023-03-09 16:14:29 +01:00
Zbigniew Jędrzejewski-Szmek
b2d3e2a0dc
tests: merge test-tmpfiles.c into test-tmpfile-util.c
...
The former was added in 65b3903ff5 ,
but the name is confusing: the test has nothing to do with systemd-tmpfiles.
It had one function that mostly tested functions from tmpfile-util.c, so
just move it into the latter.
2023-03-09 21:35:53 +09:00
Dan Streetman
326ef26700
test/test-macro: add tests for FOREACH_VA_ARGS()
2023-03-09 07:11:04 -05:00
Luca Boccassi
2ca6f09b30
Merge pull request #26656 from yuwata/mkdir-error-code
...
mkdir: fix error code
2023-03-08 21:23:07 +00:00
Yu Watanabe
5716c27e1f
macro: introduce FOREACH_ARRAY() macro
...
The pattern that runs all array element is quite common.
But, sometimes, the number of element may be in a signed integer, or the
array may be NULL.
2023-03-07 13:27:16 +09:00
Luca Boccassi
df40b7ef5a
Merge pull request #26686 from yuwata/iovec
...
tree-wide: replace IOVEC_INIT with IOVEC_MAKE
2023-03-06 21:00:04 +00:00
Daan De Meyer
9a98c0f2b1
chase-symlinks: Add chase_symlinks_at_and_open()
2023-03-06 13:53:01 +01:00
Daan De Meyer
e864dfa671
chase-symlinks: Add CHASE_MKDIR_0755
2023-03-06 13:42:43 +01:00
Daan De Meyer
28aa650eb7
chase-symlinks: Add CHASE_PARENT
...
Let's simplify chasing the parent directory of some path by adding
CHASE_PARENT.
2023-03-06 13:42:43 +01:00
Yu Watanabe
ce16d177dd
tree-wide: replace IOVEC_INIT with IOVEC_MAKE
...
We use gnu11 to build, hence we can use structured initializer with
casting, and it is not necessary to use different patterns on
initialization and assignment.
Addresses https://github.com/systemd/systemd/pull/26560#discussion_r1118875447 .
2023-03-06 09:30:28 +09:00
Yu Watanabe
f482e22484
Merge pull request #26653 from poettering/tmpfile-linkable-replace
...
teach link_tmpfile() to optionally replace files
2023-03-04 02:53:59 +09:00
Yu Watanabe
600ed5c242
test-execute: add test for NetworkNamespacePath=
...
Prompted by https://github.com/systemd/systemd/issues/26422#issuecomment-1435772839 .
2023-03-04 02:50:15 +09:00
Yu Watanabe
31c35de1a4
test: add tests for error code propagation from mkdir_xyz()
2023-03-03 22:58:49 +09:00
Lennart Poettering
23e208e742
tmpfile-util: teach link_tmpfile() to optionally replace files
2023-03-03 13:44:12 +01:00
Yu Watanabe
b66b3c4099
meson: extend timeout for test-time-util
...
The test forks so many child processes, and may hit the default time
limit on slow environment or running with sanitizers.
2023-03-03 20:39:19 +09:00
Yu Watanabe
d8f3ad627c
test: test parse_timestamp() in various timezone
2023-03-03 20:39:10 +09:00
Yu Watanabe
8677fdc78b
test: clear tzname[] after timezone is changed
...
Fixes the issue reported in fe56f21ae3 .
2023-03-03 19:45:32 +09:00
Yu Watanabe
0b20d70d1c
test: use get_timezones() to iterate all known timezones
2023-03-03 19:45:32 +09:00
msizanoen1
582843ee37
test-escape: Add tests for escaping bogus UTF-8 sequences
2023-03-02 19:55:47 +07:00
Luca Boccassi
fe56f21ae3
tests: temporarily disable time-util failing tests
...
These are failing since https://github.com/systemd/systemd/pull/26409
disable for now
2023-02-27 21:37:58 +00:00
Yu Watanabe
8b51c41fd0
test: add tests for format_timestamp() and parse_timestamp() with various timezone
2023-02-24 08:55:28 +09:00
Zbigniew Jędrzejewski-Szmek
20b569a4c6
Merge pull request #26563 from dtardon/fd-init
...
Initialize fds with -EBADF + drop one unneeded initialization
2023-02-23 11:43:09 +01:00
Zbigniew Jędrzejewski-Szmek
a34180a22f
Merge pull request #26556 from keszybz/list-timers-optimize-left
...
Do not say " left" on every timer in LEFT column
2023-02-23 11:37:48 +01:00
David Tardon
92651a7a2d
tree-wide: initialize fds with -EBADF
2023-02-23 09:48:54 +01:00
Yu Watanabe
752e92615d
test-execute: add test for PrivateNetwork= with/without mount namespacing
2023-02-23 15:09:13 +09:00
Yu Watanabe
f63a2c4821
mount-util: introduce remount_sysfs()
...
This is useful when creating a new network namespace. Unlike procfs,
we need to remount sysfs, otherwise properties of the network interfaces
in the main network namespace are still accessible through the old sysfs,
e.g. /sys/class/net/eth0. All sub-mounts previously mounted on the sysfs
are moved onto the new sysfs mount.
The function will be used in later commits.
2023-02-23 15:09:13 +09:00
Lennart Poettering
ff3f1464ec
memory-util: add a concept for gcc cleanup attribute based array destruction
2023-02-23 11:43:43 +09:00
Lennart Poettering
a649419aae
capability-util: add new capability_get_ambient() helper
2023-02-22 23:45:40 +01:00
Lennart Poettering
66c1e440c7
cap-list: add capability_set_to_string_negative()
2023-02-22 23:45:40 +01:00
Lennart Poettering
8cf4674d86
cap-list: add capability_set_to_strv()
2023-02-22 23:45:40 +01:00
Zbigniew Jędrzejewski-Szmek
d5e6f36c7a
shared/format-table: optionally print timestamps without "left"
...
This just adds the base functionality and some unit tests.
With TABLE_TIMESTAMP_RELATIVE we print "5s ago" and "5s left",
with the new TABLE_TIMESTAMP_LEFT, we print "5s ago" but "5s".
This is more useful for cases where we generally only want to
print timestamps in the future.
2023-02-22 23:43:33 +01:00
Lennart Poettering
921330af40
Merge pull request #26448 from poettering/sd-event-mempress
...
sd-event: add memory pressure event source
2023-02-22 16:23:59 +01:00
Yu Watanabe
58fbf167d7
Merge pull request #26528 from keszybz/valgrind-simplification
...
Drop the -Dvalgrind configuration option
2023-02-22 23:04:12 +09:00
Lennart Poettering
b7dc40e663
test: add test for new memory pressure logic
...
it tests both real PSI stuff (if available) and fake pressure via
AF_UNIX and FIFO notification.
2023-02-22 13:14:36 +01:00
Daan De Meyer
b63bd125d4
copy: Support both inode exclusion and contents exclusion
...
In some cases, we want to exclude a directory's contents but not
the directory itself. In other cases, we want to exclude a directory
and its contents. Let's extend the denylist logic in copy.h to support
both by changing the denylist from a set to hashmap so we can store the
deny type as the value.
We also modify the repart ExcludeFiles= option to make use of this. If
a directory to exclude ends with a "/", we'll only exclude its contents.
Otherwise, we'll exclude the full directory.
2023-02-22 12:44:36 +01:00