diff options
author | Paul Trautrim <paultrautrim@google.com> | 2019-07-02 04:16:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-07-02 04:16:29 +0000 |
commit | b4bf19c7df46f3a02237ba1ea0212576ef0a7b65 (patch) | |
tree | 622a31c37aa814a3172089f487650748aa0c1fcd /tests | |
parent | dc3613ab24d3cee73a46b0be0992dbe1254dcfb0 (diff) | |
parent | 31ca2a9dd01031c7712ea63dd94d899b28283f17 (diff) | |
download | gsid-b4bf19c7df46f3a02237ba1ea0212576ef0a7b65.tar.gz |
Merge "Fix issues with DSU test when run from test infra"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Android.bp | 3 | ||||
-rw-r--r-- | tests/DSUEndtoEndTest.java | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/Android.bp b/tests/Android.bp index cb4ae49..8ddd0d2 100644 --- a/tests/Android.bp +++ b/tests/Android.bp @@ -50,5 +50,6 @@ android_test { libs: ["junit", "android.test.base.stubs"], static_libs: ["androidx.test.uiautomator"], certificate: "platform", - manifest: "AndroidManifest.xml" + manifest: "AndroidManifest.xml", + test_suites: ["general-tests"], } diff --git a/tests/DSUEndtoEndTest.java b/tests/DSUEndtoEndTest.java index a0580aa..175ca54 100644 --- a/tests/DSUEndtoEndTest.java +++ b/tests/DSUEndtoEndTest.java @@ -76,13 +76,13 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test { public void testDSU() throws Exception { String simg2imgPath = "simg2img"; if (mSystemImagePath == null) { - IDeviceBuildInfo deviceBuild = (IDeviceBuildInfo) getBuild(); - File system = deviceBuild.getDeviceImageFile(); + IBuildInfo buildInfo = getBuild(); + File system = ((IDeviceBuildInfo) buildInfo).getDeviceImageFile(); Assert.assertNotEquals("Failed to fetch system image. See system_image_path parameter", null, system); - mSystemImagePath = system.getAbsolutePath(); - File otaPackage = deviceBuild.getOtaPackageFile(); - File simg2img = ZipUtil2.extractFileFromZip(new ZipFile(otaPackage), SIMG2IMG_PATH); - simg2imgPath = simg2img.getAbsolutePath(); + mSystemImagePath = ZipUtil2.extractFileFromZip(new ZipFile(system), "system.img").getAbsolutePath(); + File otaTools = buildInfo.getFile("otatools.zip"); + File tempdir = ZipUtil2.extractZipToTemp(otaTools, "otatools"); + simg2imgPath = new File(tempdir, SIMG2IMG_PATH).getAbsolutePath(); } File gsi = new File(mSystemImagePath); Assert.assertTrue("not a valid file", gsi.isFile()); |