Update fuzzing test to check for simpleguest in same directory as executable - #324
Merged
marosset merged 4 commits intoMar 6, 2025
Merged
Conversation
marosset
marked this pull request as ready for review
March 4, 2025 20:01
marosset
force-pushed
the
get-simple-guest-for-fuzzing
branch
from
March 4, 2025 20:09
9564dc0 to
001a36d
Compare
Contributor
There was a problem hiding this comment.
PR Overview
This PR enhances the fuzzing test by updating the mechanism for locating the simple guest binary. Key changes include:
- Introducing simple_guest_for_fuzzing_as_string to try locating the guest binary in the same directory as the executable.
- Falling back to the existing simple_guest_as_string method if the binary isn’t found.
- Updating the fuzz target to use the new function.
Reviewed Changes
| File | Description |
|---|---|
| src/hyperlight_testing/src/lib.rs | Added simple_guest_for_fuzzing_as_string using env::current_exe to locate the guest binary at runtime. |
| src/hyperlight_host/fuzz/fuzz_targets/fuzz_target_1.rs | Updated fuzz target to obtain the guest binary via simple_guest_for_fuzzing_as_string. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/hyperlight_testing/src/lib.rs:2
- The function call to 'rust_guest_as_pathbuf' in simple_guest_as_string is inconsistent with the earlier defined 'c_guest_as_pathbuf'. Please confirm if this discrepancy is intentional or update for naming consistency.
let buf = rust_guest_as_pathbuf("simpleguest");
ludfjig
previously approved these changes
Mar 4, 2025
marosset
force-pushed
the
get-simple-guest-for-fuzzing
branch
2 times, most recently
from
March 4, 2025 20:29
a2033ea to
bd1b172
Compare
ludfjig
previously approved these changes
Mar 4, 2025
marosset
force-pushed
the
get-simple-guest-for-fuzzing
branch
from
March 6, 2025 19:42
9eba2da to
f11169f
Compare
ludfjig
previously approved these changes
Mar 6, 2025
marosset
force-pushed
the
get-simple-guest-for-fuzzing
branch
2 times, most recently
from
March 6, 2025 19:58
4c16bbf to
a9c5f22
Compare
Signed-off-by: Mark Rossett <marosset@microsoft.com>
Signed-off-by: Mark Rossett <marosset@microsoft.com>
Signed-off-by: Mark Rossett <marosset@microsoft.com>
marosset
force-pushed
the
get-simple-guest-for-fuzzing
branch
from
March 6, 2025 21:13
a9c5f22 to
20b6949
Compare
Contributor
There was a problem hiding this comment.
PR Overview
This PR updates the fuzzing tests to ensure that the guest binary (simpleguest) is located in the same directory as the fuzzing executable, and it adjusts various configuration files to align with the new naming conventions. Key changes include:
- Adding a new function in lib.rs to prefer a local guest binary during fuzzing.
- Updating references across fuzz targets to use the new function and binary names.
- Modifying workflow and Cargo.toml configurations to reflect updated target names.
Reviewed Changes
| File | Description |
|---|---|
| src/hyperlight_testing/src/lib.rs | Introduced simple_guest_for_fuzzing_as_string to locate the guest binary |
| .github/workflows/ValidatePullRequest.yml | Updated target names for fuzzing |
| .github/workflows/Fuzzing.yml | Updated target names for fuzzing |
| fuzz/fuzz_targets/*.rs | Replaced usage of simple_guest_as_string with new function usage |
| fuzz/Cargo.toml | Renamed binaries to include fuzz_ prefix |
| fuzz/README.md | Updated command examples to reflect new binary names |
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/hyperlight_testing/src/lib.rs:149
- [nitpick] The error message 'Invalid path string' could be more descriptive by including contextual information about the path conversion failure.
.ok_or(anyhow("Invalid path string"))?
ludfjig
approved these changes
Mar 6, 2025
danbugs
approved these changes
Mar 6, 2025
marosset
enabled auto-merge (squash)
March 6, 2025 22:38
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.
Some fuzzing scenarios we want to report require building a fuzzing binary with
cargo fuzz buildand submitting that binary to a fuzzing harness. In those instances we also want to submit a guestbinary and this PR makes sure that the guestbinary can be found in the same directory as the fuzzing binary.