From 3762c5d5bd9cf0e2c210f95da71dea1e92742bce Mon Sep 17 00:00:00 2001 From: Mohamad Ayyash Date: Thu, 9 Jun 2016 12:19:37 -0700 Subject: DO NOT MERGE, re-apply, Adjust testAppFailAccessPrivateData to fail on non-tagged sockets Also avoid failing on expecting to find other sockets in qtaguid stats since we already test we can access our stats in CreatePrivateDataTest:testCreatePrivateData test BUG: 29071701 BUG: 27577101 Change-Id: Ibb3befdcf0f9433c7d54a579af282d5c2569409d Signed-off-by: Mohamad Ayyash (cherry picked from commit 772dcdc8a15b4c861acfc914a5781d53afe877be) --- .../src/com/android/cts/appaccessdata/AccessPrivateDataTest.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hostsidetests/appsecurity/test-apps/AppAccessData/src/com/android/cts/appaccessdata/AccessPrivateDataTest.java b/hostsidetests/appsecurity/test-apps/AppAccessData/src/com/android/cts/appaccessdata/AccessPrivateDataTest.java index 40d3cff6c97..9f0abedbd40 100644 --- a/hostsidetests/appsecurity/test-apps/AppAccessData/src/com/android/cts/appaccessdata/AccessPrivateDataTest.java +++ b/hostsidetests/appsecurity/test-apps/AppAccessData/src/com/android/cts/appaccessdata/AccessPrivateDataTest.java @@ -103,24 +103,19 @@ public class AccessPrivateDataTest extends AndroidTestCase { } catch (SecurityException e) { fail("Was not able to access another app's public file: " + e); } - - boolean foundOtherStats = false; try { BufferedReader qtaguidReader = new BufferedReader(new FileReader("/proc/net/xt_qtaguid/stats")); String line; while ((line = qtaguidReader.readLine()) != null) { String tokens[] = line.split(" "); if (tokens.length > 3 && tokens[3].equals(String.valueOf(otherAppUid))) { - foundOtherStats = true; - if (!tokens[2].equals("0x0")) { - fail("Other apps detailed traffic stats leaked"); - } + // CreatePrivateDataTest:testCreatePrivateData ensures we can access our own stats data + fail("Other apps detailed traffic stats leaked"); } } qtaguidReader.close(); } catch (FileNotFoundException e) { fail("Was not able to access qtaguid/stats: " + e); } - assertTrue("Was expecting to find other apps' traffic stats", foundOtherStats); } } -- cgit v1.2.3