def test_installer(args, plugin, config, temp_dir):
 backup = _create_backup(config, temp_dir)
 names_match = (plugin.get_all_names() == plugin.get_all_names_answer())
 if names_match:
  logger.info('get_all_names test succeeded')
 else:
  logger.error('get_all_names test failed for config %s', config)
 domains = list(plugin.get_testable_domain_names())
 success = test_deploy_cert(plugin, temp_dir, domains)
 if (success and args.enhance):
  success = test_enhancements(plugin, domains)
 good_rollback = test_rollback(plugin, config, backup)
 return (names_match and success and good_rollback)

def test_installer ( args , plugin , config , temp_dir ) : backup = _create_backup ( config , temp_dir ) names_match = ( plugin . get_all_names ( ) == plugin . get_all_names_answer ( ) ) if names_match : logger . info ( 'get_all_names test succeeded' ) else : logger . error ( 'get_all_names test failed for config %s' , config ) domains = list ( plugin . get_testable_domain_names ( ) ) success = test_deploy_cert ( plugin , temp_dir , domains ) if ( success and args . enhance ) : success = test_enhancements ( plugin , domains ) good_rollback = test_rollback ( plugin , config , backup ) return ( names_match and success and good_rollback )
tests plugin as an installer .