OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <pthread.h> | 6 #include <pthread.h> |
7 #include <sched.h> | 7 #include <sched.h> |
8 #include <sys/prctl.h> | 8 #include <sys/prctl.h> |
9 #include <sys/syscall.h> | 9 #include <sys/syscall.h> |
10 #include <sys/time.h> | 10 #include <sys/time.h> |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 args[3], args[4], args[5]) == -err); | 1103 args[3], args[4], args[5]) == -err); |
1104 } | 1104 } |
1105 | 1105 |
1106 // Vector of ArgValue trees. These trees define all the possible boolean | 1106 // Vector of ArgValue trees. These trees define all the possible boolean |
1107 // expressions that we want to turn into a BPF filter program. | 1107 // expressions that we want to turn into a BPF filter program. |
1108 std::vector<ArgValue *> arg_values_; | 1108 std::vector<ArgValue *> arg_values_; |
1109 | 1109 |
1110 // Don't increase these values. We are pushing the limits of the maximum | 1110 // Don't increase these values. We are pushing the limits of the maximum |
1111 // BPF program that the kernel will allow us to load. If the values are | 1111 // BPF program that the kernel will allow us to load. If the values are |
1112 // increased too much, the test will start failing. | 1112 // increased too much, the test will start failing. |
1113 static const int kNumIterations = 3; | |
1114 static const int kNumTestCases = 40; | 1113 static const int kNumTestCases = 40; |
1115 static const int kMaxFanOut = 3; | 1114 static const int kMaxFanOut = 3; |
1116 static const int kMaxArgs = 6; | 1115 static const int kMaxArgs = 6; |
1117 }; | 1116 }; |
1118 | 1117 |
1119 ErrorCode EqualityStressTestPolicy(Sandbox *sandbox, int sysno, void *aux) { | 1118 ErrorCode EqualityStressTestPolicy(Sandbox *sandbox, int sysno, void *aux) { |
1120 return reinterpret_cast<EqualityStressTest *>(aux)->Policy(sandbox, sysno); | 1119 return reinterpret_cast<EqualityStressTest *>(aux)->Policy(sandbox, sysno); |
1121 } | 1120 } |
1122 | 1121 |
1123 BPF_TEST(SandboxBpf, EqualityTests, EqualityStressTestPolicy, | 1122 BPF_TEST(SandboxBpf, EqualityTests, EqualityStressTestPolicy, |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 | 1728 |
1730 BPF_TEST(SandboxBpf, PthreadEquality, PthreadPolicyEquality) { | 1729 BPF_TEST(SandboxBpf, PthreadEquality, PthreadPolicyEquality) { |
1731 PthreadTest(); | 1730 PthreadTest(); |
1732 } | 1731 } |
1733 | 1732 |
1734 BPF_TEST(SandboxBpf, PthreadBitMask, PthreadPolicyBitMask) { | 1733 BPF_TEST(SandboxBpf, PthreadBitMask, PthreadPolicyBitMask) { |
1735 PthreadTest(); | 1734 PthreadTest(); |
1736 } | 1735 } |
1737 | 1736 |
1738 } // namespace | 1737 } // namespace |
OLD | NEW |