On 07/20/2010 09:37 PM, Ralf Wildenhues wrote: > BTW, it might be prudent to document that Autotest needs fds 6 and 7. > While AT_CHECK commands are run in a subshell, other commands in the > testsuite aren't, and the fact that the job fds are open in the test > group code can easily break both the job handling and the test group > code. Or we bite the bullet and use another subshell to actually be > able to close the fds for the test group code. :-/
Technically, the AT_CHECK commands only need worry about one fd;
AT_JOB_FIFO_OUT_FD (in fact, my patch already clobbers AT_JOB_FIFO_IN_FD
before the test is run), because that is the only fd that must still
exist after the AT_CHECK has completed.
Notice that we have this line:
. "$at_test_source" [#] AT_JOB_FIFO_OUT_FD>&-
At one point, we already thought about closing the fd only during the
duration of the AT_CHECK, leaving it free for the AT_CHECK to use at
will (and more importantly, so that AT_CHECK can't do 'echo >&7' to
corrupt the state of the parallel test driver); it would just take
un-commenting that line.
Additionally, it is not just AT_CHECK, but the entire
AT_SETUP/AT_CLEANUP set that is run in a subshell. Roughly, each entire
sourced test group looks like:
#AT_START_1
setup
echo >> $at_group_log
(
autotest and user's direct code
( AT_CHECK code )
autotest and user's direct code
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <$at_status_file
#AT_STOP_1
so we already have a subshell where we could close AT_JOB_FIFO_OUT_FD
without issues.
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
