Removing AFTL integration from release tools.

Bug: 158639560
Test: Treehugger
Change-Id: I6949385e3448ad539099966c41ce99f156e3fdc4
This commit is contained in:
Jan Monsch
2021-06-23 12:30:35 +02:00
parent cba3ec7818
commit e147d481fe
5 changed files with 1 additions and 212 deletions

View File

@@ -1631,88 +1631,6 @@ class CommonUtilsTest(test_utils.ReleaseToolsTestCase):
self.assertEqual('3', chained_partition_args[1])
self.assertTrue(os.path.exists(chained_partition_args[2]))
def test_BuildVBMeta_appendAftlCommandSyntax(self):
testdata_dir = test_utils.get_testdata_dir()
common.OPTIONS.info_dict = {
'ab_update': 'true',
'avb_avbtool': 'avbtool',
'build.prop': common.PartitionBuildProps.FromDictionary(
'system', {
'ro.build.version.incremental': '6285659',
'ro.product.device': 'coral',
'ro.build.fingerprint':
'google/coral/coral:R/RP1A.200311.002/'
'6285659:userdebug/dev-keys'}
),
}
common.OPTIONS.aftl_tool_path = 'aftltool'
common.OPTIONS.aftl_server = 'log.endpoints.aftl-dev.cloud.goog:9000'
common.OPTIONS.aftl_key_path = os.path.join(testdata_dir,
'test_transparency_key.pub')
common.OPTIONS.aftl_manufacturer_key_path = os.path.join(
testdata_dir, 'test_aftl_rsa4096.pem')
vbmeta_image = tempfile.NamedTemporaryFile(delete=False)
cmd = common.ConstructAftlMakeImageCommands(vbmeta_image.name)
expected_cmd = [
'aftltool', 'make_icp_from_vbmeta',
'--vbmeta_image_path', 'place_holder',
'--output', vbmeta_image.name,
'--version_incremental', '6285659',
'--transparency_log_servers',
'log.endpoints.aftl-dev.cloud.goog:9000,{}'.format(
common.OPTIONS.aftl_key_path),
'--manufacturer_key', common.OPTIONS.aftl_manufacturer_key_path,
'--algorithm', 'SHA256_RSA4096',
'--padding', '4096']
# ignore the place holder, i.e. path to a temp file
self.assertEqual(cmd[:3], expected_cmd[:3])
self.assertEqual(cmd[4:], expected_cmd[4:])
@unittest.skip("enable after we have a server for public")
def test_BuildVBMeta_appendAftlContactServer(self):
testdata_dir = test_utils.get_testdata_dir()
common.OPTIONS.info_dict = {
'ab_update': 'true',
'avb_avbtool': 'avbtool',
'build.prop': common.PartitionBuildProps.FromDictionary(
'system', {
'ro.build.version.incremental': '6285659',
'ro.product.device': 'coral',
'ro.build.fingerprint':
'google/coral/coral:R/RP1A.200311.002/'
'6285659:userdebug/dev-keys'}
)
}
common.OPTIONS.aftl_tool_path = "aftltool"
common.OPTIONS.aftl_server = "log.endpoints.aftl-dev.cloud.goog:9000"
common.OPTIONS.aftl_key_path = os.path.join(testdata_dir,
'test_transparency_key.pub')
common.OPTIONS.aftl_manufacturer_key_path = os.path.join(
testdata_dir, 'test_aftl_rsa4096.pem')
input_dir = common.MakeTempDir()
system_image = common.MakeTempFile()
build_image_cmd = ['mkuserimg_mke2fs', input_dir, system_image, 'ext4',
'/system', str(4096 * 100), '-j', '0', '-s']
common.RunAndCheckOutput(build_image_cmd)
add_footer_cmd = ['avbtool', 'add_hashtree_footer',
'--partition_size', str(4096 * 150),
'--partition_name', 'system',
'--image', system_image]
common.RunAndCheckOutput(add_footer_cmd)
vbmeta_image = common.MakeTempFile()
common.BuildVBMeta(vbmeta_image, {'system': system_image}, 'vbmeta',
['system'])
verify_cmd = ['aftltool', 'verify_image_icp', '--vbmeta_image_path',
vbmeta_image, '--transparency_log_pub_keys',
common.OPTIONS.aftl_key_path]
common.RunAndCheckOutput(verify_cmd)
@test_utils.SkipIfExternalToolsUnavailable()
def test_AppendGkiSigningArgs_NoSigningKeyPath(self):
# A non-GKI boot.img has no gki_signing_key_path.