Fix HwRngTest.testConfigurationIfFilePresent CTS failure
external/sepolicy commit 3a4eb96b2a462dd68636c749cec47723fd8dc51f moved the untrusted_app domain into enforcing. This started enforcing SELinux rules for untrusted_apps, including CTS tests. HwRngTest.testConfigurationIfFilePresent() attempts to access the the major/minor number of the HW random device, which is denied by SELinux policy. Modify the tests so that, if we detect an IOException, the device node is considered correct and the test passes. Addresses the following test failure: android.security.cts.HwRngTest#testConfigurationIfFilePresent java.io.IOException: Failed to stat /dev/hw_random: Permission denied at android.security.cts.LinuxRngTest.getCharDeviceMajor(Native Method) at android.security.cts.HwRngTest.testConfigurationIfFilePresent(HwRngTest.java:84) at java.lang.reflect.Method.invoke(Native Method) Bug: 14575413 Change-Id: Iacc512f1ddaac83f53de06b516bd1edb49df9b5a
Loading
Please sign in to comment