def _run_introspection(self, runtime='', whitelist=[], verbose=False):
    """ Figure out which objects are opened by a test binary and are matched by the white list. 

    :param runtime: The binary to run. 
    :type runtime: str
    :param whitelist: A list of regular expressions describing acceptable library names
    :type whitelist: [str]    
    """
    found_objects = set()
    try:
      # Retrieve list of successfully opened objects
      strace = subprocess.Popen(['strace', runtime], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
      (_, stderr) = strace.communicate()
      opened_objects = set()
      for line in stderr.split('\n'):
        if 'open' in line and 'ENOENT' not in line:
          start = line.index('"')
          end = line.index('"', start + 1)
          opened_objects.add(line[start + 1:end])

      # filter opened objects through white list.
      for obj in opened_objects:
        for wl in whitelist:
          m = re.match('.*' + wl + '[\..*]?', obj)
          if m:
            found_objects.add(obj)
            if verbose:
              print('Found whitelisted {} at path {}'.format(wl, obj))
            continue
    except Exception as e:
      print e

    return found_objects
def _run_introspection ( self , runtime = '' , whitelist = [ ] , verbose = False ) : found_objects = set ( ) try : strace = subprocess . Popen ( [ 'strace' , runtime ] , stderr = subprocess . PIPE , stdout = subprocess . PIPE ) ( _ , stderr ) = strace . communicate ( ) opened_objects = set ( ) for line in stderr . split ( '\n' ) : if 'open' in line and 'ENOENT' not in line : start = line . index ( '"' ) end = line . index ( '"' , start + 1 ) opened_objects . add ( line [ start + 1 : end ] ) for obj in opened_objects : for wl in whitelist : m = re . match ( '.*' + wl + '[\..*]?' , obj ) if m : found_objects . add ( obj ) if verbose : print ( 'Found whitelisted {} at path {}' . format ( wl , obj ) ) continue except Exception as e : print e return found_objects
Figure out which objects are opened by a test binary and are matched by the white list. 

    :param runtime: The binary to run. 
    :type runtime: str
    :param whitelist: A list of regular expressions describing acceptable library names
    :type whitelist: [str]