Runs host_init_verifier on merged target files packages.

This verifies the init rc files in the merged result.

Bug: 163089173
Test: test_common.py
Test: Run merge_target_files.py to merge two target-files packages where
      one has init_rc errors. Observe script failure.
Test: Run merge_target_files.py on two good target-files packages,
      observe no failure.
Change-Id: I86c8e5a2bc07c2c1896ac40afd32bc1d055447ee
This commit is contained in:
Daniel Norman
2020-11-11 17:25:50 -08:00
parent 5569faae37
commit 21c34f78e8
4 changed files with 91 additions and 6 deletions

View File

@@ -996,6 +996,27 @@ class CommonUtilsTest(test_utils.ReleaseToolsTestCase):
},
sparse_image.file_map)
def test_PartitionMapFromTargetFiles(self):
target_files_dir = common.MakeTempDir()
os.makedirs(os.path.join(target_files_dir, 'SYSTEM'))
os.makedirs(os.path.join(target_files_dir, 'SYSTEM', 'vendor'))
os.makedirs(os.path.join(target_files_dir, 'PRODUCT'))
os.makedirs(os.path.join(target_files_dir, 'SYSTEM', 'product'))
os.makedirs(os.path.join(target_files_dir, 'SYSTEM', 'vendor', 'odm'))
os.makedirs(os.path.join(target_files_dir, 'VENDOR_DLKM'))
partition_map = common.PartitionMapFromTargetFiles(target_files_dir)
self.assertDictEqual(
partition_map,
{
'system': 'SYSTEM',
'vendor': 'SYSTEM/vendor',
# Prefer PRODUCT over SYSTEM/product
'product': 'PRODUCT',
'odm': 'SYSTEM/vendor/odm',
'vendor_dlkm': 'VENDOR_DLKM',
# No system_ext or odm_dlkm
})
def test_SharedUidPartitionViolations(self):
uid_dict = {
'android.uid.phone': {