Ejemplo n.º 1
0
def update_weight_for_target(fuzz_target_name, job, match):
    """Set the weight for a particular target."""
    target_job = data_handler.get_fuzz_target_job(fuzz_target_name, job)

    if not target_job:
        # Bail out. This is expected if any fuzzer/job combinations become outdated.
        return

    weight = match.new_weight
    logs.log('Adjusted weight to %f for target %s and job %s (%s).' %
             (weight, fuzz_target_name, job, match.reason))

    target_job.weight = weight
    target_job.put()
Ejemplo n.º 2
0
def update_weight_for_target(fuzz_target_name, job, match):
    """Set the weight for a particular target."""
    target_job = data_handler.get_fuzz_target_job(fuzz_target_name, job)

    if not target_job:
        logs.log_error(
            'FuzzTargetJob for target %s and job %s does not exist.' %
            (fuzz_target_name, job))
        return

    weight = match.new_weight
    logs.log('Adjusted weight to %f for target %s and job %s (%s).' %
             (weight, fuzz_target_name, job, match.reason))

    target_job.weight = weight
    target_job.put()
Ejemplo n.º 3
0
def update_weight_for_target(fuzz_target_name, job, specification):
    """Set the weight for a paritcular target."""
    target_job = data_handler.get_fuzz_target_job(fuzz_target_name, job)

    if not target_job:
        logs.log_error(
            'FuzzTargetJob for target %s and job %s does not exist.' %
            (fuzz_target_name, job))
        return

    weight = specification.adjusted_weight
    logs.log('Adjusted weight to %f for target %s and job %s (%s).' %
             (weight, fuzz_target_name, job, specification.reason))
    monitoring_metrics.WEIGHT_ADJUSTMENT.increment(
        {'reason': specification.reason})
    target_job.weight = weight
    target_job.put()