chromium/sandbox/linux/services/yama_unittest.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <errno.h>
#include <fcntl.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "sandbox/linux/services/scoped_process.h"
#include "sandbox/linux/services/yama.h"
#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sandbox {

namespace {

bool HasLinux32Bug() {}

bool CanPtrace(pid_t pid) {}

// _exit(0) if pid can be ptraced by the current process.
// _exit(1) otherwise.
void ExitZeroIfCanPtrace(pid_t pid) {}

bool CanSubProcessPtrace(pid_t pid) {}

// The tests below assume that the system-level configuration will not change
// while they run.

TEST(Yama, GetStatus) {}

SANDBOX_TEST(Yama, RestrictPtraceSucceedsWhenYamaPresent) {}

// Attempts to enable or disable Yama restrictions.
void SetYamaRestrictions(bool enable_restriction) {}

TEST(Yama, RestrictPtraceWorks) {}

SANDBOX_TEST(Yama, RestrictPtraceIsDefault) {}

}  // namespace

}  // namespace sandbox