Better error messages in tests

A good test is one where you can tell what's wrong from the error
message. The selinux denials one confused me, since it showed the
denial as the cause of failure without context.

So add more context to various possible failures.

Bug: 306516077
Test: atest MicrodroidHostTests (with my recent fix disabled)
Change-Id: Ieb52c66ba189064a27b3fb1b619c2060b922ac4d
diff --git a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
index 692b1b8..001dfeb 100644
--- a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
+++ b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
@@ -765,16 +765,22 @@
 
         // Check if the native library in the APK is has correct filesystem info
         final String[] abis = microdroid.run("getprop", "ro.product.cpu.abilist").split(",");
-        assertThat(abis).hasLength(1);
+        assertWithMessage("Incorrect ABI list").that(abis).hasLength(1);
 
         // Check that no denials have happened so far
-        assertThat(android.tryRun("egrep", "'avc:[[:space:]]{1,2}denied'", LOG_PATH)).isNull();
-        assertThat(android.tryRun("egrep", "'avc:[[:space:]]{1,2}denied'", CONSOLE_PATH)).isNull();
+        assertWithMessage("Unexpected denials during VM boot")
+                .that(android.tryRun("egrep", "'avc:[[:space:]]{1,2}denied'", LOG_PATH))
+                .isNull();
+        assertWithMessage("Unexpected denials during VM boot")
+                .that(android.tryRun("egrep", "'avc:[[:space:]]{1,2}denied'", CONSOLE_PATH))
+                .isNull();
 
         assertThat(getDeviceNumCpus(microdroid)).isEqualTo(getDeviceNumCpus(android));
 
         // Check that selinux is enabled
-        assertThat(microdroid.run("getenforce")).isEqualTo("Enforcing");
+        assertWithMessage("SELinux should be in enforcing mode")
+                .that(microdroid.run("getenforce"))
+                .isEqualTo("Enforcing");
 
         // TODO(b/176805428): adb is broken for nested VM
         if (!isCuttlefish()) {