def get_kernel_log_content(): """Return content of kernel logs.""" kernel_log_content = '' for kernel_log_file in KERNEL_LOG_FILES: kernel_log_content += adb.read_data_from_file(kernel_log_file) or '' return kernel_log_content
def test_remount(self): """Tests remount.""" system_test_file_path = os.path.join('/system', 'a') adb.write_data_to_file('data', system_test_file_path) self.assertEqual(adb.read_data_from_file(system_test_file_path), 'data') adb.run_adb_shell_command(['rm', system_test_file_path])
def test_regular_file(self): """Test that file data is written.""" test_file_path = os.path.join(self.device_temp_dir, 'a') adb.write_data_to_file('a' * 5000, test_file_path) self.assertEqual(adb.read_data_from_file(test_file_path), 'a' * 5000)
def test_non_existent_file(self): """Test that we return None when file does not exist.""" non_existent_file_path = os.path.join(self.device_temp_dir, 'non-existent') self.assertEqual(adb.read_data_from_file(non_existent_file_path), None)
def test(self): """Test that options are successfully set with ASan.""" sanitizer.set_options("ASAN", "a=b:c=d") self.assertEqual( "a=b:c=d", adb.read_data_from_file("/data/local/tmp/asan.options")) self.assertEqual(0, self.mock.log_error.call_count)
def test(self): """Test that options are successfully set with ASan.""" sanitizer.set_options('ASAN', 'a=b:c=d') self.assertEqual('a=b:c=d', adb.read_data_from_file('/data/local/tmp/asan.options')) self.assertEqual(0, self.mock.log_error.call_count)
def test_read_data_from_file_and_write_data_to_file(self): """Tests read_data_from_file and write_data_to_file.""" test_file_path = os.path.join(self.device_temp_dir, 'a') self.assertEqual(adb.read_data_from_file(test_file_path), None) adb.write_data_to_file('data', test_file_path) self.assertEqual(adb.read_data_from_file(test_file_path), 'data')