SELinuxDomainTest: fix flakiness in tests
The SELinux domain tests scan /proc, ensuring that every process
is in the appropriate SELinux domain. However, while the test is
running, it's possible for a process to go away, resulting in failures
such as:
android.security.cts.SELinuxDomainTest#testKernelDomain
java.io.FileNotFoundException: /proc/6156/cmdline: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileInputStream.<init>(FileInputStream.java:76)
at java.util.Scanner.<init>(Scanner.java:158)
at java.util.Scanner.<init>(Scanner.java:138)
at android.security.cts.SELinuxDomainTest$ProcessDetails.getProcessMap(SELinuxDomainTest.java:349)
at android.security.cts.SELinuxDomainTest$ProcessDetails.access$000(SELinuxDomainTest.java:280)
at android.security.cts.SELinuxDomainTest.testKernelDomain(SELinuxDomainTest.java:273)
Modify the SELinuxDomainTest so that it tolerates processes going away
better, reducing test flakiness.
Change-Id: I152422607cbe0d63ddb90e5288f74809fb11144c
1 file changed