]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: (test_mkfds) monitor stdin by default
authorMasatake YAMATO <yamato@redhat.com>
Thu, 31 Aug 2023 15:56:06 +0000 (00:56 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 3 Sep 2023 21:15:30 +0000 (06:15 +0900)
commit618a88b51e8fd3489033517db9987a6231a8f1fe
tree77b29b6ec7a2aebd293ff5cc2c5f3029fd2ab3ce
parent706af26ccd7684cdc545bd39d0049c7dda961afd
tests: (test_mkfds) monitor stdin by default

After making file descriptors as specified in arguments, test_mkfds
waits for an event with pselect. When test_mkfds gets the event, it
exits.

The original code monitored stdin when the test_mkfds process ran in
the foreground. However, monitoring stdin is useful even when it runs
in the background. ts/lsfd/mkfds-* test cases run test_mkfds as a
co-process.  So the test cases can terminate their test_mkfds
processes with echo command if the processes monitor stdin.

This change also adds -X/--dont-monitor-stdin option. As the name
shows, with the option, test_mkfds doesn't monitor stdin as before.
Some test cases run test_mkfds directly. In such a case,
tests/functions.sh may connect stdin of test_mkfds to
/dev/null. /dev/null is always ready to be read.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c
tests/ts/lsfd/option-inet
tests/ts/lsfd/option-summary