This directory contains tests that validate restricted mode functionality when running in a shared process. It provides the kernel with a non-starnix way to validate this functionality.
There are two types of tests housed in this directory:
The basic test (in the subdirectory basic/
) runs a simple, single-shot test tries to enter restricted mode in a shared process and bounce back out on a syscall. This is meant to be a basic functionality test, and by no means is a comprehensive test of restricted mode features.
The stress test (in the subdirectory stress/
) has two variants: a short version and a long version. Both do roughly the same thing, see the comments in stress/lib.cc
for more information on what the test does. The main difference between the two is how long they run for:
Each version of the test is a separate fuchsia test package.
The tests can be run like pretty much any other fuchsia component test. When building, make sure to include --with //src/zircon/tests/restricted-mode-shared:tests
in your fx build
invocation. Then, you can run the tests as follows:
// Basic test $ fx test fuchsia-pkg://fuchsia.com/restricted-mode-shared-test#meta/restricted-mode-shared.cm // Short stress test $ fx test fuchsia-pkg://fuchsia.com/restricted-mode-shared-short-stress-test#meta/restricted-mode-shared-short-stress.cm // Long stress test $ fx test fuchsia-pkg://fuchsia.com/restricted-mode-shared-long-stress-test#meta/restricted-mode-shared-long-stress.cm
Note that ASAN does not work with shared processes yet, so these tests are excluded from the build graph if ASAN is enabled.