/build/soong/scripts/ |
D | manifest_fixer_test.py | 32 def test_sdk(self): argument 34 self.assertTrue(manifest_fixer.compare_version_gt('28', '27')) 35 self.assertFalse(manifest_fixer.compare_version_gt('27', '28')) 36 self.assertFalse(manifest_fixer.compare_version_gt('28', '28')) 38 def test_codename(self): argument 40 self.assertTrue(manifest_fixer.compare_version_gt('Q', 'P')) 41 self.assertFalse(manifest_fixer.compare_version_gt('P', 'Q')) 42 self.assertFalse(manifest_fixer.compare_version_gt('Q', 'Q')) 44 def test_sdk_codename(self): argument 46 self.assertTrue(manifest_fixer.compare_version_gt('Q', '28')) [all …]
|
D | manifest_check_test.py | 39 def run_test(self, input_manifest, uses_libraries=None, optional_uses_libraries=None): argument 55 def test_uses_library(self): argument 56 manifest_input = self.manifest_tmpl % (uses_library('foo')) 57 matches = self.run_test(manifest_input, uses_libraries=['foo']) 58 self.assertTrue(matches) 60 def test_uses_library_required(self): argument 61 manifest_input = self.manifest_tmpl % (uses_library('foo', required(True))) 62 matches = self.run_test(manifest_input, uses_libraries=['foo']) 63 self.assertTrue(matches) 65 def test_optional_uses_library(self): argument [all …]
|
/build/make/tools/releasetools/ |
D | images.py | 24 def RangeSha1(self, ranges): argument 27 def ReadRangeSet(self, ranges): argument 30 def TotalSha1(self, include_clobbered_blocks=False): argument 33 def WriteRangeDataToFd(self, ranges, fd): argument 40 def __init__(self): argument 41 self.blocksize = 4096 42 self.care_map = RangeSet() 43 self.clobbered_blocks = RangeSet() 44 self.extended = RangeSet() 45 self.total_blocks = 0 [all …]
|
D | test_rangelib.py | 23 def test_union(self): argument 24 self.assertEqual(RangeSet("10-19 30-34").union(RangeSet("18-29")), 26 self.assertEqual(RangeSet("10-19 30-34").union(RangeSet("22 32")), 29 def test_intersect(self): argument 30 self.assertEqual(RangeSet("10-19 30-34").intersect(RangeSet("18-32")), 32 self.assertEqual(RangeSet("10-19 30-34").intersect(RangeSet("22-28")), 35 def test_subtract(self): argument 36 self.assertEqual(RangeSet("10-19 30-34").subtract(RangeSet("18-32")), 38 self.assertEqual(RangeSet("10-19 30-34").subtract(RangeSet("22-28")), 41 def test_overlaps(self): argument [all …]
|
D | test_check_partition_sizes.py | 22 def setUp(self): argument 23 self.info_dict = common.LoadDictionaryFromLines(""" 38 def test_ab(self): argument 39 CheckPartitionSizes(self.info_dict) 41 def test_non_ab(self): argument 42 self.info_dict.update(common.LoadDictionaryFromLines(""" 47 CheckPartitionSizes(self.info_dict) 49 def test_non_dap(self): argument 50 self.info_dict.update(common.LoadDictionaryFromLines(""" 53 with self.assertRaises(RuntimeError): [all …]
|
D | test_verity_utils.py | 38 def setUp(self): argument 39 self.testdata_dir = get_testdata_dir() 41 self.partition_size = 1024 * 1024 42 self.prop_dict = { 46 'system_size': self.partition_size 49 self.hash_algorithm = "sha256" 50 self.fixed_salt = ( 52 self.expected_root_hash = ( 55 def _CreateSimg(self, raw_data): # pylint: disable=no-self-use argument 65 def _GenerateImage(self): argument [all …]
|
D | test_ota_from_target_files.py | 80 def test_NoneDict(self): argument 81 self.assertIsNone(_LoadOemDicts(None)) 83 def test_SingleDict(self): argument 89 self.assertEqual(1, len(oem_dicts)) 90 self.assertEqual('foo', oem_dicts[0]['xyz']) 91 self.assertEqual('bar', oem_dicts[0]['a.b.c']) 93 def test_MultipleDicts(self): argument 103 self.assertEqual(3, len(oem_dicts)) 105 self.assertEqual('2', oem_dict['def']) 106 self.assertEqual('foo', oem_dict['xyz']) [all …]
|
D | test_apex_utils.py | 33 def setUp(self): argument 34 self.testdata_dir = test_utils.get_testdata_dir() 36 self.payload_key = os.path.join(self.testdata_dir, 'testkey.key') 37 self.apex_with_apk = os.path.join(self.testdata_dir, 'has_apk.apex') 49 def test_ParseApexPayloadInfo(self): argument 50 payload_file = self._GetTestPayload() 52 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048', 53 self.SALT, 'sha256', no_hashtree=True) 55 self.assertEqual('SHA256_RSA2048', payload_info['Algorithm']) 56 self.assertEqual(self.SALT, payload_info['Salt']) [all …]
|
D | test_common.py | 171 def test_init(self): argument 172 target_info = common.BuildInfo(self.TEST_INFO_DICT, None) 173 self.assertEqual('product-device', target_info.device) 174 self.assertEqual('build-fingerprint', target_info.fingerprint) 175 self.assertFalse(target_info.is_ab) 176 self.assertIsNone(target_info.oem_props) 178 def test_init_with_oem_props(self): argument 179 target_info = common.BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS, 180 self.TEST_OEM_DICTS) 181 self.assertEqual('device1', target_info.device) [all …]
|
D | edify_generator.py | 23 def __init__(self, version, info, fstab=None): argument 24 self.script = [] 25 self.mounts = set() 26 self._required_cache = 0 27 self.version = version 28 self.info = info 30 self.fstab = self.info.get("fstab", None) 32 self.fstab = fstab 35 def required_cache(self): argument 37 return self._required_cache [all …]
|
D | verity_utils.py | 38 def __init__(self, message): argument 39 Exception.__init__(self, message) 221 def CalculateMaxImageSize(self, partition_size): argument 225 def CalculateDynamicPartitionSize(self, image_size): argument 229 def PadSparseImage(self, out_file): argument 233 def Build(self, out_file): argument 241 def __init__(self, partition_size, block_dev, fec_supported, signer_path, argument 243 self.version = 1 244 self.partition_size = partition_size 245 self.block_device = block_dev [all …]
|
D | test_blockimgdiff.py | 30 def __init__(self, score): argument 31 self.score = score 33 def test_init(self): argument 34 item1 = HeapItem(self.Item(15)) 35 item2 = HeapItem(self.Item(20)) 36 item3 = HeapItem(self.Item(15)) 37 self.assertTrue(item1) 38 self.assertTrue(item2) 39 self.assertTrue(item3) 41 self.assertNotEqual(item1, item2) [all …]
|
D | test_sign_target_files_apks.py | 47 def setUp(self): argument 48 self.testdata_dir = test_utils.get_testdata_dir() 50 def test_EditTags(self): argument 51 self.assertEqual(EditTags('dev-keys'), ('release-keys')) 52 self.assertEqual(EditTags('test-keys'), ('release-keys')) 55 self.assertEqual(EditTags('abc,dev-keys,xyz'), ('abc,release-keys,xyz')) 58 self.assertEqual(EditTags('xyz,abc,dev-keys,xyz'), ('abc,release-keys,xyz')) 60 def test_RewriteAvbProps(self): argument 92 self.assertDictEqual(expected_dict, misc_info) 94 def test_RewriteProps(self): argument [all …]
|
D | rangelib.py | 33 def __init__(self, data=None): argument 34 self.monotonic = False 35 self._extra = {} 37 self._parse_internal(data) 40 self.data = tuple(self._remove_pairs(data)) 41 self.monotonic = all(x < y for x, y in zip(self.data, self.data[1:])) 43 self.data = () 45 def __iter__(self): argument 46 for i in range(0, len(self.data), 2): 47 yield self.data[i:i+2] [all …]
|
D | test_add_img_to_target_files.py | 34 def setUp(self): argument 54 def test_CheckAbOtaImages_imageExistsUnderImages(self): argument 56 images, _ = self._create_images(['aboot', 'xbl'], 'IMAGES') 59 def test_CheckAbOtaImages_imageExistsUnderRadio(self): argument 61 images, _ = self._create_images(['system', 'vendor'], 'IMAGES') 69 def test_CheckAbOtaImages_missingImages(self): argument 70 images, _ = self._create_images(['aboot', 'xbl'], 'RADIO') 71 self.assertRaises( 74 def test_AddPackRadioImages(self): argument 75 images, images_path = self._create_images(['foo', 'bar'], 'RADIO') [all …]
|
D | ota_package_parser.py | 27 def __init__(self): argument 28 self.blocks_stashed = 0 29 self.overlap_blocks_stashed = 0 30 self.max_stash_needed = 0 31 self.current_stash_size = 0 32 self.stash_map = {} 34 def StashBlocks(self, SHA1, blocks): argument 35 if SHA1 in self.stash_map: 38 self.blocks_stashed += blocks.size() 39 self.current_stash_size += blocks.size() [all …]
|
D | test_build_image.py | 33 def test_CheckHeadroom_SizeUnderLimit(self): argument 40 CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict) 42 def test_CheckHeadroom_InsufficientHeadroom(self): argument 49 self.assertRaises( 50 BuildImageError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict) 53 def test_CheckHeadroom_WrongFsType(self): argument 59 self.assertRaises( 60 AssertionError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict) 62 def test_CheckHeadroom_MissingProperties(self): argument 67 self.assertRaises( [all …]
|
/build/make/tools/ |
D | test_post_process_props.py | 25 def test_createFromLine(self): argument 27 self.assertTrue(p.is_comment()) 28 self.assertEqual("", p.name) 29 self.assertEqual("", p.value) 30 self.assertFalse(p.is_optional()) 31 self.assertEqual("# this is comment", str(p)) 35 self.assertFalse(p.is_comment()) 36 self.assertEqual("a", p.name) 37 self.assertEqual("b", p.value) 38 self.assertFalse(p.is_optional()) [all …]
|
D | fat16copy.py | 81 def seek(self, amount, direction=0): argument 84 self.idx += amount 86 self.idx = self.size - amount 88 self.idx = amount 90 if self.idx < 0: 91 self.idx = 0 92 if self.idx > self.size: 93 self.idx = self.size 102 def __init__(self, fs, cluster, size=None): argument 109 self.fs = fs [all …]
|
D | event_log_tags.py | 23 def __init__(self, tagnum, tagname, description, filename, linenum): argument 24 self.tagnum = tagnum 25 self.tagname = tagname 26 self.description = description 27 self.filename = filename 28 self.linenum = linenum 33 def AddError(self, msg, linenum=None): argument 35 linenum = self.linenum 36 self.errors.append((self.filename, linenum, msg)) 38 def AddWarning(self, msg, linenum=None): argument [all …]
|
D | auto_gen_test_config_test.py | 118 def setUp(self): argument 120 self.test_dir = tempfile.mkdtemp() 121 self.config_file = os.path.join(self.test_dir, TEST_MODULE + '.config') 122 self.manifest_file = os.path.join(self.test_dir, 'AndroidManifest.xml') 124 def tearDown(self): argument 126 shutil.rmtree(self.test_dir, ignore_errors=True) 128 def testInvalidManifest(self): argument 131 with open(self.manifest_file, 'w') as f: 134 argv = [self.config_file, 135 self.manifest_file, [all …]
|
/build/soong/cc/symbolfile/ |
D | test_symbolfile.py | 27 def test_decode_api_level(self): argument 28 self.assertEqual(9, symbolfile.decode_api_level('9', {})) 29 self.assertEqual(9000, symbolfile.decode_api_level('O', {'O': 9000})) 31 with self.assertRaises(KeyError): 36 def test_get_tags_no_tags(self): argument 37 self.assertEqual([], symbolfile.get_tags('')) 38 self.assertEqual([], symbolfile.get_tags('foo bar baz')) 40 def test_get_tags(self): argument 41 self.assertEqual(['foo', 'bar'], symbolfile.get_tags('# foo bar')) 42 self.assertEqual(['bar', 'baz'], symbolfile.get_tags('foo # bar baz')) [all …]
|
D | __init__.py | 226 def __init__(self, multiply_defined_symbols): argument 227 super(MultiplyDefinedSymbolError, self).__init__( 230 self.multiply_defined_symbols = multiply_defined_symbols 235 def __init__(self, name, base, tags, symbols): argument 236 self.name = name 237 self.base = base 238 self.tags = tags 239 self.symbols = symbols 241 def __eq__(self, other): argument 242 if self.name != other.name: [all …]
|
/build/make/tools/fs_config/ |
D | fs_config_generator.py | 42 def __init__(self, gen): argument 51 self._gen = gen 58 def __call__(self, cls): argument 60 generator._generators[self._gen] = cls() 143 def __init__(self, identifier, value, found, login_shell): argument 156 self.identifier = identifier 157 self.value = value 158 self.found = found 159 self.login_shell = login_shell 162 self.normalized_value = str(int(value, 0)) [all …]
|
D | test_fs_config_generator.py | 22 def test_is_overlap(self): argument 25 self.assertTrue(AIDHeaderParser._is_overlap((0, 1), (1, 2))) 27 self.assertTrue(AIDHeaderParser._is_overlap((0, 100), (90, 200))) 29 self.assertTrue(AIDHeaderParser._is_overlap((20, 50), (1, 101))) 31 self.assertFalse(AIDHeaderParser._is_overlap((0, 100), (101, 200))) 33 self.assertFalse(AIDHeaderParser._is_overlap((-10, 0), (10, 20))) 35 def test_in_any_range(self): argument 38 self.assertFalse(Utils.in_any_range(50, [(100, 200), (1, 2), (1, 1)])) 39 self.assertFalse(Utils.in_any_range(250, [(100, 200), (1, 2), (1, 1)])) 41 self.assertTrue(Utils.in_any_range(100, [(100, 200), (1, 2), (1, 1)])) [all …]
|