Add support for default standalone boot modes#813
Conversation
202d550 to
6b4621c
Compare
|
Tests are missing lines like this in expected calls: |
When a standalone is cloned from a template, the usual default boot mode of the standalone is the same as the boot mode the template originally used. In some instances this is undesirable; Kicksecure for instance puts its templates into a "sysmaint" boot mode that impairs standalone functionality. To fix this, add a new qvm-feature, "boot-mode.standalone-default", which states which boot mode a standalone should be switched to when its root volume is cloned from any other VM. (Note that cloning a standalone from another standalone will switch it to the boot mode specified by "boot-mode.standalone-default", cloning a template isn't the only way to trigger this.) Allows fixing QubesOS/qubes-issues#10514, but does not fix this bug by itself.
6b4621c to
409754f
Compare
|
Fixed. (I noticed the tests failed earlier today and was planning on getting to this, but then forgot, so thank you for the ping :) ) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #813 +/- ##
==========================================
- Coverage 70.47% 70.42% -0.05%
==========================================
Files 61 61
Lines 14139 14156 +17
==========================================
+ Hits 9964 9969 +5
- Misses 4175 4187 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looking at the codecov output, it makes me realize the integration tests I created aren't really comprehensive (they make sure that a normal boot mode transition works, but don't test what happens if the transition isn't possible or what happens when trying to transition to the "default" mode). It's probably worth testing those edge cases too. I can add those tests once I have confirmation that the existing tests look right. |
When a standalone is cloned from a template, the usual default boot mode of the standalone is the same as the boot mode the template originally used. In some instances this is undesirable; Kicksecure for instance puts its templates into a "sysmaint" boot mode that impairs standalone functionality.
To fix this, add a new qvm-feature, "boot-mode.standalone-default", which states which boot mode a standalone should be switched to when its root volume is cloned from any other VM. (Note that cloning a standalone from another standalone will switch it to the boot mode specified by "boot-mode.standalone-default", cloning a template isn't the only way to trigger this.)
Allows fixing QubesOS/qubes-issues#10514, but does not fix this bug by itself.
I've tested the main code of this on my R4.3 machine, and it seems to work. The test code is untested though, and I'd be surprised if the integration tests are actually correct as-is. Note also that I only implemented integration tests for the actual "change boot mode on root volume clone" part of this, since I couldn't figure out how to sanely implement normal tests. Thus coverage.py will probably be unhappy with this.