diff options
| author | 2019-07-26 14:13:51 -0700 | |
|---|---|---|
| committer | 2019-08-02 20:13:03 +0000 | |
| commit | 276f06275b3c93bbebf787bb6ffb28fce9ee3fee (patch) | |
| tree | df2ad5d0f93ea7c0fab91b662f8677af751b0b82 /tools/releasetools/test_common.py | |
| parent | c016c281c1f34aa2d9507cc8f2174b3ce52f4cbb (diff) | |
Adds support for optionally generating vbmeta.img in merge_builds.
Bug: 137853921
Bug: 138671115
Test: python -m unittest test_common
Test: python -m unittest test_add_img_to_target_files
Test: Ran 'merge_builds --build_vbmeta' for two devices, one with the
vbmeta struct on system.img and another with vbmeta_system.img. Flashed
the regenerated vbmeta.img files on devices, devices boot.
Change-Id: I8d7585c7af468be3d242d8aceeed6d27e6fc6d96
Diffstat (limited to 'tools/releasetools/test_common.py')
| -rw-r--r-- | tools/releasetools/test_common.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/releasetools/test_common.py b/tools/releasetools/test_common.py index bcfb1c104a..ceb023f793 100644 --- a/tools/releasetools/test_common.py +++ b/tools/releasetools/test_common.py @@ -1137,6 +1137,30 @@ class CommonUtilsTest(test_utils.ReleaseToolsTestCase): } self.assertEqual(merged_dict, expected_merged_dict) + def test_GetAvbPartitionArg(self): + info_dict = {} + cmd = common.GetAvbPartitionArg('system', '/path/to/system.img', info_dict) + self.assertEqual( + ['--include_descriptors_from_image', '/path/to/system.img'], cmd) + + @test_utils.SkipIfExternalToolsUnavailable() + def test_AppendVBMetaArgsForPartition_vendorAsChainedPartition(self): + testdata_dir = test_utils.get_testdata_dir() + pubkey = os.path.join(testdata_dir, 'testkey.pubkey.pem') + info_dict = { + 'avb_avbtool': 'avbtool', + 'avb_vendor_key_path': pubkey, + 'avb_vendor_rollback_index_location': 5, + } + cmd = common.GetAvbPartitionArg('vendor', '/path/to/vendor.img', info_dict) + self.assertEqual(2, len(cmd)) + self.assertEqual('--chain_partition', cmd[0]) + chained_partition_args = cmd[1].split(':') + self.assertEqual(3, len(chained_partition_args)) + self.assertEqual('vendor', chained_partition_args[0]) + self.assertEqual('5', chained_partition_args[1]) + self.assertTrue(os.path.exists(chained_partition_args[2])) + class InstallRecoveryScriptFormatTest(test_utils.ReleaseToolsTestCase): """Checks the format of install-recovery.sh. |