tests util/tfork: Tests for status and event fd
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 11 Sep 2017 02:48:21 +0000 (14:48 +1200)
committerRalph Boehme <slow@samba.org>
Sat, 16 Sep 2017 17:53:22 +0000 (19:53 +0200)
commit28edf7012b5fa474897055c8c1a4c438c69b8323
tree93145ed344b8ae12e1d2df30e65b1654887b850d
parentadf46ff0eaf9c88f513644e8bbf112d270636971
tests util/tfork: Tests for status and event fd

Add tests to ensure that:
- The event_fd becomes readable once the worker process has terminated
- That the event_fd is not closed by the tfork code.
  - If this is done in tevent code and the event fde has not been
    freed, "Bad talloc magic value - " errors can result.
- That the status call does not block if the parent process launches
  more than one child process.
  - The status file descriptor for a child is passed to the
    subsequent children.  These processes hold the FD open, so that
    closing the fd does not make the read end go readable, and the
    process calling status blocks.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13037

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/tests/tfork.c
selftest/knownfail.d/tfork [new file with mode: 0644]