am abd927d8: Modify RO mount test to check different processes
* commit 'abd927d8acfe5226f188046db99a273483419e20':
Modify RO mount test to check different processes
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
index f219b09..ff47ec1 100644
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -561,12 +561,20 @@
return retval;
}
+ public void testSystemMountedRO() throws IOException {
+ assertSystemMountedROIn("/proc/self/mounts");
+ }
+
+ public void testSystemMountedRO_init() throws IOException {
+ assertSystemMountedROIn("/proc/1/mounts");
+ }
+
/**
- * Scan through /proc/self/mounts, looking for the /system line. If the line
+ * Scan through {@code filename}, looking for the /system line. If the line
* has "ro" in the 4th column, then we know the filesystem is mounted read-only.
*/
- public void testSystemMountedRO() throws IOException {
- BufferedReader br = new BufferedReader(new FileReader("/proc/self/mounts"));
+ private static void assertSystemMountedROIn(String filename) throws IOException {
+ BufferedReader br = new BufferedReader(new FileReader(filename));
String line;
boolean foundSystem = false;
while((line = br.readLine()) != null) {