Two more testing improvements#317
Merged
cgwalters merged 2 commits intocomposefs:mainfrom Aug 20, 2024
Merged
Conversation
I had an extra `-` at the end here which was being interpreted as an xattr...It turns out that `mkcomposefs` is liberal here in what it accepts (string parsing in C stinks) and interprets a missing `=` to be an xattr with the provided name, and no value. In this *specific* case that's an xattr with the name `-`. The Rust parser is stricter and rejects this (which I think is a good thing), and this is preparation for doing stronger verification on the Rust side before we start passing data into C. Signed-off-by: Colin Walters <walters@verbum.org>
This way, callers of the Rust API get validation before we start passing things down to the C code. (To be clear, the C code also needs sanity tests, but it's way more reliable to test things on the Rust side) Signed-off-by: Colin Walters <walters@verbum.org>
cgwalters
commented
Aug 19, 2024
| ), | ||
| ( | ||
| "no ftype", | ||
| include_str!("../../../tests/assets/should-fail-no-ftype.dump"), |
Contributor
Author
There was a problem hiding this comment.
Note I didn't need to change the Rust side for this one, it was already strictly validating the mode 🏆
alexlarsson
approved these changes
Aug 20, 2024
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.
tests: Fix extra
-in should-fail testsI had an extra
-at the end here which was being interpretedas an xattr...It turns out that
mkcomposefsis liberal herein what it accepts (string parsing in C stinks) and interprets
a missing
=to be an xattr with the provided name, andno value.
In this specific case that's an xattr with the name
-.The Rust parser is stricter and rejects this (which I think
is a good thing), and this is preparation for doing stronger
verification on the Rust side before we start passing data
into C.
Signed-off-by: Colin Walters walters@verbum.org
rust: Also test we fail to parse the
should-fail-casesThis way, callers of the Rust API get validation before
we start passing things down to the C code.
(To be clear, the C code also needs sanity tests, but
it's way more reliable to test things on the Rust side)
Signed-off-by: Colin Walters walters@verbum.org