-
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
Re-enables paxtest in testinfra #5848
Conversation
In the spirit of "leave no trace," the script wrapping pytest ( |
Seemed to work as expected in #5609 (comment), agree that it'd be nice to automatically uninstall paxtest in the cleanup function after it's done. |
62a7fa7
to
b7e051c
Compare
Rebased on latest develop. I added a commit to clean up the package afterwards. Didn't use the bash trap, since that required futzing with Ansible outside of our wrappers within the Tails environment. Instead, I just used a try/finally block in the test itself. End result is the same: after test run, regardless of whether the paxtest failed or not, the package will be removed. Ready for re-review. |
b7e051c
to
3f0bd46
Compare
(Kicking CI) |
3f0bd46
to
6ddc535
Compare
Rebased on top of latest develop, to satisfy CI. |
Fails on a fresh install, as the apt cache has not been updated with |
if not host.exists("/usr/bin/paxtest"): | ||
warnings.warn("Installing paxtest to run kernel tests") | ||
with host.sudo(): | ||
host.run("apt-get install -y paxtest") |
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.
Assumes that paxtest is available via apt - which may not be the case until apt-get update
has run at least once on the host. Running apt get update && apt-get install -y paxtest
would work.
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.
Added!
6ddc535
to
1630a05
Compare
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.
One final tweak needed to remove the paxtest package post-run...
paxtest_results.split('\n')): | ||
print(paxtest_diff) | ||
assert paxtest_results == paxtest_expected | ||
finally: |
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.
Paxtest isn't removed in this finally clause, it needs sudo
.
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.
Good catch! Fixed.
These tests were skipped because we weren't installing paxtest by default. Let's just install it as part of the test run. Removes the skip-in-prod marker, so that these checks can be used as part of QA on hardware. Updates the logic to be distro-specific. Removes paxtest after test run We don't install it by default, and it's only useful in QA, so let's have the test-only dependency automatically cleaned up after install.
1630a05
to
14ea71e
Compare
Status
Ready for review
Description of Changes
Fixes #1039
These tests were skipped because we weren't installing paxtest by
default. Let's just install it as part of the test run. Removes
the skip-in-prod marker, so that these checks can be used as part of QA
on hardware. Updates the logic to be distro-specific.
Testing
CI should be passing on both platforms.
Try to run against hardware, or at least prodVMs, via the
./securedrop-admin verify
workflow.Are we OK with installing
paxtest
automatically via tests? I'd think so, given that we do it manually as part of QA anyway.Deployment
Mostly QA, so developer-focused. Technically if an Admin runs
./securedrop-admin verify
, the remote state will change becausepaxtest
will be installed now. That's acceptable, IMO, since otherwise the paxtest checks would have been skipped.Checklist