-
Notifications
You must be signed in to change notification settings - Fork 47
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 functional RPC policy tests #759
Comments
Relevant to recent move to v2 policy format - we have a basic dom0 test verifying the existence of the policy files, but behaviour should also be checked. |
The RPC policies are defined in this file. Based on reading these, I think I should proceed like this:
So given that, I should write the following tests:
I'm curious if anyone has feedback on this plan. |
My initial impression is that we should probably focus our testing on securedrop.Log and securedrop.Proxy, which are our custom RPC policies, and not worry too much about writing tests for upstream policies, unless it's in the context of overall automating of functional testing/acceptance testing of the workstation. Also, since we've just moved our rpc policy files to take precedence over the !compat files, we have less to worry about than when we filed this issue, in terms of simpler rules and everything being defined in one file. |
I believe the GPG RPC stuff will still prompt (something like "Do you allow X VM to access your GPG keys?")
We'll be removing these rules shortly once freedomofpress/securedrop-client#1718 lands, so I think you can skip testing them (also a good reminder that these rules exist, I'll file a cleanup task). |
I've started implementing these tests. Rather than confirming that e.g. So given that, I think it's fine to just ensure that the upstream policy rules still allow/deny when they should.
Ah good point. Maybe I will just test the deny rule (which should just deny without a popup) but not test the allow rules. And if the |
Would it make sense to move to pytest first (see #998)? It seems like the tests you're describing would be more manageable if you could parametrize them. |
In an ideal world yes, but pytest is more of a struggle than I anticipated, so I wouldn't block any work on it. |
This was simpler to implement than I thought it would be. Just made a PR! |
Our current RPC policy tests only test whether the policy files match the expected content, not whether they have the expected effect. We should test actual behavior, especially in light of the changes in Qubes 4.1/#751 which add significant complexity to the RPC policy behavior (two different formats, precedence rules between them).
The text was updated successfully, but these errors were encountered: