diff options
author | 2023-04-06 11:40:45 +0100 | |
---|---|---|
committer | 2023-04-06 11:40:45 +0100 | |
commit | c8c65c613e3c42b8c218a443a8bf15e3a05434fd (patch) | |
tree | dce63741297e20a301410383e93604e236341958 /tests/DynamicCodeLoggerIntegrationTests/src | |
parent | 7348247776fb318a0c132d340c12384497ec0088 (diff) |
Make AVC log parsing less strict
Commit 5aab83aa6130760ca5c76c5b6cd429f1b29668e8 means that double
spaces are no longer removed from audit log messages. Change the
parsing code to be tolerant of 1 or more spaces in the relevant
places.
Also modify the tests to fail more quickly (otherwise they just time out, which makes the failure hard to diagnose). Make sure we have one explicit test for a log message with multiple spaces.
Bug: 276686518
Test: atest DynamicCodeLoggerIntegrationTests
Change-Id: Ia08b90785aabb4db0f005587e2315893b561573a
Diffstat (limited to 'tests/DynamicCodeLoggerIntegrationTests/src')
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java index 5430dee5ca31..afa4ff80b6e3 100644 --- a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java +++ b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java @@ -84,7 +84,7 @@ public final class DynamicCodeLoggerIntegrationTests { // avoid flakiness we run these tests multiple times, allowing progressively longer between // code loading and checking the logs on each try.) private static final int AUDIT_LOG_RETRIES = 10; - private static final int RETRY_DELAY_MS = 2_000; + private static final int RETRY_DELAY_MS = 500; private static Context sContext; private static int sMyUid; @@ -245,7 +245,7 @@ public final class DynamicCodeLoggerIntegrationTests { "/DynamicCodeLoggerNativeExecutable", privateCopyFile); EventLog.writeEvent(EventLog.getTagCode("auditd"), - "type=1400 avc: granted { execute_no_trans } " + "type=1400 avc: granted { execute_no_trans } " + "path=\"" + privateCopyFile + "\" " + "scontext=u:r:untrusted_app: " + "tcontext=u:object_r:app_data_file: " |