diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 02:30:41 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 02:30:41 +0000 |
commit | d1bc6f83c4c7191cb5e7e534840d489d500eaee3 (patch) | |
tree | 9d1310c9558e75034b14e9df6ac0e3c53817f0d8 /sandbox | |
parent | e012d506e8ee2012588e86527b7efb943cdf929a (diff) | |
download | chromium_src-d1bc6f83c4c7191cb5e7e534840d489d500eaee3.zip chromium_src-d1bc6f83c4c7191cb5e7e534840d489d500eaee3.tar.gz chromium_src-d1bc6f83c4c7191cb5e7e534840d489d500eaee3.tar.bz2 |
Seccomp: always call setSandboxPolicy in unittest.
In seccomp-bpf unittest, we now call setSandboxPolicy even if we have no kernel
support for seccomp-bpf.
BUG=141545
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10837178
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc index a0d86cc..b8ae3b7 100644 --- a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc +++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc @@ -75,7 +75,7 @@ void StartSandboxOrDie(Sandbox::EvaluateSyscall evaluator) { void RunInSandbox(Sandbox::EvaluateSyscall evaluator, void (*SandboxedCode)()) { - // TODO(jln): Implement IsEqual for ErrorCode + // TODO(markus): Implement IsEqual for ErrorCode // IsEqual(evaluator(__NR_exit_group), Sandbox::SB_ALLOWED) << // "You need to always allow exit_group() in your test policy"; StartSandboxOrDie(evaluator); @@ -97,6 +97,11 @@ void TryPolicyInProcess(Sandbox::EvaluateSyscall evaluator, EXPECT_EXIT(RunInSandbox(evaluator, SandboxedCode), ::testing::ExitedWithCode(kExpectedReturnValue), ""); + } else { + // The sandbox is not available. We should still try to exercise what we + // can. + // TODO(markus): (crbug.com/141545) let us call the compiler from here. + Sandbox::setSandboxPolicy(evaluator, NULL); } } |