Fix SELinux denial check
Console path and log path are changed due to tradefed.
Bug: 342520091
Test: atest MicrodroidHostTests
Change-Id: Ie4df6247125aa7c99e668d7d8f48d360ba8c78ab
diff --git a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
index 41ddd48..c6b2499 100644
--- a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
+++ b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
@@ -55,6 +55,7 @@
protected static final String LOG_PATH = TEST_ROOT + "log.txt";
protected static final String CONSOLE_PATH = TEST_ROOT + "console.txt";
protected static final String TRADEFED_CONSOLE_PATH = TRADEFED_TEST_ROOT + "console.txt";
+ protected static final String TRADEFED_LOG_PATH = TRADEFED_TEST_ROOT + "log.txt";
private static final int TEST_VM_ADB_PORT = 8000;
private static final String MICRODROID_SERIAL = "localhost:" + TEST_VM_ADB_PORT;
private static final String INSTANCE_IMG = "instance.img";
diff --git a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
index f424ce0..18dc219 100644
--- a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
+++ b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
@@ -871,10 +871,13 @@
assertWithMessage("Incorrect ABI list").that(abis).hasLength(1);
// Check that no denials have happened so far
- String logText =
- getDevice().pullFileContents(CONSOLE_PATH) + getDevice().pullFileContents(LOG_PATH);
+ String consoleText = getDevice().pullFileContents(TRADEFED_CONSOLE_PATH);
+ assertWithMessage("Console output shouldn't be empty").that(consoleText).isNotEmpty();
+ String logText = getDevice().pullFileContents(TRADEFED_LOG_PATH);
+ assertWithMessage("Log output shouldn't be empty").that(logText).isNotEmpty();
+
assertWithMessage("Unexpected denials during VM boot")
- .that(logText)
+ .that(consoleText + logText)
.doesNotContainMatch("avc:\\s+denied");
assertThat(getDeviceNumCpus(microdroid)).isEqualTo(getDeviceNumCpus(android));