Use ITestDevice#pullFile instead of ITestDevice#executeAdbCommand.
Using the pullFile method will prevent the android.host.security test suite to crash the device when the targeted files do not exist.
b/20165544
Change-Id: Ic3ebb1fb55646cd05efb6d0d94bc8a6eca636d06
diff --git a/tools/selinux/SELinuxNeverallowTestFrame.py b/tools/selinux/SELinuxNeverallowTestFrame.py
index 932014a..0bf766d 100644
--- a/tools/selinux/SELinuxNeverallowTestFrame.py
+++ b/tools/selinux/SELinuxNeverallowTestFrame.py
@@ -72,8 +72,7 @@
/* obtain sepolicy file from running device */
devicePolicyFile = File.createTempFile("sepolicy", ".tmp");
devicePolicyFile.deleteOnExit();
- mDevice.executeAdbCommand("pull", "/sys/fs/selinux/policy",
- devicePolicyFile.getAbsolutePath());
+ mDevice.pullFile("/sys/fs/selinux/policy", devicePolicyFile);
}
"""
src_body = ""