docs: def read_config(config_file=CONFIG_FILE_DEFAULT, override_url=None):
      ''' Read configuration file, perform sanity check and return configuration
          dictionary used by other functions.'''
      config = ConfigParser()
      config.read_dict(DEFAULT_SETTINGS)
  
      try:
          config.readfp(open(config_file))
          logger.debug("Using config file at " + config_file)
      except:
          logger.error(
              "Could not find {0}, running with defaults.".format(config_file))
  
      if not logger.handlers:
          # Before doing anything else, configure logging
          # Handlers might be already registered in repeated test suite runs
          # In production, this should never happen
          if config.getboolean("Logging", "to_file"):
              handler = logging.FileHandler(config.get("Logging", "file"))
          else:
              handler = logging.StreamHandler()
          handler.setFormatter(logging.Formatter(
              config.get("Logging", "format")))
          logger.addHandler(handler)
      logger.setLevel(config.get("Logging", "level"))
  
      if override_url:
          config['Server']['url'] = override_url
  
      return config