Fix AuthFsHostTest on some devices
The file pushed to the device is under <arch> directory, not <abi>. For
example, the actual path looks like open_then_run/arm64-v8a/open_then_run
on my real device, but the test used "arm64" and failed.
Bug: 203251769
Test: atest AuthFsHostTest on my device
Change-Id: Iade987c77171a8cef7c9d7c9b0020c519eeefd7c
diff --git a/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java b/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java
index 2d518a0..7229dde 100644
--- a/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java
+++ b/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java
@@ -34,6 +34,7 @@
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.AfterClassWithInfo;
import com.android.tradefed.testtype.junit4.BeforeClassWithInfo;
+import com.android.tradefed.util.AbiUtils;
import com.android.tradefed.util.CommandResult;
import org.junit.After;
@@ -75,7 +76,7 @@
private static boolean sAssumptionFailed;
private ExecutorService mThreadPool = Executors.newCachedThreadPool();
- private String mAbi;
+ private String mArch;
@BeforeClassWithInfo
public static void beforeClassWithDevice(TestInformation testInfo)
@@ -139,7 +140,7 @@
@Before
public void setUp() {
assumeFalse(sAssumptionFailed);
- mAbi = getAbi().getName();
+ mArch = AbiUtils.getArchForAbi(getAbi().getName());
}
@After
@@ -375,7 +376,7 @@
private String getOpenThenRunPath() {
// Construct path to match PushFilePreparer's upload path.
- return TEST_DIR + "/open_then_run/" + mAbi + "/open_then_run";
+ return TEST_DIR + "/open_then_run/" + mArch + "/open_then_run";
}
private void runFdServerOnAndroid(String helperFlags, String fdServerFlags)