#include "sandbox/linux/services/namespace_sandbox.h"
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/test/multiprocess_test.h"
#include "sandbox/linux/services/credentials.h"
#include "sandbox/linux/services/namespace_utils.h"
#include "sandbox/linux/services/proc_util.h"
#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
namespace sandbox {
namespace {
bool RootDirectoryIsEmpty() { … }
class NamespaceSandboxTest : public base::MultiProcessTest { … };
MULTIPROCESS_TEST_MAIN(SimpleChildProcess) { … }
TEST_F(NamespaceSandboxTest, BasicUsage) { … }
MULTIPROCESS_TEST_MAIN(PidNsOnlyChildProcess) { … }
TEST_F(NamespaceSandboxTest, BasicUsageWithOptions) { … }
MULTIPROCESS_TEST_MAIN(ChrootMe) { … }
TEST_F(NamespaceSandboxTest, DISABLE_ON_SANITIZERS(ChrootAndDropCapabilities)) { … }
MULTIPROCESS_TEST_MAIN(NestedNamespaceSandbox) { … }
TEST_F(NamespaceSandboxTest, NestedNamespaceSandbox) { … }
const int kNormalExitCode = …;
SANDBOX_TEST_ALLOW_NOISE(ForkInNewPidNamespace, CheckDoesNotReturnZero) { … }
SANDBOX_TEST(ForkInNewPidNamespace, BasicUsage) { … }
SANDBOX_TEST(ForkInNewPidNamespace, ExitWithSignal) { … }
volatile sig_atomic_t signal_handler_called;
void ExitSuccessfully(int sig) { … }
SANDBOX_TEST(InstallTerminationSignalHandler, DoesNotOverrideExistingHandlers) { … }
}
}