Reimplement ApkVerityTest

This is a regression/end-to-end test of fs-verity. The original test
setup uses ".fsv_sig" to enable fs-verity on APK then use them as the
target to tamper with.

Now that an app API exists, switch the test setup to use the API. We
can also avoid the placeholder app and signature now.

Since the test is almost a complete rewrite, move it from presubmit to
postsubmit until it's proven stable enough.

Bug: 277916185
Bug: 296465999
Test: atest FsVerityTest
Change-Id: I1bbeb5d6adc960bf3fe4e9c1262ffc7538062f61
diff --git a/tests/ApkVerityTest/AndroidTest.xml b/tests/ApkVerityTest/AndroidTest.xml
index 4487cef..49cbde0 100644
--- a/tests/ApkVerityTest/AndroidTest.xml
+++ b/tests/ApkVerityTest/AndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="APK fs-verity integration/regression test">
+<configuration description="fs-verity end-to-end test">
     <option name="test-suite-tag" value="apct" />
 
     <object type="module_controller" class="com.android.tradefed.testtype.suite.module.ShippingApiLevelModuleController">
@@ -24,19 +24,9 @@
     <!-- This test requires root to write against block device. -->
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
 
-    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
-        <!-- Disable package verifier prevents it holding the target APK's fd that prevents cache
-             eviction. -->
-        <option name="set-global-setting" key="verifier_verify_adb_installs" value="0" />
-        <option name="restore-settings" value="true" />
-
-        <!-- Skip in order to prevent reboot that confuses the test flow. -->
-        <option name="force-skip-system-props" value="true" />
-    </target_preparer>
-
-    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
-        <option name="cleanup" value="true" />
-        <option name="push" value="ApkVerityTestCert.der->/data/local/tmp/ApkVerityTestCert.der" />
+    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+        <option name="test-file-name" value="FsVerityTestApp.apk"/>
+        <option name="cleanup-apks" value="true"/>
     </target_preparer>
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
@@ -48,9 +38,7 @@
         <option name="push" value="block_device_writer->/data/local/tmp/block_device_writer" />
     </target_preparer>
 
-    <!-- Skip on HWASan. TODO(b/232288278): Re-enable -->
-    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.SkipHWASanModuleController" />
     <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
-        <option name="jar" value="ApkVerityTest.jar" />
+        <option name="jar" value="FsVerityTest.jar" />
     </test>
 </configuration>