Skip to content
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

Closes #250: fat32 8.3 lowercase names, make fs.OpenFile case insensitive for 8.3 and long filenames #251

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

jsando
Copy link
Contributor

@jsando jsando commented Aug 31, 2024

Let me know if any changes are required.

I wasn't sure if adding another 10MB fat32 image built with mtools was the best way to go for the unit tests but was a little confused when I tried to add it to the existing fat32.img file, it seems that file is not built by the shell script in the same folder.

@deitch
Copy link
Collaborator

deitch commented Sep 1, 2024

I wasn't sure if adding another 10MB fat32 image built with mtools was the best way to go for the unit tests

You are right, it isn't, we should just expand the existing image with some more entries to test these.

but was a little confused when I tried to add it to the existing fat32.img file, it seems that file is not built by the shell script in the same folder.

Yeah. The script to generate it is inline in the testdata/README.md. I had meant to have the script generate it. The problem is that the tests then fail. It is highly sensitive to it, and each regeneration ends up requiring modifying the tests. If you look at ext4, in contrast, it uses standard CLI tools to extract information about the filesystem, and the tests consume those as the expected value. It was not as easy to do with fat32. Maybe I will try, see if I can get it to work.

@deitch
Copy link
Collaborator

deitch commented Sep 1, 2024

Yeah, I am getting somewhere. Hang tight.

@deitch
Copy link
Collaborator

deitch commented Sep 2, 2024

Done. @jsando rebase on latest, please. The entire fat32.img now is auto-generated with tests, very similar to what I did with ext4. It uses standard tools to inspect it, and then the tests read those outputs to compare with its own values. Works quite well.

You should be able to modify mkfat32.sh as you need.

fix: fat32 fs.OpenFile should be case-insensitive for both 8.3 and long filenames
@jsando
Copy link
Contributor Author

jsando commented Sep 2, 2024

Rebased and pushed. That was a nice change you did to delete the fat32 test image from git and generate it as part of the build.

Also I saw your comment on the ticket, I will add more information.

@deitch
Copy link
Collaborator

deitch commented Sep 3, 2024

That was a nice change you did to delete the fat32 test image from git and generate it as part of the build.

Yeah, it makes things much easier. When initially creating this, you go for easy, or not too much additional effort. At a certain point, the effort of changing all of your fixed test structures because you regenerated one test file becomes too much. Too most of a day, but done.

I like this. The tests are easy to read and understand.

@deitch
Copy link
Collaborator

deitch commented Sep 3, 2024

Let CI run, and when clean, we can let it in.

@deitch deitch merged commit 183295d into diskfs:master Sep 3, 2024
20 checks passed
@deitch
Copy link
Collaborator

deitch commented Sep 3, 2024

And in. Thank you for finding and fixing this.

@deitch
Copy link
Collaborator

deitch commented Sep 3, 2024

I am most curious to know where you are using this. I will drop an email line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants