Add sign_virt_apex_test
This test re-signs the virt apex contents and then check if they are
signed with the new key. Note that this isn't an end-to-end test to
install re-signed apex and see if it works, but only checks avbtool
signable items are signed with the new key by comparing pubkey digest.
This will help to notice when adding a new signed item without modifying
sign_virt_apex though.
Bug: 193504286
Test: atest --host sign_virt_apex_test
Change-Id: I16098c49f41e14f571dca272310b81459d9803a8
diff --git a/apex/Android.bp b/apex/Android.bp
index 88487e4..3fbfd28 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -110,6 +110,41 @@
],
}
+sh_test_host {
+ name: "sign_virt_apex_test",
+ src: "sign_virt_apex_test.sh",
+ test_config: "sign_virt_apex_test.xml",
+ data_bins: [
+ // deapexer
+ "deapexer",
+ "debugfs_static",
+
+ // sign_virt_apex
+ "avbtool",
+ "img2simg",
+ "lpmake",
+ "lpunpack",
+ "sign_virt_apex",
+ "simg2img",
+ ],
+ data_libs: [
+ "libbase",
+ "libc++",
+ "libcrypto_utils",
+ "libcrypto",
+ "libext4_utils",
+ "liblog",
+ "liblp",
+ "libsparse",
+ "libz",
+ ],
+ data: [
+ ":com.android.virt",
+ "test.com.android.virt.pem",
+ ],
+ test_suites: ["general-tests"],
+}
+
// custom tool to replace bytes in a file
python_binary_host {
name: "replace_bytes",