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)
committerStefan Metzmacher <metze@samba.org>
Sun, 17 Sep 2017 07:48:15 +0000 (09:48 +0200)
commita4017255bfd4d63230ac14ece9d91c0f0d1d2175
tree310c59c9b9c623c055b8eb93ff06178a7a7d2183
parent9e8688a58f00393662ee482d408cfabed2fd4ea2
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>
(cherry picked from commit 28edf7012b5fa474897055c8c1a4c438c69b8323)
lib/util/tests/tfork.c
selftest/knownfail.d/tfork [new file with mode: 0644]