-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[Fuzz] Add Fuzz testing for RegistryPreview #37607
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
Merged
Merged
Conversation
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
…onefuzz/registrypreview
crutkas
reviewed
Feb 28, 2025
src/modules/registrypreview/RegistryPreview.FuzzTests/RegistryPreview.FuzzTests.csproj
Show resolved
Hide resolved
lei9444
reviewed
Mar 3, 2025
src/modules/registrypreview/RegistryPreview.FuzzTests/FuzzTests.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This reverts commit e8269b8.
zhaopy536
reviewed
Mar 4, 2025
lei9444
approved these changes
Mar 12, 2025
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.
LGTM, Approved with a suggestion
src/modules/registrypreview/RegistryPreview.FuzzTests/FuzzTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: leileizhang <leilzh@microsoft.com>
zhaopy536
approved these changes
Mar 12, 2025
colin-tso
pushed a commit
to colin-tso/PowerToys
that referenced
this pull request
Apr 8, 2025
* Add fuzz test cases * add fuzz tests framework in registrypreview * add registrypreview fuzzing code * add annotations and change net7.0--net8.0 * merge main into code * add registry fuzz sln * change fuzzing tests scope * remove unuse annotations * fix typos * change public parser to internel and private * fix linelower error and modify filenametext to registryContent * Revert "fix linelower error and modify filenametext to registryContent" This reverts commit e8269b8. * add fuzz tests in sln * modify typos * clean code Co-authored-by: leileizhang <leilzh@microsoft.com> * add annotations --------- Co-authored-by: leileizhang <leilzh@microsoft.com>
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.
Summary of the Pull Request
Why we need add fuzz test?
This is a request from the SFI Wave 3, currently set as Priority 2.
In this PR:
Created for RegisrtyPreview using .NET 8 (Windows), focusing on testing CheckKeyLineForBrackets and StripFirstAndLast.
To facilitate fuzz testing of the registry file parsing process, decouple the utility functions CheckKeyLineForBrackets and StripFirstAndLast from the ParseRegistryFile function in RegistryPreviewMainPage.Utilities.cs. Move them to a new ParseHelper.cs and change their access modifiers from private to public.
Added the RegistryPreview.FuzzTests project to RegistryPreview.
Implemented CheckKeyLineForBrackets and FuzzStripFirstAndLast in the RegistryPreview.FuzzTests project.
Connected the ParseHelper.cs file to the FuzzTests project.
The code is being tested using the OneFuzz pipeline.
CheckKeyLineForBrackets

https://onefuzz-ui.microsoft.com/jobs/0e9d3878-3a76-4a73-b2d1-5d5a8b87ace3
StripFirstAndLast

https://onefuzz-ui.microsoft.com/jobs/ac805e56-28b4-45ca-b7bb-f757dab6303e
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed