@@ -61,6 +61,7 @@ def setup_workdirs(defined_dir):
61
61
subprocess .check_call ('git clone https://github.com/google/oss-fuzz oss-fuzz' ,
62
62
shell = True ,
63
63
cwd = workdir )
64
+ os .mkdir (os .path .join (workdir , 'oss-fuzz' , 'venv' ))
64
65
65
66
# Clone Fuzz Introspector
66
67
subprocess .check_call ('git clone https://github.com/ossf/fuzz-introspector' ,
@@ -214,7 +215,7 @@ def run_ofg_generation(projects_to_run, workdir, args):
214
215
cmd .append ('http://127.0.0.1:8080/api' )
215
216
cmd .append ('-mr' )
216
217
cmd .append (str (args .max_round ))
217
- if args .agent :
218
+ if args .hg_agent :
218
219
cmd .append ('--agent' )
219
220
220
221
environ = os .environ .copy ()
@@ -443,13 +444,20 @@ def run_analysis(args):
443
444
444
445
oss_fuzz_dir = os .path .join (abs_workdir , 'oss-fuzz-1' )
445
446
target_repositories = runner .extract_target_repositories (args .input )
446
- runner .run_parallels (os .path .abspath (oss_fuzz_dir ),
447
- target_repositories ,
448
- args .model ,
449
- 'all' ,
450
- out_folder ,
451
- parallel_jobs = args .build_jobs ,
452
- max_timeout = args .build_timeout )
447
+ if args .agent :
448
+ # Prepare arguments used deeper in OFG core.
449
+ # TODO(David) make this cleaner.
450
+ args .oss_fuzz = oss_fuzz_dir
451
+ args .work_dirs = 'work_dirs'
452
+ runner .run_agent (target_repositories , args )
453
+ else :
454
+ runner .run_parallels (os .path .abspath (oss_fuzz_dir ),
455
+ target_repositories ,
456
+ args .model ,
457
+ 'all' ,
458
+ out_folder ,
459
+ parallel_jobs = args .build_jobs ,
460
+ max_timeout = args .build_timeout )
453
461
454
462
# Exit if only builds are required.
455
463
if args .build_only :
@@ -487,6 +495,10 @@ def parse_commandline():
487
495
'-a' ,
488
496
help = 'Enable agent workflow' ,
489
497
action = 'store_true' )
498
+ parser .add_argument ('--hg-agent' ,
499
+ '-ha' ,
500
+ help = 'Enable agent harness generation' ,
501
+ action = 'store_true' )
490
502
parser .add_argument ('-gm' ,
491
503
'--generate-benchmarks-max' ,
492
504
help = 'Max targets to generate per benchmark heuristic.' ,
0 commit comments