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

Ghostfat test boards #94

Merged
merged 31 commits into from
Mar 24, 2021
Merged

Conversation

henrygab
Copy link
Collaborator

@henrygab henrygab commented Mar 17, 2021

The goal of this branch is to enable, as part of the normal build process, validation of GhostFat image generation.

  • Create framework to execute own custom test_main() function, using existing code
  • Ensure ghostfat initialization completes prior to calling test_main()
  • Generate disk image file from test_main()
  • Validate bit-for-bit accuracy of disk image file from test_main()
  • Use common framework code for variations of desired file system image
  • Check in known-good file system image(s) to validate against
  • Double-compress known-good disk images
  • Ensure CI catches failures

NOTE: When the ghostfat image that is generated would need to change, such as for a bugfix, then updated versions of the known-good file system images would also need to also be committed.

@henrygab
Copy link
Collaborator Author

henrygab commented Mar 17, 2021

Collapsing to reduce thread length

@hathach -- Can you help with two things?

  1. Getting this to compile in the CI builds
  2. Getting the compiled , and ensuring CI will execute the resulting binary.

Compilation:

On my Ubuntu system, to make the test ports compile requires removing two options from make.mk and rules.mk:

tinyuf2/ports/make.mk

Lines 136 to 137 in 54cff8b

-specs=nosys.specs \
-specs=nano.specs \

LIBS += -lgcc -lm -lnosys -lc

@henrygab henrygab marked this pull request as ready for review March 23, 2021 06:09
@hathach hathach changed the base branch from master to temp March 23, 2021 12:21
@hathach hathach changed the base branch from temp to master March 23, 2021 12:21
@hathach
Copy link
Member

hathach commented Mar 23, 2021

Collapsing to reduce thread length
@hathach -- Can you help with two things?

  1. Getting this to compile in the CI builds
  2. Getting the compiled , and ensuring CI will execute the resulting binary.

Compilation:

On my Ubuntu system, to make the test ports compile requires removing two options from make.mk and rules.mk:

tinyuf2/ports/make.mk

Lines 136 to 137 in 54cff8b

-specs=nosys.specs \
-specs=nano.specs \

LIBS += -lgcc -lm -lnosys -lc

no problems at all, leave that to me. I just resolved the conflict with master and push the update. Give me a bit of time to go through the code. I think I could setup unit tests with CMock/Unity using your tests. That would be easier to run on ci and a bit cleaner look for the ports. Will post more update.

Update: I just realized this is 6 days ago, hmm, the collapsible probably have me miss your message earlier 🤕

@henrygab
Copy link
Collaborator Author

henrygab commented Mar 23, 2021

@hathach -- Yes, it was a few days back. Since then, I got it to work with CI.

So, you can merge as-is, no work, and get GhostFAT validation.

@henrygab
Copy link
Collaborator Author

OK, this is ready for review. See success in checks from commit deae8ca ... listing the four GhostFAT code compiling, comparing against known-good images, and even ignoring the two very narrow exceptions required.

Two exceptions detailed

Two variations allowed from the known good file system:

  1. Contents of UF2_INFO.TXT file will have a variable-length string in the middle that differs for each commit.
  2. The directory entry for UF2_INFO.TXT may indicate a different file size.

The code allows very narrow exceptions with multiple checks, to allow these two differences, without allowing other regressions to fall through.

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant !! Thank you very much for your effort and time put into this PR. Though I still think we should separate the native build from current build system for unit test cmock/unity. I will merge this now and make a follow up PR to decouple the native build. Thank you very much for your awesome work !!!!

@hathach hathach merged commit 633a5d7 into adafruit:master Mar 24, 2021
@hathach hathach mentioned this pull request Mar 24, 2021
@henrygab henrygab requested a review from hathach March 24, 2021 22:43
@henrygab
Copy link
Collaborator Author

Sorry, please ignore this "review request" ... accidental click.

@hathach
Copy link
Member

hathach commented Mar 25, 2021

no problem at all :)

@henrygab henrygab deleted the ghostfat_test_boards branch March 28, 2021 17:35
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