fuzzer: add a cargo-bolero fuzz target type#33
Open
Ekleog wants to merge 1 commit intoNear-One:masterfrom
Open
fuzzer: add a cargo-bolero fuzz target type#33Ekleog wants to merge 1 commit intoNear-One:masterfrom
Ekleog wants to merge 1 commit intoNear-One:masterfrom
Conversation
Contributor
Author
|
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
Contributor
|
Didn’t notice this PR. Is this still a thing? |
Contributor
|
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 :) |
mina86
reviewed
Aug 18, 2022
Comment on lines
+507
to
+541
| 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, | ||
| ) |
Contributor
There was a problem hiding this comment.
Alternatively:
Suggested change
| 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, | |
| ) |
mina86
approved these changes
Aug 18, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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