-
Notifications
You must be signed in to change notification settings - Fork 687
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
Updated testinfra tests to optionally run against a prod instance #5318
Updated testinfra tests to optionally run against a prod instance #5318
Conversation
99de0fa
to
eb703f0
Compare
44829c8
to
2988455
Compare
ba5460f
to
411f743
Compare
4316b22
to
fcf3f49
Compare
Note: |
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.
- testinfra tests complete without error
This works, I could not finish up the prod testing thanks to tails.
I'm not 100% into adding the test dependencies in the regular setup step, as they're not required for securedrop-admin, so they're going to make that step longer for users for a start. But yeah it's a bit of a pain. At least it's faster on repeated runs (assuming the virtualenv wasn't nuked in between). What problem did you hit with Tails and prod? |
fcf3f49
to
a08a96a
Compare
flipped back to draft to allow for some updates |
6da5b82
to
eea01e0
Compare
30bfebb
to
0c7de91
Compare
…grsec kernel string
874c6e3
to
9eb2cdb
Compare
Have addressed @kushaldas's point above by adding a new requirements file including testinfra deps that can optionally be installed at setup (using the |
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.
Changes look great! Confirmed staging is unaffected (CI appears happy, as well). For testing the Tails behavior, I didn't use prod HW, rather prod VMs. The IP addresses for the vagrant environment were different from the HW defaults, and those failures were reported in the testinfra run, as expected. Everything else passed.
Also confirmed that the virtualenv only installs testinfra if the -t
flag is passed to the setup
subcommand. Only question I have is given that
Also working around some remaining issues with iptables tests by suppressing the test in prod
there might be a bit of leftover prod iptables info in the diff, that's now unused. Even if that's the case, I wouldn't be opposed to merging, if it's partial progress toward full coverage.
@kushaldas It'd be great to have your approval on here too, since you performed active review previously! |
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.
Went through all the test steps (used prod vms), this looks good to me. 💯
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.
Thanks @zenmonkeykstop for your hard work on these changes, this is very exciting and these changes will be of great help with the upcoming release testing.
Took one last pass through the test plan, all tests are passing with the exception of (3) tests for IP addresses related to OSSEC (using non-standard IP addresses, so this is expected, we can always follow-up later).
# | ||
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements-testinfra.txt requirements-ansible.in requirements-testinfra.in requirements.in | ||
# | ||
ansible==2.9.7 \ |
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.
Noting for posterity that the versions of cffi, cryptography, jinja and others are different from the ones locked in develop-requirements.txt
and admin/requirements.txt
. Given that the changes here work, and that this is exclusively used for testing, we can always update the other requirements files at a later date.
A good future improvement against this would be to have |
Status
Ready for Review
Description of Changes
Fixes #4216
Updates testinfra tests to allow them to be run against a production SecureDrop hardware instance from an Admin Workstation.
Testing
Verify staging unchanged:
test against prod hardware (assuming default IPs, DNS settings, and both v2 and v3 services enabled):
on the admin workstation for a previously configured instance,
cd ~/Persistent/securedrop
and check out this branchrun
./securedrop-admin setup -t
to installtestinfra
dependenciesrun
./securedrop-admin verify
remove the test dependencies with
rm -rf ~/Persistent/securedrop/admin/.venv3
run
./securedrop-admin setup
to install vanilla dependenciesverify
testinfra
module not installed with:Deployment
No special requirements for deployment
Checklist
because securedrop-admin changes:
make -C admin test
passing locally.If you made non-trivial code changes: