Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6c71009 authored by Mohammad Islam's avatar Mohammad Islam Committed by Automerger Merge Worker
Browse files

Merge "Update tests to use new InstallUtilsHost lib" am: ef3ada58 am: 78d15ba6

Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1519677

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iea37aa609b1b1f1fbd7d980dfe574cce10afedf4
parents 06435b60 78d15ba6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ java_test_host {
    ],
    static_libs: [
        "kotlin-test",
        "module_test_util",
        "cts-install-lib-host",
    ],
    test_suites: ["device-tests"],
    data: [":NetworkStack"],
+2 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.networkstack.hosttests

import com.android.tests.util.ModuleTestUtils
import android.cts.install.lib.host.InstallUtilsHost
import com.android.tradefed.device.ITestDevice
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test
@@ -42,8 +42,7 @@ private const val NETWORKSTACK_TIMEOUT_MS = 5 * 60_000
@RunWith(DeviceJUnit4ClassRunner::class)
class NetworkStackHostTests : BaseHostJUnit4Test() {

    private val mUtils = ModuleTestUtils(this)
    private val mModuleApk = mUtils.getTestFile(APP_APK)
    private val mModuleApk = InstallUtilsHost(this).getTestFile(APP_APK)
    private val mPackageName = AaptParser.parse(mModuleApk)?.packageName
            ?: throw IllegalStateException("Could not parse test package name")
    private val mDevice by lazy { getDevice() }
@@ -74,12 +73,10 @@ class NetworkStackHostTests : BaseHostJUnit4Test() {
        assumeFalse(error != null && error.contains("Unknown option --staged"))
        assertNull(error, "Error installing module package: $error")
        try {
            mUtils.waitForStagedSessionReady()
            applyUpdateAndCheckNetworkStackRegistered()
            assertNotEquals(initialUpdateTime, getLastUpdateTime(), "Update time did not change")
        } finally {
            assertCommandSucceeds("pm rollback-app $mPackageName")
            mUtils.waitForStagedSessionReady()
            applyUpdateAndCheckNetworkStackRegistered()
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -24,6 +24,6 @@ java_library_host {
    ],
    static_libs: [
        "kotlin-test",
        "module_test_util",
        "cts-install-lib-host",
    ],
}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.testutils.host

import com.android.tests.util.ModuleTestUtils
import android.cts.install.lib.host.InstallUtilsHost
import com.android.tradefed.config.Option
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test
@@ -99,7 +99,7 @@ abstract class DeflakeHostTestBase : BaseHostJUnit4Test() {

    @Test
    fun testDeflake() {
        val apkFile = ModuleTestUtils(this).getTestFile(testApkFilename)
        val apkFile = InstallUtilsHost(this).getTestFile(testApkFilename)
        val pkgName = AaptParser.parse(apkFile)?.packageName
                ?: fail("Could not parse test package name")