-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fuzzer: add a cargo-bolero fuzz target type #33
base: master
Are you sure you want to change the base?
Conversation
I have now tested it on one worker (worker2), and can confirm that the current fuzzers seem to still work well with this change. |
57fcdaf
to
0b2d8da
Compare
Didn’t notice this PR. Is this still a thing? |
Yup it is! I have deployed it only on worker2 for now and am planning on checking it actually works well with cargo-bolero fuzz targets too before proceeding with deployment, but it can already be reviewed and should undergo only minor changes on the cargo-bolero branch of the if :) |
if self.target.get('type') == 'bolero': | ||
self.proc = subprocess.Popen( | ||
[ | ||
'cargo', | ||
'bolero', | ||
'test', | ||
'--fake-nightly-toolchain', | ||
f'--corpus-dir={corpus.corpus_for(self.target)}', | ||
f'--crashes-dir={corpus.artifacts_for(self.target)}', | ||
'-p', | ||
self.target['crate'], | ||
self.target['runner'], | ||
] + [f'--engine-args="{flag}"' for flag in flags], | ||
cwd = self.repo_dir, | ||
start_new_session = True, | ||
stdout = self.log_file, | ||
stderr = subprocess.STDOUT, | ||
) | ||
else: | ||
self.proc = subprocess.Popen( # pylint: disable=consider-using-with | ||
[ | ||
'cargo', | ||
'fuzz', | ||
'run', | ||
self.target['runner'], | ||
'--', | ||
str(corpus.corpus_for(self.target)), | ||
str(corpus.artifacts_for(self.target)), | ||
f'-artifact_prefix={corpus.artifacts_for(self.target)}/', | ||
] + flags, | ||
cwd=self.repo_dir / self.target['crate'], | ||
start_new_session=True, | ||
stdout=self.log_file, | ||
stderr=subprocess.STDOUT, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
if self.target.get('type') == 'bolero': | |
self.proc = subprocess.Popen( | |
[ | |
'cargo', | |
'bolero', | |
'test', | |
'--fake-nightly-toolchain', | |
f'--corpus-dir={corpus.corpus_for(self.target)}', | |
f'--crashes-dir={corpus.artifacts_for(self.target)}', | |
'-p', | |
self.target['crate'], | |
self.target['runner'], | |
] + [f'--engine-args="{flag}"' for flag in flags], | |
cwd = self.repo_dir, | |
start_new_session = True, | |
stdout = self.log_file, | |
stderr = subprocess.STDOUT, | |
) | |
else: | |
self.proc = subprocess.Popen( # pylint: disable=consider-using-with | |
[ | |
'cargo', | |
'fuzz', | |
'run', | |
self.target['runner'], | |
'--', | |
str(corpus.corpus_for(self.target)), | |
str(corpus.artifacts_for(self.target)), | |
f'-artifact_prefix={corpus.artifacts_for(self.target)}/', | |
] + flags, | |
cwd=self.repo_dir / self.target['crate'], | |
start_new_session=True, | |
stdout=self.log_file, | |
stderr=subprocess.STDOUT, | |
) | |
if self.target.get('type') == 'bolero': | |
cmd = [ | |
'cargo', | |
'bolero', | |
'test', | |
'--fake-nightly-toolchain', | |
f'--corpus-dir={corpus.corpus_for(self.target)}', | |
f'--crashes-dir={corpus.artifacts_for(self.target)}', | |
'-p', | |
self.target['crate'], | |
self.target['runner'], | |
] + [f'--engine-args="{flag}"' for flag in flags] | |
cwd = self.repo_dir | |
else: | |
cmd = [ | |
'cargo', | |
'fuzz', | |
'run', | |
self.target['runner'], | |
'--', | |
str(corpus.corpus_for(self.target)), | |
str(corpus.artifacts_for(self.target)), | |
f'-artifact_prefix={corpus.artifacts_for(self.target)}/', | |
] + flags | |
cwd = self.repo_dir / self.target['crate'] | |
self.proc = subprocess.Popen( # pylint: disable=consider-using-with | |
cmd, | |
cwd=cwd, | |
start_new_session=True, | |
stdout=self.log_file, | |
stderr=subprocess.STDOUT, | |
) |
This is untested yet, but I'm opening before doing a try-deploy on one of the nayduck machines so there's a trace of what's being deployed