Stop using assert in validate_config.py #1025
Merged
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.
Status
Ready for review
Description of Changes
Fixes #683.
Here's how to reproduce the
TOB-SDW-024
bug:In sd-dev switch to the
main
branch insecuredrop-workstation
. In dom0, runmake clone
.One of the checks in
validate_config.py
is thatself.config["vmsizes"]["sd_log"]
is an integer. So, in dom0, edit/usr/share/securedrop-workstation-dom0-config/config.json
and makesd_log
a string instead, like this:In dom0, change to
~/securedrop-workstation
and run this to validate the config:It should fail:
Now run it with the
-OO
flag:It will pass when really it should fail -- this is the bug:
Now, switch to this PR's branch and run
make clone
in dom0. This time when you run it with the-OO
flag, it will fail validation like it should: