diff --git a/accounts/apps.py b/accounts/apps.py index 2358bd20..eb6a7d58 100644 --- a/accounts/apps.py +++ b/accounts/apps.py @@ -53,7 +53,7 @@ def _store_generated_password(password): """ Write the generated admin password to data/admin_password (mode 0600) instead of printing it, so it does not end up in install logs or - `docker logs` (ROADMAP O-02). Abort provisioning if private storage fails. + `docker logs`. Abort provisioning if private storage fails. """ path = admin_password_path() try: diff --git a/accounts/test_admin_email_otp.py b/accounts/test_admin_email_otp.py index 1ade4005..1cb139e1 100644 --- a/accounts/test_admin_email_otp.py +++ b/accounts/test_admin_email_otp.py @@ -6,7 +6,7 @@ from django.urls import reverse class AdminEmailOtpTestCase(TestCase): - """ROADMAP S-11: sending the OTP QR code by email must not happen on GET.""" + """Sending the OTP QR code by email must not happen on GET.""" def setUp(self): User = get_user_model() diff --git a/accounts/test_admin_password.py b/accounts/test_admin_password.py index a6c21639..7b64ce7f 100644 --- a/accounts/test_admin_password.py +++ b/accounts/test_admin_password.py @@ -1,4 +1,4 @@ -"""ROADMAP O-02: the generated admin password must not be printed to the log.""" +"""The generated admin password must not be printed to the log.""" import io import os import stat diff --git a/accounts/test_first_login_password.py b/accounts/test_first_login_password.py index 132e5ced..a547f8ea 100644 --- a/accounts/test_first_login_password.py +++ b/accounts/test_first_login_password.py @@ -1,4 +1,4 @@ -"""ROADMAP O-17: the generated admin password must be replaced at first login.""" +"""The generated admin password must be replaced at first login.""" import tempfile from pathlib import Path diff --git a/computes/test_ownership.py b/computes/test_ownership.py index e7d58f3b..1cbe07f6 100644 --- a/computes/test_ownership.py +++ b/computes/test_ownership.py @@ -1,4 +1,4 @@ -"""R-05: ownership survives a VM's temporary disappearance or an out-of-band move.""" +"""Ownership survives a VM's temporary disappearance or an out-of-band move.""" from datetime import timedelta from unittest.mock import MagicMock diff --git a/computes/urls.py b/computes/urls.py index 00588c01..80732d50 100644 --- a/computes/urls.py +++ b/computes/urls.py @@ -13,7 +13,7 @@ from . import forms, views def superuser_only_patterns(patterns): """ Wrap every view below these patterns with superuser_only. Everything under - /computes/ is host administration (ROADMAP S-10), so the check is applied + /computes/ is host administration, so the check is applied to the whole namespace instead of per view, and a view added here later cannot be exposed by forgetting a decorator. """ diff --git a/computes/utils.py b/computes/utils.py index 96f3f28b..c08722f2 100644 --- a/computes/utils.py +++ b/computes/utils.py @@ -207,7 +207,7 @@ def refresh_instance_database(compute): Libvirt is the single source of truth: - VMs removed in virt-manager/virsh are deleted from the database; their ownership is moved to the same UUID on another compute or kept in a - tombstone for INSTANCE_OWNERSHIP_RETENTION_DAYS (R-05). + tombstone for INSTANCE_OWNERSHIP_RETENTION_DAYS. - VMs created in virt-manager/virsh are added to the database. - VMs renamed in virt-manager/virsh have their name updated without losing UserInstance permission relationships (matched by UUID). @@ -265,7 +265,7 @@ def refresh_instance_database(compute): # 2. Instances gone from this compute. Their ownership goes to the # same UUID on another compute (an out-of-band move) or is kept - # in a tombstone in case the VM comes back (R-05). + # in a tombstone in case the VM comes back. for inst in db_instances: if inst.uuid not in host_domains: elsewhere = Instance.objects.filter(uuid=inst.uuid).exclude(compute=compute).first() diff --git a/conf/daemon/gstfsd b/conf/daemon/gstfsd index cf5c4136..bf1a3754 100644 --- a/conf/daemon/gstfsd +++ b/conf/daemon/gstfsd @@ -24,7 +24,7 @@ def is_loopback(host): # gstfsd is an unauthenticated root service that rewrites any VM's # /etc/shadow and authorized_keys, so it only listens on loopback unless -# explicitly allowed (ROADMAP S-08). +# explicitly allowed. if not is_loopback(ADDRESS) and os.environ.get("GSTFSD_ALLOW_REMOTE") != "1": sys.stderr.write( "gstfsd: refusing to listen on %s (unauthenticated root service). " diff --git a/console/socketiod b/console/socketiod index ecc93fdb..41c132e2 100755 --- a/console/socketiod +++ b/console/socketiod @@ -19,7 +19,7 @@ django.setup() from django.conf import settings as django_settings -# socketiod does not authenticate connections yet (ROADMAP S-01): any client +# socketiod does not authenticate connections yet: any client # that can reach the port can read and write an open serial console. Refuse # to start unless an admin explicitly opts in. if not getattr(django_settings, "SERIAL_CONSOLE_ENABLED", False): diff --git a/console/test_socketiod_disabled.py b/console/test_socketiod_disabled.py index d28619d6..5e986628 100644 --- a/console/test_socketiod_disabled.py +++ b/console/test_socketiod_disabled.py @@ -11,7 +11,7 @@ SOCKETIOD = ROOT / "console" / "socketiod" class SocketiodDisabledTestCase(unittest.TestCase): - """ROADMAP S-01: socketiod must refuse to start unless explicitly enabled.""" + """socketiod must refuse to start unless explicitly enabled.""" def test_socketiod_exits_when_serial_console_disabled(self): # The settings module lives in a temporary directory, so the test does diff --git a/console/tests.py b/console/tests.py index 5181e9d0..68d959cf 100644 --- a/console/tests.py +++ b/console/tests.py @@ -140,7 +140,7 @@ class ConsoleViewsTestCase(TestCase): @override_settings(SERIAL_CONSOLE_ENABLED=False) @patch("console.views.wvmInstance") def test_console_pty_refused_when_serial_console_disabled(self, mock_wvm): - # ROADMAP S-01: socketiod is unauthenticated, so the serial console is + # socketiod is unauthenticated, so the serial console is # disabled unless an admin explicitly enables it. mock_conn = MagicMock() mock_conn.get_console_type.return_value = "pty" @@ -194,7 +194,7 @@ class ConsoleViewsTestCase(TestCase): @patch("console.views.wvmInstance") def test_console_token_cookie_flags(self, mock_wvm): - # ROADMAP S-11: the token cookie is only read by novncd, never by JS. + # The token cookie is only read by novncd, never by JS. mock_conn = MagicMock() mock_conn.get_console_type.return_value = "vnc" mock_conn.get_console_websocket_port.return_value = None @@ -209,7 +209,7 @@ class ConsoleViewsTestCase(TestCase): @patch("console.views.wvmInstance") def test_console_view_instances_perm_does_not_open_console(self, mock_wvm): - # ROADMAP S-09: global view_instances is a read-only role; the console + # Global view_instances is a read-only role; the console # is for superusers and VM owners only. mock_conn = MagicMock() mock_conn.get_console_type.return_value = "vnc" diff --git a/console/views.py b/console/views.py index 83ba5e03..e45751b8 100644 --- a/console/views.py +++ b/console/views.py @@ -129,7 +129,7 @@ def console(request): elif console_type == "pty" and not getattr( settings, "SERIAL_CONSOLE_ENABLED", False ): - # socketiod does not authenticate connections yet (ROADMAP S-01), so + # socketiod does not authenticate connections yet, so # the serial console stays off unless an admin explicitly enables it. console_error = _( "Serial console is disabled on this server. " diff --git a/instances/api/viewsets.py b/instances/api/viewsets.py index 6c34b686..298edc32 100644 --- a/instances/api/viewsets.py +++ b/instances/api/viewsets.py @@ -313,7 +313,7 @@ class CreateInstanceViewSet(viewsets.ViewSet): qemu_ga=serializer.validated_data["qemu_ga"], ) except Exception as err: - # R-08: a failed definition must not leave the new disk behind + # A failed definition must not leave the new disk behind if path: try: conn.delete_volume(path) diff --git a/instances/models.py b/instances/models.py index d85e625e..91fb4472 100644 --- a/instances/models.py +++ b/instances/models.py @@ -300,7 +300,7 @@ class CreateInstance(models.Model): class InstanceTombstone(models.Model): - """Ownership of a VM that disappeared from its compute (R-05). + """Ownership of a VM that disappeared from its compute. Kept for INSTANCE_OWNERSHIP_RETENTION_DAYS so that the owners come back when the same UUID shows up again, on this or another compute. diff --git a/instances/test_clone_permission.py b/instances/test_clone_permission.py index f517872b..9b103532 100644 --- a/instances/test_clone_permission.py +++ b/instances/test_clone_permission.py @@ -1,7 +1,6 @@ """ -Regression tests for ROADMAP Wave 0 item 4 (S-05): cloning another user's VM -must require change permission on it (templates excepted), and the clone -data must not be taken blindly from the POST body. +Cloning another user's VM must require change permission on it (templates +excepted), and the clone data must not be taken blindly from the POST body. """ from contextlib import contextmanager from unittest.mock import patch diff --git a/instances/test_console_rule.py b/instances/test_console_rule.py index 903b5604..cdf07069 100644 --- a/instances/test_console_rule.py +++ b/instances/test_console_rule.py @@ -1,7 +1,7 @@ """ -ROADMAP Wave 0 item 5 (S-09): one rule decides who may open a VM's console -(noVNC page, novncd, the virt-viewer .vv file, the VDI URL): a superuser or -an owner of the VM. The global view_instances permission is read-only. +One rule decides who may open a VM's console (noVNC page, novncd, the +virt-viewer .vv file, the VDI URL): a superuser or an owner of the VM. The +global view_instances permission is read-only. """ from unittest.mock import MagicMock, patch diff --git a/instances/test_create_rollback.py b/instances/test_create_rollback.py index 7c6f717d..5df2aeec 100644 --- a/instances/test_create_rollback.py +++ b/instances/test_create_rollback.py @@ -16,7 +16,7 @@ FORM = { class CreateRollbackTestCase(TestCase): - """R-08: volumes are removed only while the VM is not defined yet.""" + """Volumes are removed only while the VM is not defined yet.""" def setUp(self): admin = get_user_model().objects.create_superuser("rb_admin", "r@example.com", "pw") diff --git a/instances/test_disk_isolation.py b/instances/test_disk_isolation.py index 0bf5657f..26ec1036 100644 --- a/instances/test_disk_isolation.py +++ b/instances/test_disk_isolation.py @@ -1,6 +1,5 @@ """ -Regression tests for ROADMAP Wave 0 item 1 (S-02, S-03, S-04): -disk and media mutation views must be superuser-only (matching the UI, where +Disk and media mutation views must be superuser-only (matching the UI, where the Disk tab is only rendered for superusers), and even for superusers the views must not act on volumes or option values taken blindly from the client. """ diff --git a/instances/test_gstfsd.py b/instances/test_gstfsd.py index 32c3d71c..2cc198c9 100644 --- a/instances/test_gstfsd.py +++ b/instances/test_gstfsd.py @@ -48,7 +48,7 @@ def free_port(family=socket.AF_INET, host="127.0.0.1"): class GstfsdTestCase(unittest.TestCase): - """ROADMAP S-08: gstfsd hardening.""" + """gstfsd hardening.""" def setUp(self): # novncd (imported by other tests) sets SIGCHLD to SIG_IGN, which hides exit codes. diff --git a/instances/test_live_clone.py b/instances/test_live_clone.py index 174f4f5f..cd058adc 100644 --- a/instances/test_live_clone.py +++ b/instances/test_live_clone.py @@ -1,4 +1,4 @@ -"""Live checks for cloning (R-08). Runs only with TEST_LIBVIRT_HOST set.""" +"""Live checks for cloning. Runs only with TEST_LIBVIRT_HOST set.""" import os import unittest diff --git a/instances/test_live_create.py b/instances/test_live_create.py index 3cf50944..ae1167e0 100644 --- a/instances/test_live_create.py +++ b/instances/test_live_create.py @@ -1,4 +1,4 @@ -"""Live checks that a failed VM creation leaves no volumes behind (R-08). +"""Live checks that a failed VM creation leaves no volumes behind. Runs only with TEST_LIBVIRT_HOST set (see instances/livetest.py). """ diff --git a/instances/test_live_dataloss.py b/instances/test_live_dataloss.py index 3c03f0c1..f0ecf211 100644 --- a/instances/test_live_dataloss.py +++ b/instances/test_live_dataloss.py @@ -1,8 +1,8 @@ -"""Live reproductions of the Wave 1a data-loss findings. +"""Live tests for cases that lost disks or changed the wrong VM. -Each test asserts the safe behavior and is marked expectedFailure until -its finding is fixed; a fix turns it into an unexpected success, which -fails the run until the marker is removed. Runs only with +Each test asserts the safe behavior. Known unfixed cases are marked +expectedFailure; a fix turns them into unexpected successes, which fail +the run until the marker is removed. Runs only with TEST_LIBVIRT_HOST set (see instances/livetest.py). """ @@ -90,10 +90,10 @@ class LiveDataLossTestCase(TestCase): except libvirt.libvirtError: return False - # R-03: external snapshots + # External snapshots @unittest.expectedFailure - def test_r03_revert_external_snapshot_keeps_disk_added_later(self): + def test_revert_external_snapshot_keeps_disk_added_later(self): base = livetest.create_volume(self.conn, P + "r03-a") dom, inst = self.vm("r03-a", [base]) self.post("create_external_snapshot", inst, {"name": "snap"}) @@ -109,7 +109,7 @@ class LiveDataLossTestCase(TestCase): self.assertTrue(livetest.volume_exists(self.conn, later), "revert deleted a disk the snapshot never had") @unittest.expectedFailure - def test_r03_delete_older_external_snapshot_keeps_newer_snapshot_files(self): + def test_delete_older_external_snapshot_keeps_newer_snapshot_files(self): base = livetest.create_volume(self.conn, P + "r03-b") dom, inst = self.vm("r03-b", [base]) self.post("create_external_snapshot", inst, {"name": "older"}) @@ -122,7 +122,7 @@ class LiveDataLossTestCase(TestCase): self.assertTrue(livetest.volume_exists(self.conn, path), f"{path} was deleted") self.assertIn("s1.newer", dom.snapshotListNames(0)) - # R-13: internal snapshots of UEFI VMs + # Internal snapshots of UEFI VMs def _uefi_internal_snapshot(self, running): base = livetest.create_volume(self.conn, P + "r13") @@ -145,15 +145,15 @@ class LiveDataLossTestCase(TestCase): return etree.tostring(etree.fromstring(dom.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)).find("os")) - def test_r13_uefi_internal_snapshot_of_a_stopped_vm(self): + def test_uefi_internal_snapshot_of_a_stopped_vm(self): self._uefi_internal_snapshot(running=False) - def test_r13_uefi_internal_snapshot_of_a_running_vm(self): + def test_uefi_internal_snapshot_of_a_running_vm(self): self._uefi_internal_snapshot(running=True) - # R-14: destroy + # Destroy - def test_r14_destroy_keeps_a_volume_another_vm_uses(self): + def test_destroy_keeps_a_volume_another_vm_uses(self): shared = livetest.create_volume(self.conn, P + "r14-shared") _, inst = self.vm("r14-a", [shared]) self.vm("r14-b", [shared]) @@ -182,13 +182,13 @@ class LiveDataLossTestCase(TestCase): self.assertEqual(response.status_code, 302) self.assertTrue(livetest.volume_exists(self.conn, base), "deleted the backing file of another VM's disk") - def test_r14_destroy_keeps_the_backing_file_of_a_stopped_vm(self): + def test_destroy_keeps_the_backing_file_of_a_stopped_vm(self): self._destroy_base_of_another_vms_overlay(running=False) - def test_r14_destroy_keeps_the_backing_file_of_a_running_vm(self): + def test_destroy_keeps_the_backing_file_of_a_running_vm(self): self._destroy_base_of_another_vms_overlay(running=True) - def test_r14_destroy_with_managed_save_removes_the_vm(self): + def test_destroy_with_managed_save_removes_the_vm(self): base = livetest.create_volume(self.conn, P + "r14-save") dom, inst = self.vm("r14-save", [base]) dom.create() @@ -200,7 +200,7 @@ class LiveDataLossTestCase(TestCase): self.assertFalse(self.domain_exists(uuid), "VM is still defined") self.assertFalse(Instance.objects.filter(uuid=uuid).exists()) - def test_r14_destroy_of_a_paused_vm_removes_it(self): + def test_destroy_of_a_paused_vm_removes_it(self): base = livetest.create_volume(self.conn, P + "r14-paused") dom, inst = self.vm("r14-paused", [base]) dom.create() @@ -210,7 +210,7 @@ class LiveDataLossTestCase(TestCase): self.assertFalse(self.domain_exists(dom.UUIDString()), "paused VM is still running") - # S-02: delete a volume only after it is detached + # Delete a volume only after it is detached def _delete_attached_volume(self, pause): base = livetest.create_volume(self.conn, P + "s02") @@ -229,13 +229,13 @@ class LiveDataLossTestCase(TestCase): self.assertIn("vdb", self.disk_sources(dom)) self.assertTrue(livetest.volume_exists(self.conn, data), "volume deleted while the VM still uses it") - def test_s02_delete_volume_of_a_paused_vm(self): + def test_delete_volume_of_a_paused_vm(self): self._delete_attached_volume(pause=True) - def test_s02_delete_volume_of_a_running_vm_without_guest_ack(self): + def test_delete_volume_of_a_running_vm_without_guest_ack(self): self._delete_attached_volume(pause=False) - def test_s02_delete_volume_another_vm_uses_is_refused(self): + def test_delete_volume_another_vm_uses_is_refused(self): base = livetest.create_volume(self.conn, P + "s02-own") shared = livetest.create_volume(self.conn, P + "s02-shared") _, inst = self.vm("s02-a", [base, shared]) @@ -246,9 +246,9 @@ class LiveDataLossTestCase(TestCase): self.assertEqual(response.status_code, 302) self.assertTrue(livetest.volume_exists(self.conn, shared), "deleted another VM's disk") - # R-06: operations follow the VM's UUID, not its name + # Operations follow the VM's UUID, not its name - def test_r06_mutation_follows_uuid_after_names_are_swapped(self): + def test_mutation_follows_uuid_after_names_are_swapped(self): dom_a, inst_a = self.vm("r06-a", []) dom_b, _ = self.vm("r06-b", []) dom_a.rename(P + "r06-tmp", 0) @@ -260,7 +260,7 @@ class LiveDataLossTestCase(TestCase): self.assertIn("