tools/ipc_fuzzer/scripts/utils.py
def create_flags_file(ipcdump_testcase_path):
  """Create a flags file to add launch prefix to application command line."""
  prefixes = (UNCOMMON_LAUNCH_PREFIXES if
              random.randint(1, UNCOMMON_PREFIX_CHANCE) == 1 else
              COMMON_LAUNCH_PREFIXES)
  random_launch_prefix = random.choice(prefixes)
  application_name = application_name_for_platform(IPC_REPLAY_APPLICATION)
  file_content = '%s=%%APP_DIR%%%s%s' % (random_launch_prefix, os.path.sep,
                                         application_name)

  flags_file_path = ipcdump_testcase_path.replace(FUZZ_PREFIX, FLAGS_PREFIX)
  file_handle = open(flags_file_path, 'w')
  file_handle.write(file_content)
  file_handle.close()
Create a flags file to add launch prefix to application command line.
Create a flags file to add launch prefix to application command line.
Create a flags file to add launch prefix to application command line .
def create_flags_file(ipcdump_testcase_path):
  prefixes = (UNCOMMON_LAUNCH_PREFIXES if
              random.randint(1, UNCOMMON_PREFIX_CHANCE) == 1 else
              COMMON_LAUNCH_PREFIXES)
  random_launch_prefix = random.choice(prefixes)
  application_name = application_name_for_platform(IPC_REPLAY_APPLICATION)
  file_content = '%s=%%APP_DIR%%%s%s' % (random_launch_prefix, os.path.sep,
                                         application_name)
  flags_file_path = ipcdump_testcase_path.replace(FUZZ_PREFIX, FLAGS_PREFIX)
  file_handle = open(flags_file_path, 'w')
  file_handle.write(file_content)
  file_handle.close()
def create_flags_file ( ipcdump_testcase_path ) : prefixes = ( UNCOMMON_LAUNCH_PREFIXES if random . randint ( 1 , UNCOMMON_PREFIX_CHANCE ) == 1 else COMMON_LAUNCH_PREFIXES ) random_launch_prefix = random . choice ( prefixes ) application_name = application_name_for_platform ( IPC_REPLAY_APPLICATION ) file_content = '%s=%%APP_DIR%%%s%s' % ( random_launch_prefix , os . path . sep , application_name ) flags_file_path = ipcdump_testcase_path . replace ( FUZZ_PREFIX , FLAGS_PREFIX ) file_handle = open ( flags_file_path , 'w' ) file_handle . write ( file_content ) file_handle . close ( )
Create a flags file to add launch prefix to application command line.
Create a flags file to add launch prefix to application command line .
"""Create a flags file to add launch prefix to application command line."""
ipcdump_testcase_path