class Launcher
Defined at line 47 of file ../../src/bringup/lib/userboot/testing/include/lib/userboot/testing/launcher.h
Public Methods
bool operator bool ()
Defined at line 53 of file ../../src/bringup/lib/userboot/testing/include/lib/userboot/testing/launcher.h
zx::result<Launcher> Create ()
Acquire the launcher service. This can be done just once and then reused
across all tests.
Defined at line 134 of file ../../src/bringup/lib/userboot/testing/launcher.cc
zx::result<zx::process> Launch (zx::jobjob,zx::vmoexecutable,fbl::unique_fdlog,std::vector<zx::handle>handles)
Launch a test process as if it were userboot, inside the test job. (It
fails quickly if the job is invalid, so TestJob::Get() can be passed in
unchecked.) This sends an initial message with essential handles about
the process itself, which is handled by the custom startup code in the
userboot library. The log fd is a pipe whose underlying zx::socket is
sent in place of the zx::debuglog sent in the kernel's initial message
(the libc startup code handles either one). The handles are whatever it
expects from the kernel in the second message, which the userboot program
will read via TakeBootstrapChannel() from
<lib
/userboot/startup.h>.
The handles in each message are always shuffled pseudo-randomly to test
that the userboot program is not sensitive to their order, as there is no
guarantee what order the kernel will use. The shuffle is based on gtest
testing::UnitTest::random_seed() so it can be recreated via the logging
and machinery that gtest provides for its random permutation testing.
Defined at line 154 of file ../../src/bringup/lib/userboot/testing/launcher.cc