]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: make test-fd-util more lenient when using fd_move_above_stdio()
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 5 Apr 2024 10:18:58 +0000 (12:18 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 5 Apr 2024 17:40:23 +0000 (19:40 +0200)
commita9805f8ca9c1561e373355fe7175579b31e1c08c
tree3310bb3d45fe837289cc4072ef6aef67ce82d917
parente55db9e792c4db14f70c21ba16fc5445c62efd46
test: make test-fd-util more lenient when using fd_move_above_stdio()

On s390x this test fails when the SUT uses the z90crypt kernel module,
as it's an another FD the test doesn't account for:

/* test_rearrange_stdio */
Successfully forked off 'rearrange' as PID 57293.
test_rearrange_stdio: r=0
/proc/57293/fd:
total 0
lrwx------. 1 root root 64 Apr  5 06:18 0 -> /dev/pts/0
lrwx------. 1 root root 64 Apr  5 06:18 1 -> /dev/pts/0
lrwx------. 1 root root 64 Apr  5 06:18 2 -> /dev/pts/0
lrwx------. 1 root root 64 Apr  5 06:18 3 -> /dev/z90crypt
rearrange terminated by signal ABRT.

Debugging this was pain, since the child process didn't log anything
once we closed stdout/stderr (for obvious reasons). Let's fix both
issues by switching logging to kmsg once we close stdin/stdout/stderr,
and also by making the test work fine when there are some extra FDs in
the child's environment.
src/test/test-fd-util.c