1rust_test { 2 name: "authfs_device_test_src_lib", 3 defaults: ["authfs_defaults"], 4 test_suites: ["general-tests"], 5 data: [":authfs_test_files"], 6 apex_available: ["//apex_available:platform"], 7} 8 9filegroup { 10 name: "authfs_test_files", 11 srcs: [ 12 "testdata/cert.der", 13 "testdata/input.4k", 14 "testdata/input.4k.fsv_meta", 15 "testdata/input.4k1", 16 "testdata/input.4k1.fsv_meta", 17 "testdata/input.4m", 18 "testdata/input.4m.fsv_meta", 19 "testdata/input.4m.fsv_meta.bad_merkle", 20 ], 21} 22 23java_genrule { 24 name: "authfs_test_apk_assets", 25 out: ["authfs_test_apk_assets.jar"], 26 tools: [ 27 "fsverity_manifest_generator", 28 "fsverity", 29 "soong_zip", 30 ], 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 */ 42 cmd: "mkdir -p $(genDir)/assets" + 43 "&& $(location fsverity_manifest_generator) " + 44 " --fsverity-path $(location fsverity) " + 45 " --base-dir $$(dirname $(in) | head -1) " + 46 " --output $(genDir)/assets/input_manifest.pb " + 47 " $(in) " + 48 "&& $(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)/assets", 49} 50