Revert "Disable ParameterRestrictions.ptrace* tests on Android < N."
This reverts commit fc93308f5f
.
Reason for revert:
Findit (https://goo.gl/kROfz5) identified CL at revision 644811 as the
culprit for flakes in the build cycles as shown on:
https://analysis.chromium.org/p/chromium/flake-portal/analysis/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vZmM5MzMwOGY1Zjk0YmJhYzJlMDcyNGU2YmUzZDRmN2Q2OWRlNjQyNgw
Sample Failed Build: https://ci.chromium.org/buildbot/chromium.linux/Cast%20Linux/70364
Sample Failed Step: sandbox_linux_unittests
Sample Flaky Test: ParameterRestrictions.ptrace_getregs_allowed
Original change's description:
> Disable ParameterRestrictions.ptrace* tests on Android < N.
>
> Bug: 934930
> Change-Id: I0c9bae607e06a921c4587fcfb50ebc574c830c7e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1540281
> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
> Commit-Queue: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#644811}
Change-Id: I9628666758500dba61d72b4cfa7e2890b9ff798a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 934930
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542905
Cr-Commit-Position: refs/heads/master@{#645207}
This commit is contained in:
@ -36,12 +36,7 @@
|
||||
#include "sandbox/linux/system_headers/linux_time.h"
|
||||
#include "sandbox/linux/tests/unit_tests.h"
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include <sys/system_properties.h>
|
||||
|
||||
#include "base/android/build_info.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#else
|
||||
#if !defined(OS_ANDROID)
|
||||
#include "third_party/lss/linux_syscall_support.h" // for MAKE_PROCESS_CPUCLOCK
|
||||
#endif
|
||||
|
||||
@ -420,33 +415,11 @@ class PtraceTestHarness {
|
||||
DISALLOW_COPY_AND_ASSIGN(PtraceTestHarness);
|
||||
};
|
||||
|
||||
static bool IsAndroidLessThanN() {
|
||||
#if defined(OS_ANDROID)
|
||||
static const int sdk_int = []() -> int {
|
||||
char sdk_version[PROP_VALUE_MAX];
|
||||
if (__system_property_get("ro.build.version.sdk", sdk_version) > 0) {
|
||||
int sdk_int;
|
||||
if (base::StringToInt(sdk_version, &sdk_int))
|
||||
return sdk_int;
|
||||
}
|
||||
return -1;
|
||||
}();
|
||||
return sdk_int < base::android::SDK_VERSION_NOUGAT;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fails on Android L and M.
|
||||
// See https://crbug.com/934930
|
||||
BPF_TEST_C(ParameterRestrictions,
|
||||
ptrace_getregs_allowed,
|
||||
DISABLED_ptrace_getregs_allowed,
|
||||
RestrictPtracePolicy) {
|
||||
if (IsAndroidLessThanN()) {
|
||||
// On 32-bit kernel Android devices, these tests hang for reasons unknown
|
||||
// (https://crbug.com/934930). While Android N does not require a 64-bit
|
||||
// kernel, all Pixel devices do have them starting with N.
|
||||
return;
|
||||
}
|
||||
|
||||
auto tracer = [](pid_t pid) {
|
||||
#if defined(__arm__)
|
||||
user_regs regs;
|
||||
@ -464,16 +437,11 @@ BPF_TEST_C(ParameterRestrictions,
|
||||
PtraceTestHarness(tracer, false).Run();
|
||||
}
|
||||
|
||||
// Fails on Android L and M.
|
||||
// See https://crbug.com/934930
|
||||
BPF_TEST_C(ParameterRestrictions,
|
||||
ptrace_syscall_blocked,
|
||||
DISABLED_ptrace_syscall_blocked,
|
||||
RestrictPtracePolicy) {
|
||||
if (IsAndroidLessThanN()) {
|
||||
// On 32-bit kernel Android devices, these tests hang for reasons unknown
|
||||
// (https://crbug.com/934930). While Android N does not require a 64-bit
|
||||
// kernel, all Pixel devices do have them starting with N.
|
||||
return;
|
||||
}
|
||||
|
||||
auto tracer = [](pid_t pid) {
|
||||
// The tracer is about to die. Make sure the tracee is not stopped so it
|
||||
// can reap it and inspect its death signal.
|
||||
|
Reference in New Issue
Block a user