Skip to content

Commit

Permalink
runner: make download-corpus work (#639)
Browse files Browse the repository at this point in the history
Fixes
```
python3 ../runner.py download-corpus avahi
Traceback (most recent call last):
  File "/home/vagrant/fuzz-introspector/oss_fuzz_integration/oss-fuzz/../runner.py", line 652, in <module>
    download_full_public_corpus(args.project)
TypeError: download_full_public_corpus() missing 1 required positional argument: 'target_corpus_dir'
```

It also makes it possible to download corpora to specific directories by
passing --corpus-dir=...

Signed-off-by: Evgeny Vereshchagin <[email protected]>

Signed-off-by: Evgeny Vereshchagin <[email protected]>
  • Loading branch information
evverx authored Nov 28, 2022
1 parent ac09426 commit 891bcbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions oss_fuzz_integration/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def download_full_public_corpus(project_name, target_corpus_dir: None):
download_public_corpus(project_name, fuzzer, f"corpus-{project_name}-{fuzzer}.zip")

if not target_corpus_dir:
target_corpus_dir = "mycorpus"
target_corpus_dir = f"{project_name}-corpus"

if not os.path.isdir(target_corpus_dir):
os.mkdir(target_corpus_dir)
Expand Down Expand Up @@ -617,6 +617,12 @@ def get_cmdline_parser() -> argparse.ArgumentParser:
"project",
help="name of project"
)
download_corpus_parser.add_argument(
"--corpus-dir",
type=str,
help="directory with corpus for the project",
default=None
)
return parser

if __name__ == "__main__":
Expand Down Expand Up @@ -649,4 +655,4 @@ def get_cmdline_parser() -> argparse.ArgumentParser:
not args.no_coverage
)
elif args.command == "download-corpus":
download_full_public_corpus(args.project)
download_full_public_corpus(args.project, args.corpus_dir)

0 comments on commit 891bcbb

Please sign in to comment.