blob: aa814eb41da10135749b40a0daf0c679b8d3987b [file] [log] [blame]
Victor Hsiehad46e0b2021-01-25 16:07:38 -08001rust_test {
2 name: "authfs_device_test_src_lib",
3 defaults: ["authfs_defaults"],
Jiyong Park5c71cac2022-02-04 11:49:31 +09004 test_suites: ["general-tests"],
Victor Hsieh85b4f732021-03-09 16:02:14 -08005 data: [":authfs_test_files"],
6}
7
8filegroup {
9 name: "authfs_test_files",
10 srcs: [
11 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080012 "testdata/input.4k",
Inseob Kimc0886c22021-12-13 17:41:24 +090013 "testdata/input.4k.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080014 "testdata/input.4k1",
Inseob Kimc0886c22021-12-13 17:41:24 +090015 "testdata/input.4k1.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080016 "testdata/input.4m",
Inseob Kimc0886c22021-12-13 17:41:24 +090017 "testdata/input.4m.fsv_meta",
18 "testdata/input.4m.fsv_meta.bad_merkle",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080019 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080020}
Andrew Scull6ad64402022-07-04 13:12:53 +000021
22java_genrule {
23 name: "authfs_test_apk_assets",
24 out: ["authfs_test_apk_assets.jar"],
25 tools: [
26 "fsverity_manifest_generator",
27 "fsverity",
Dan Willemsen2ef575b2024-02-16 20:39:06 -050028 "soong_zip",
Andrew Scull6ad64402022-07-04 13:12:53 +000029 ],
30 srcs: [
31 "testdata/input.4k",
32 "testdata/input.4k1",
33 "testdata/input.4m",
34 ],
35 /*
36 * Create a JAR file with an assets directory that can merge into the
37 * assets of an APK that depends on it in static_libs. Use this mechanism
38 * to load a generated fsverity manifest for the test input files into the
39 * test VM.
40 */
Dan Willemsen2ef575b2024-02-16 20:39:06 -050041 cmd: "mkdir -p $(genDir)/assets" +
Andrew Scull6ad64402022-07-04 13:12:53 +000042 "&& $(location fsverity_manifest_generator) " +
43 " --fsverity-path $(location fsverity) " +
44 " --base-dir $$(dirname $(in) | head -1) " +
Dan Willemsen2ef575b2024-02-16 20:39:06 -050045 " --output $(genDir)/assets/input_manifest.pb " +
Andrew Scull6ad64402022-07-04 13:12:53 +000046 " $(in) " +
Dan Willemsen2ef575b2024-02-16 20:39:06 -050047 "&& $(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)/assets",
Andrew Scull6ad64402022-07-04 13:12:53 +000048}