Stop using fs-verity signature
The test doesn't really need fs-verity signature. It was used to satisfy
the previous/removed signature requirement.
Bug: 290064770
Bug: 277916185
Test: AuthFsHostTest
Change-Id: I022fb30146688546e697d30a67731e563b96d374
diff --git a/authfs/tests/hosttests/Android.bp b/authfs/tests/hosttests/Android.bp
index 4b8151d..83ef853 100644
--- a/authfs/tests/hosttests/Android.bp
+++ b/authfs/tests/hosttests/Android.bp
@@ -20,7 +20,6 @@
per_testcase_directory: true,
data: [
":authfs_test_files",
- ":CtsApkVerityTestPrebuiltFiles",
":MicrodroidTestApp",
],
}
diff --git a/authfs/tests/hosttests/AndroidTest.xml b/authfs/tests/hosttests/AndroidTest.xml
index 2ccc45f..5920630 100644
--- a/authfs/tests/hosttests/AndroidTest.xml
+++ b/authfs/tests/hosttests/AndroidTest.xml
@@ -50,18 +50,13 @@
<option name="push-file" key="input.4m.fsv_meta.bad_merkle"
value="/data/local/tmp/authfs/input.4m.fsv_meta.bad_merkle" />
- <!-- Just pick a file with signature that can be trused on the device. -->
- <option name="push-file" key="CtsApkVerityTestAppPrebuilt.apk"
- value="/data/local/tmp/authfs/input.apk" />
- <option name="push-file" key="CtsApkVerityTestAppPrebuilt.apk.fsv_sig"
- value="/data/local/tmp/authfs/input.apk.fsv_sig" />
+ <option name="push-file" key="input.4m" value="/data/local/tmp/authfs/input.file" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<option name="throw-if-cmd-fail" value="true" />
- <!-- Now that the files are pushed to the device, enable fs-verity for the targeting file.
- It works because the signature is trusted on all CTS compatible devices. -->
- <option name="run-command" value="cd /data/local/tmp/authfs; ../fsverity enable input.apk --signature=input.apk.fsv_sig" />
+ <!-- Now that the files are pushed to the device, enable fs-verity for the targeting file. -->
+ <option name="run-command" value="cd /data/local/tmp/authfs; ../fsverity enable input.file" />
</target_preparer>
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
diff --git a/authfs/tests/hosttests/java/src/com/android/fs/AuthFsHostTest.java b/authfs/tests/hosttests/java/src/com/android/fs/AuthFsHostTest.java
index 440f5ca..d0a7c66 100644
--- a/authfs/tests/hosttests/java/src/com/android/fs/AuthFsHostTest.java
+++ b/authfs/tests/hosttests/java/src/com/android/fs/AuthFsHostTest.java
@@ -145,17 +145,17 @@
@Test
public void testReadWithFsverityVerification_FdServerUsesRealFsverityData() throws Exception {
- // Setup (fs-verity is enabled for input.apk in AndroidTest.xml)
- runFdServerOnAndroid("--open-ro 3:input.apk", "--ro-fds 3");
- String expectedDigest = sAndroid.run(
- FSVERITY_BIN + " digest --compact " + TEST_DIR + "/input.apk");
+ // Setup (fs-verity is enabled for input.file in AndroidTest.xml)
+ runFdServerOnAndroid("--open-ro 3:input.file", "--ro-fds 3");
+ String expectedDigest =
+ sAndroid.run(FSVERITY_BIN + " digest --compact " + TEST_DIR + "/input.file");
runAuthFsOnMicrodroid("--remote-ro-file 3:sha256-" + expectedDigest);
// Action
String actualHash = computeFileHash(sMicrodroid, MOUNT_DIR + "/3");
// Verify
- String expectedHash = computeFileHash(sAndroid, TEST_DIR + "/input.apk");
+ String expectedHash = computeFileHash(sAndroid, TEST_DIR + "/input.file");
assertEquals("Inconsistent hash from /authfs/3: ", expectedHash, actualHash);
}