CommandProcessor: add fd argument to ProcessInput()
Various commands (such as commands which request a log
dump, or which write a blob to the log) will need to
provide a file descriptor argument. Accordingly, we
revise ProcessInput(), to support such an argument.
Add tests that verify that a provided FD argument
is closed when ProcessInput() returns. As noted in
the test implementation, these tests aren't truly
unit tests. But they're the best we can reasonably
do, given how unique_fd works.
Along the way: rename ProcessInput() to
ProcessCommand(). The new name is more consistent
with various bits of documentation (comments and
type names).
Bug: 32093334
Test: ./runtests.sh
Change-Id: Ib5845dc4ec13d10564894c4dbe7b486e3351ed22
4 files changed