-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add regenerate data files tests #7866
base: development
Are you sure you want to change the base?
Add regenerate data files tests #7866
Conversation
d745ebe
to
b16e5ba
Compare
Context: the directory
The goal of this pull request is to validate that the instructions in the Makefile are correct. At the moment, nothing in the CI uses the Makefile. |
component_test_regenerate_data_files_default () { | ||
helper_regenerate_data_files neat | ||
scripts/config.py full | ||
helper_datafile_run_tests "default configuration with refreshed data files" |
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.
I don't think this is a good approach for checking that the new files are good. We're checking that the tests pass, but that doesn't mean, but that doesn't mean that the tests do the same thing.
I would prefer a more reliable approach: compare the new files with the old files, using a comparison method that ignores some parts of the files (content of keys, signatures and hashes), comparing only the ASN.1 structure, the metadata that isn't derived from random data (names, serial numbers, etc.), and whether signatures are correct. It will take us some time to do it, but I think the benefits are worth it.
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.
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.
Understood. I will remove them later.
And I'd like reserve helper_datafile_run_tests
as local test utility. I will move it to another scripts.
For non-ASN.1 files and malformed files, how to compare them ? Do you have any idea?
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.
For files without a valid ASN.1 structure, I don't have a plan to compare. Hopefully we won't need to regenerate those often.
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.
I post those tests in this PR and reduce the scope of this PR.
About the compare script, I'd like write it in next PR. I think the script should only compare modified files. I have add TODO
tag in regenerate_data_files_tests.sh
. Please check it.
I limit openssl version to 3.0.2. I think it can generate all files. And I will fix miss or wrong commands in #7888.
7893044
to
c613aa3
Compare
f790c75
to
c4d8823
Compare
Still reviewing, accidentally pushed the button
I would need some more explanation: If "The goal of this pull request is to validate that the instructions in the Makefile are correct", how are we doing this on this PR? |
46fdd7b
to
2cc372f
Compare
rebase to resolve conflicts |
2cc372f
to
ea0827a
Compare
The components will remove all files, regenerate and check if there are files that is missed or not committed. In future, we should check modified files are expected. Signed-off-by: Jerry Yu <[email protected]>
And set openssl to 3.0.2 Signed-off-by: Jerry Yu <[email protected]>
- change neat target also. Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
This is for regenerate all parse input files Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Those files are not commited and list in `all_intermediate` and remove invalid final file Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
The file is used by x509_cert_ino and verified with expected output Signed-off-by: Jerry Yu <[email protected]>
- reserved list includes files that used as command input - uncategoried includes files that commands fail or not covered and should be resolved in future Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
Signed-off-by: Jerry Yu <[email protected]>
a8feae9
to
52ff195
Compare
Description
This PR try to guarantee
tests/data_files
are generated and there is no missed or un-tracked files in final output.At this moment, there are still some wrong commands or no generate commands available. Those files are list with
uncategorized.lst
. And this PR will ignore those files.Some commands are fixed in this file due to it can not be covered by
uncategorized.lst
.#7649 and #7662 fix some wrong commands.
find_missed.py is for finding missed commands
test_new_data_files.sh is for local test.