sign_virt_apex: add --do_not_validate_avb_version flag
The CTS binary for 24Q1 release is built from the different branch that
the system image. Unfortunately these 2 branches have a different avb
version, which results in MicrodroidHostTests failures.
This patch adds a flag to skip the avb_version validation when running
the MicrodroidHostTests. It is just a workaround for CTS failures.
Bug: 315405099
Test: atest MicrodroidHostTestCases
Change-Id: Ice9457428575c6d0c91894e4ec67c3aab673c192
diff --git a/apex/sign_virt_apex.py b/apex/sign_virt_apex.py
index a975be0..b21a355 100644
--- a/apex/sign_virt_apex.py
+++ b/apex/sign_virt_apex.py
@@ -108,6 +108,7 @@
action='store_true',
help='This will NOT update the vbmeta related bootconfigs while signing the apex.\
Used for testing only!!')
+ parser.add_argument('--do_not_validate_avb_version', action='store_true', help='Do not validate the avb_version when updating vbmeta bootconfig. Only use in tests!')
args = parser.parse_args(argv)
# preprocess --key_override into a map
args.key_overrides = {}
@@ -328,7 +329,8 @@
detach_bootconfigs(initrd, tmp_initrd, tmp_bc)
bc_file = open(tmp_bc, "rt", encoding="utf-8")
bc_data = bc_file.read()
- validate_avb_version(bc_data)
+ if not args.do_not_validate_avb_version:
+ validate_avb_version(bc_data)
bc_data = update_vbmeta_digest(bc_data)
bc_data = update_vbmeta_size(bc_data)
bc_file.close()