-
-
Notifications
You must be signed in to change notification settings - Fork 82
Revert to red label while restoring on missing labels #335
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
Conversation
a04f8f7 to
8d771e3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
==========================================
- Coverage 75.68% 75.67% -0.02%
==========================================
Files 52 52
Lines 8975 8977 +2
==========================================
Hits 6793 6793
- Misses 2182 2184 +2 ☔ View full report in Codecov by Sentry. |
5e0974e to
88354e1
Compare
|
I am not certain why codecov has marked those two lines as uncovered. The unittests had to be specifically changed since those two lines were indeed working |
Looks like some backup tests are skipped because |
88354e1 to
bb50a9a
Compare
So what is the appropriate solution here? Is there a way to include |
1913e2b to
d2a242a
Compare
Keep them disabled by default, but allow enabling when needed. For example it's useful for backup tests, to install scrypt tool. Related to QubesOS/qubes-core-admin-client#335
|
Rebase on top of #337 (soon main) |
5f4fbaf to
ddf9898
Compare
OK. Unit tests are green again and looking at Github report, it appears that backupcompatibility tests are not skipped. But the Codecov report is still not covered. Another issue is that the backupcompatibility tests are kinda slow. I believe after this is done, it might be better to disable |
I think you changed label in test in a wrong place. Change it in the qubes.xml, not the parsed structure. |
41ddf2f to
a116092
Compare
|
openQA says it breaks restoring backup using a DispVM: Theoretically the policy could be extended to allow listing labels, but maybe it isn't needed? Maybe instead of check before, you can try setting the label and fallback to "red" in case of |
|
The policy for DispVM restore is in core-admin. But as said above, maybe this extra permission (and also extra call during usual restore) isn't actually needed? |
Unfortunatley it is needed. Unless we want to hard-code the choices of default labels, I do not know any other way to test if the label of the VM to restore is one of them. |
|
Ah, because label is mandatory to create a VM, setting it cannot be deferred to later. I was thinking about something like: try:
vm.label = label
except QubesLabelNotFoundError:
vm.label = "red"but that indeed won't work. And worse - it looks like |
|
There is a less invasive and more privacy friendly way by using |
Should I implement it for core? |
|
Very nice. I will amend this PR and revert to |
|
Now that QubesOS/qubes-core-admin#663 is merged you can update this PR. Or do you want me to push an updated package to current-testing first (doesn't matter for openqa)? |
a116092 to
d8b1c9c
Compare
Very nice. Let's see if this works. What about the unittests? Will they fetch the main branch or use current-testing? |
d8b1c9c to
d34fe89
Compare
|
Ok. It appears that the unittests fail since they depend on |
|
No, unittests do not use real core-admin. There is a mockup that is configured to mimic its behavior. You need to update it to match the change, specifically to return an exception for the call with scarlet label (the one that is now shown in test failure message as unexpected call). |
d34fe89 to
6fc3cd8
Compare
If we allow users to create custom labels and they backup such qubes, restore operation will fail on new systems without those custom labels. Fix this by reverting to red label and allow users to restore their backup. fixes: QubesOS/qubes-issues#9781
6fc3cd8 to
c4940be
Compare
If we allow users to create custom labels and they backup such qubes, restore operation will fail on new systems without those custom labels. Fix this by reverting to red label and allow users to restore their backup.
fixes: QubesOS/qubes-issues#9781