summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--startop/iorap/TEST_MAPPING (renamed from startop/iorap/DISABLED_TEST_MAPPING)0
-rw-r--r--startop/iorap/tests/AndroidTest.xml22
-rw-r--r--startop/iorap/tests/src/com/google/android/startop/iorap/IIorapIntegrationTest.kt7
3 files changed, 24 insertions, 5 deletions
diff --git a/startop/iorap/DISABLED_TEST_MAPPING b/startop/iorap/TEST_MAPPING
index 8c9d4dfb0894..8c9d4dfb0894 100644
--- a/startop/iorap/DISABLED_TEST_MAPPING
+++ b/startop/iorap/TEST_MAPPING
diff --git a/startop/iorap/tests/AndroidTest.xml b/startop/iorap/tests/AndroidTest.xml
index bcd11033bed3..6102c44e61bf 100644
--- a/startop/iorap/tests/AndroidTest.xml
+++ b/startop/iorap/tests/AndroidTest.xml
@@ -33,18 +33,34 @@
<target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer">
</target_preparer>
+ <!-- do not use DeviceSetup#set-property because it reboots the device b/136200738.
+ furthermore the changes in /data/local.prop don't actually seem to get picked up.
+ -->
<target_preparer
class="com.android.tradefed.targetprep.DeviceSetup">
+ <!-- we need this magic flag, otherwise it always reboots and breaks the selinux -->
+ <option name="force-skip-system-props" value="true" />
+
<!-- Crash instead of using Log.wtf within the system_server iorap code. -->
- <option name="set-property" key="iorapd.forwarding_service.wtf_crash" value="true" />
+ <option name="run-command" value="setprop iorapd.forwarding_service.wtf_crash true" />
<!-- IIorapd has fake behavior: it doesn't do anything but reply with 'DONE' status -->
- <option name="set-property" key="iorapd.binder.fake" value="true" />
- <option name="restore-properties" value="true" />
+ <option name="run-command" value="setprop iorapd.binder.fake true" />
+
+ <!-- iorapd does not pick up the above changes until we restart it -->
+ <option name="run-command" value="stop iorapd" />
+ <option name="run-command" value="start iorapd" />
+ <!-- give it some time to restart the service; otherwise the first unit test might fail -->
+ <option name="run-command" value="sleep 1" />
</target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.google.android.startop.iorap.tests" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
</test>
+
+ <!-- using DeviceSetup again does not work. we simply leave the device in a semi-bad
+ state. there is no way to clean this up as far as I know.
+ -->
+
</configuration>
diff --git a/startop/iorap/tests/src/com/google/android/startop/iorap/IIorapIntegrationTest.kt b/startop/iorap/tests/src/com/google/android/startop/iorap/IIorapIntegrationTest.kt
index 883d09490610..460add897f2f 100644
--- a/startop/iorap/tests/src/com/google/android/startop/iorap/IIorapIntegrationTest.kt
+++ b/startop/iorap/tests/src/com/google/android/startop/iorap/IIorapIntegrationTest.kt
@@ -14,6 +14,7 @@
package com.google.android.startop.iorap
+import android.net.Uri
import android.os.ServiceManager
import androidx.test.filters.MediumTest
import org.junit.Test
@@ -85,6 +86,9 @@ class IIorapIntegrationTest {
@Test
fun testOnPackageEvent() {
+ // FIXME (b/137134253): implement PackageEvent parsing on the C++ side.
+ // This is currently (silently: b/137135024) failing because IIorap is 'oneway' and the
+ // C++ PackageEvent un-parceling fails since its not implemented fully.
/*
testAnyMethod { requestId : RequestId ->
iorapService.onPackageEvent(requestId,
@@ -92,7 +96,6 @@ class IIorapIntegrationTest {
Uri.parse("https://www.google.com"), "com.fake.package"))
}
*/
- // FIXME: Broken for some reason. C++ side never sees this call.
}
@Test
@@ -107,7 +110,7 @@ class IIorapIntegrationTest {
@Test
fun testOnAppLaunchEvent() {
testAnyMethod { requestId : RequestId ->
- // iorapService.onAppLaunchEvent(requestId, AppLaunchEvent.IntentStarted())
+ iorapService.onAppLaunchEvent(requestId, AppLaunchEvent.IntentFailed(/*sequenceId*/123))
}
}