def test_AppendVBMetaArgsForPartition_vendorAsChainedPartition(self): testdata_dir = test_utils.get_testdata_dir() pubkey = os.path.join(testdata_dir, 'testkey.pubkey.pem') OPTIONS.info_dict = { 'avb_avbtool': 'avbtool', 'avb_vendor_key_path': pubkey, 'avb_vendor_rollback_index_location': 5, } cmd = [] AppendVBMetaArgsForPartition(cmd, 'vendor', '/path/to/vendor.img') 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]))
def test_AppendVBMetaArgsForPartition(self): OPTIONS.info_dict = {} cmd = [] AppendVBMetaArgsForPartition(cmd, 'system', '/path/to/system.img') self.assertEqual( ['--include_descriptors_from_image', '/path/to/system.img'], cmd)