Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: chrome/test/nacl_security_tests/nacl_security_tests_linux.cc

Issue 7831053: Move NaCl tests out of chrome/test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/nacl_security_tests/nacl_security_tests_posix.h"
6 #include <string>
7 #include "chrome/test/nacl_security_tests/commands_posix.h"
8
9 #define RETURN_IF_NOT_DENIED(x) \
10 if (sandbox::SBOX_TEST_DENIED != x) { \
11 return false; \
12 }
13
14 // Runs the security tests of sandbox for the nacl loader process.
15 extern "C" bool RunNaClLoaderTests(void) {
16 // Need to check if the system supports CLONE_NEWPID before testing
17 // the filesystem accesses (otherwise the sandbox is not enabled).
18 RETURN_IF_NOT_DENIED(sandbox::TestOpenReadFile("/etc"));
19 RETURN_IF_NOT_DENIED(sandbox::TestOpenReadFile("/tmp"));
20 RETURN_IF_NOT_DENIED(sandbox::TestOpenReadFile("$HOME"));
21 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/etc"));
22 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/etc/passwd"));
23 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/bin"));
24 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/usr/bin"));
25 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/usr/bin/bash"));
26 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/usr/bin/login"));
27 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("/usr/sbin"));
28 RETURN_IF_NOT_DENIED(sandbox::TestOpenWriteFile("$HOME"));
29
30 // Linux (suid) sandbox doesn't block connect, etc...
31 RETURN_IF_NOT_DENIED(sandbox::TestCreateProcess("/usr/bin/env"));
32 RETURN_IF_NOT_DENIED(sandbox::TestConnect("www.archive.org"));
33
34 return true;
35 }
36
OLDNEW
« no previous file with comments | « chrome/test/nacl_security_tests/commands_posix.cc ('k') | chrome/test/nacl_security_tests/nacl_security_tests_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698