Lines Matching refs:self
106 def setUpClass(self): argument
113 self.getUserParams(required_params)
114 self.dut = self.android_devices[0]
115 self.shell = self.dut.shell
116 self._temp_dir = tempfile.mkdtemp()
118 def tearDownClass(self): argument
120 logging.info("Delete %s", self._temp_dir)
121 shutil.rmtree(self._temp_dir)
123 def _ParsePropertyDictFromPropertyContextsFile(self, argument
148 def testActionableCompatiblePropertyEnabled(self): argument
155 self.dut.getProp("ro.actionable_compatible_property.enabled"),
158 def _TestVendorOrOdmPropertyNames(self, partition, contexts_path): argument
161 self.shell, contexts_path, target_file_utils.IsReadable)
164 self.dut.adb.pull(contexts_path, self._temp_dir)
165 logging.info("Adb pull %s to %s", contexts_path, self._temp_dir)
168 os.path.join(self._temp_dir,
171 property_dict = self._ParsePropertyDictFromPropertyContextsFile(
178 self._VENDOR_OR_ODM_NAMESPACES + self._VENDOR_OR_ODM_NAMESPACES_WHITELIST),
185 def _TestPropertyTypes(self, property_contexts_file, check_function): argument
186 fd, downloaded = tempfile.mkstemp(dir=self._temp_dir)
188 self.dut.adb.pull(property_contexts_file, downloaded)
192 property_dict = self._ParsePropertyDictFromPropertyContextsFile(f)
210 def testVendorPropertyNames(self): argument
216 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_P,
219 self._TestVendorOrOdmPropertyNames(
220 "vendor", self._VENDOR_PROPERTY_CONTEXTS_FILE_PATH)
222 def testOdmPropertyNames(self): argument
228 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_P,
232 not target_file_utils.Exists(self._ODM_PROPERTY_CONTEXTS_FILE_PATH,
233 self.shell),
237 self._TestVendorOrOdmPropertyNames(
238 "odm", self._ODM_PROPERTY_CONTEXTS_FILE_PATH)
240 def testProductPropertyNames(self): argument
246 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_P,
250 not target_file_utils.Exists(self._PRODUCT_PROPERTY_CONTEXTS_FILE_PATH,
251 self.shell),
255 self._PRODUCT_PROPERTY_CONTEXTS_FILE_PATH)
257 self.shell, self._PRODUCT_PROPERTY_CONTEXTS_FILE_PATH,
261 self.dut.adb.pull(self._PRODUCT_PROPERTY_CONTEXTS_FILE_PATH,
262 self._temp_dir)
264 self._PRODUCT_PROPERTY_CONTEXTS_FILE_PATH, self._temp_dir)
266 with open(os.path.join(self._temp_dir, "product_property_contexts"),
268 property_dict = self._ParsePropertyDictFromPropertyContextsFile(
277 for prefix in self._VENDOR_OR_ODM_NAMESPACES),
284 def testPlatformPropertyTypes(self): argument
288 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_Q,
291 self._TestPropertyTypes(
292 self._SYSTEM_PROPERTY_CONTEXTS_FILE_PATH,
294 not typename.startswith(self._VENDOR_TYPE_PREFIX) and
295 not typename.startswith(self._ODM_TYPE_PREFIX) and
296 typename not in self._VENDOR_OR_ODM_WHITELISTED_TYPES
297 ) or typename in self._SYSTEM_WHITELISTED_TYPES)
299 def testVendorPropertyTypes(self): argument
303 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_Q,
306 self._TestPropertyTypes(
307 self._VENDOR_PROPERTY_CONTEXTS_FILE_PATH,
308 lambda typename: typename.startswith(self._VENDOR_TYPE_PREFIX) or
309 typename in self._VENDOR_OR_ODM_WHITELISTED_TYPES)
311 def testOdmPropertyTypes(self): argument
315 self.dut.getLaunchApiLevel() <= api.PLATFORM_API_LEVEL_Q,
319 not target_file_utils.Exists(self._ODM_PROPERTY_CONTEXTS_FILE_PATH,
320 self.shell),
324 self._TestPropertyTypes(
325 self._ODM_PROPERTY_CONTEXTS_FILE_PATH,
326 lambda typename: typename.startswith(self._VENDOR_TYPE_PREFIX) or
327 typename.startswith(self._ODM_TYPE_PREFIX) or
328 typename in self._VENDOR_OR_ODM_WHITELISTED_TYPES)
330 def testExportedPlatformPropertyIntegrity(self): argument
336 self._SYSTEM_PROPERTY_CONTEXTS_FILE_PATH)
338 self.shell, self._SYSTEM_PROPERTY_CONTEXTS_FILE_PATH,
342 self.dut.adb.pull(self._SYSTEM_PROPERTY_CONTEXTS_FILE_PATH,
343 self._temp_dir)
345 self._SYSTEM_PROPERTY_CONTEXTS_FILE_PATH, self._temp_dir)
347 with open(os.path.join(self._temp_dir, "plat_property_contexts"),
349 sys_property_dict = self._ParsePropertyDictFromPropertyContextsFile(
356 self.data_file_path, self._PUBLIC_PROPERTY_CONTEXTS_FILE_PATH)
359 pub_property_dict = self._ParsePropertyDictFromPropertyContextsFile(