-
Notifications
You must be signed in to change notification settings - Fork 0
Added the script for issue #156 and edited the yml file to include it #1
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
base: master
Are you sure you want to change the base?
Conversation
|
Description is empty. |
.travis.yml
Outdated
| coverage run --branch --source tlsfuzzer -m unittest discover; | ||
| fi | ||
| - coverage report -m | ||
| - python verify-scripts-json.py |
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'd add a comment line documenting what is this supposed to do, so someone seeing a failure here can understand what he's supposed to fix
verify-scripts-json.py
Outdated
| missing = [] | ||
| missingrns = [] | ||
| tlslite = json.load(open(os.path.join(dir,'tests/tlslite-ng.json'))) | ||
| tlslitern = json.load(open(os.path.join(dir,'tests/tlslite-ng-random-subset.json'))) |
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.
do you need to check here? My understanding is that tlsline-ng.json would have everything, but I haven't really checked
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.
Indeed tlsline-ng.json is only used in travis but according to the issue description "Add script that runs in Travis that will verify that all scripts in scripts/are mentioned at least once in every json file.", so I am not really sure how is it intended to work exactly.
verify-scripts-json.py
Outdated
| missingrns.append(f) | ||
|
|
||
| if not missing and not missingrns: | ||
| print(" All scripts are int the json 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.
typo: are in
verify-scripts-json.py
Outdated
| print("There are " + str(len(missing)) + " scripts that are missing on tlslite-ng.json : ") | ||
| print("\n".join(missing)) | ||
| print("There are " + str(len(missingrns)) + " scripts that are missing on tlslite-ng.json : ".format(len(missingrns))) | ||
| print("\n".join(missingrns)) |
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.
shouldn't this script differentiate between success and failure based on error code? The convention is to return (0) on success and (1) on failure.
Do you have some way to test whether and how does this script work?
.travis.yml
Outdated
| coverage run --branch --source tlsfuzzer -m unittest discover; | ||
| fi | ||
| - coverage report -m | ||
| - python verify-scripts-json.py |
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.
Another improvement could be to simplify the script so that it is run twice, as:
python verify-scripts-json.py tests/tlslite-ng.json
python verify-scripts-json.py tests/tlslite-ng-random-subset.json
Although that seems like a waste it has the advantage that I, for example, can use it to test using another file in my home directory. That's actually a common case as it is expected for one to write such a json file for other implementations than tlslite.
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.
Yes it makes sense, fixed that
16fc628 to
52a8c19
Compare
Added the script for issue #156 and edited the yml file to include it
Description
I have added the script for issue #156 and included it in the yml file.
Motivation and Context
It solves issue #156
Checklist
tlslite-ng.jsonandtlslite-ng-random-subset.json