blob: 4c44bb3ee49fe87fa139ed838d661dba1d1bfe57 [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"],
Colin Crosse65c6292025-02-07 20:34:12 +00006 apex_available: ["//apex_available:platform"],
Victor Hsieh85b4f732021-03-09 16:02:14 -08007}
8
9filegroup {
10 name: "authfs_test_files",
11 srcs: [
12 "testdata/cert.der",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080013 "testdata/input.4k",
Inseob Kimc0886c22021-12-13 17:41:24 +090014 "testdata/input.4k.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080015 "testdata/input.4k1",
Inseob Kimc0886c22021-12-13 17:41:24 +090016 "testdata/input.4k1.fsv_meta",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080017 "testdata/input.4m",
Inseob Kimc0886c22021-12-13 17:41:24 +090018 "testdata/input.4m.fsv_meta",
19 "testdata/input.4m.fsv_meta.bad_merkle",
Victor Hsiehfa4477a2021-02-08 10:51:50 -080020 ],
Victor Hsiehad46e0b2021-01-25 16:07:38 -080021}
Andrew Scull6ad64402022-07-04 13:12:53 +000022
23java_genrule {
24 name: "authfs_test_apk_assets",
25 out: ["authfs_test_apk_assets.jar"],
26 tools: [
27 "fsverity_manifest_generator",
28 "fsverity",
Dan Willemsen2ef575b2024-02-16 20:39:06 -050029 "soong_zip",
Andrew Scull6ad64402022-07-04 13:12:53 +000030 ],
31 srcs: [
32 "testdata/input.4k",
33 "testdata/input.4k1",
34 "testdata/input.4m",
35 ],
36 /*
37 * Create a JAR file with an assets directory that can merge into the
38 * assets of an APK that depends on it in static_libs. Use this mechanism
39 * to load a generated fsverity manifest for the test input files into the
40 * test VM.
41 */
Dan Willemsen2ef575b2024-02-16 20:39:06 -050042 cmd: "mkdir -p $(genDir)/assets" +
Andrew Scull6ad64402022-07-04 13:12:53 +000043 "&& $(location fsverity_manifest_generator) " +
44 " --fsverity-path $(location fsverity) " +
45 " --base-dir $$(dirname $(in) | head -1) " +
Dan Willemsen2ef575b2024-02-16 20:39:06 -050046 " --output $(genDir)/assets/input_manifest.pb " +
Andrew Scull6ad64402022-07-04 13:12:53 +000047 " $(in) " +
Dan Willemsen2ef575b2024-02-16 20:39:06 -050048 "&& $(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)/assets",
Andrew Scull6ad64402022-07-04 13:12:53 +000049}