Check super size for factory OTA at build time

For VAB launched device, factory OTA will write system_other
partition to the super image. So we want to check that
sum(dynamic partitions) + system_other + overhead <= super at
build time.

Since we don't know the overhead at build time, we might instead
check sum(all partitions) < super.

Bug: 185809374
Test: m check-all-partition-sizes, unittests
Change-Id: Ia7ba5999d23924a1927e9a9463856a4d0ea90c20
This commit is contained in:
Tianjie
2021-05-13 15:44:43 -07:00
parent ae6bdc0c74
commit 294ec7d9e5
3 changed files with 30 additions and 6 deletions

View File

@@ -33,6 +33,7 @@ class CheckPartitionSizesTest(test_utils.ReleaseToolsTestCase):
system_image_size=50
vendor_image_size=20
product_image_size=20
system_other_image_size=10
""".split("\n"))
def test_ab(self):
@@ -126,3 +127,13 @@ class CheckPartitionSizesTest(test_utils.ReleaseToolsTestCase):
""".split("\n")))
with self.assertRaises(RuntimeError):
CheckPartitionSizes(self.info_dict)
def test_vab_too_big_with_system_other(self):
self.info_dict.update(common.LoadDictionaryFromLines("""
virtual_ab=true
system_other_image_size=20
super_partition_size=101
super_super_device_size=101
""".split("\n")))
with self.assertRaises(RuntimeError):
CheckPartitionSizes(self.info_dict)