diff options
author | Shubham Ajmera <shubhamajmera@google.com> | 2016-10-27 14:57:31 +0100 |
---|---|---|
committer | Shubham Ajmera <shubhamajmera@google.com> | 2016-11-01 12:33:32 +0000 |
commit | f4a5bce13115f48de26400da54666e9e174e5e62 (patch) | |
tree | c08684a69f049733a13416cbdf629b85829f737b /annotations/generate_annotated_java_files.py | |
parent | 43a1fef4c609c9999bdfde78acbb24ccbdf7faf9 (diff) |
Use seccomp filter to avoid using stat for File#exists method
To make sure that File.exist doesn't use stat, the test was checking
existance of /system/bin/uncrypt. As per SELinux policy, the file is
unstattable, however, there is no gaurantee for the file to exist in
future versions. Also, cloud devices used for continous testing doesn't
have SELinux policy implemented correctly(Atleast on the cloud device
the file is stattable, which shouldn't be the case).
The new test uses SECCOMP to make sure stat is not called. On arm64,
x86_64 stat uses newfstatat, and on arm, mips and x86 it uses
fstatat64. Depending upon the architecture, when a system calls is made
to either of these, exception will be raised with error no - EPERM.
Bug: 31385938
Test: cts-tradefed run cts -m CtsLibcoreTestCases -t \
libcore.java.io.FileTest
Change-Id: Ibdf74348d281e67a812a4a63d2cb94ed01a8c486
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions