mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 07:26:18 -05:00
Debian installs show the Controller drive wizard
wrolpi-bootstrap.sh created controller.yaml on installed systems, which hid the onboarding wizard. Installed systems now wait for the wizard, whose repair.sh finishes setup. "Run repair without external drive" now writes controller.yaml before starting repair, so the wizard does not return after repair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
697a8180c7
commit
f3232f30ac
6 changed files with 119 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ class TestOnboardingDockerAndMounted:
|
|||
("post", "/api/onboarding/probe", {"device_path": "/dev/sda1", "fstype": "ext4"}),
|
||||
("post", "/api/onboarding/commit", {"device_path": "/dev/sda1", "fstype": "ext4"}),
|
||||
("post", "/api/onboarding/cancel", None),
|
||||
("post", "/api/onboarding/without-drive", None),
|
||||
])
|
||||
def test_endpoint_returns_501_in_docker(self, test_client_docker_mode, method, endpoint, payload):
|
||||
client_call = getattr(test_client_docker_mode, method)
|
||||
|
|
@ -24,6 +25,7 @@ class TestOnboardingDockerAndMounted:
|
|||
@pytest.mark.parametrize("method,endpoint,payload", [
|
||||
("get", "/api/onboarding/candidates", None),
|
||||
("post", "/api/onboarding/probe", {"device_path": "/dev/sda1", "fstype": "ext4"}),
|
||||
("post", "/api/onboarding/without-drive", None),
|
||||
])
|
||||
def test_endpoint_returns_409_when_drive_mounted(self, test_client, method, endpoint, payload):
|
||||
"""Onboarding endpoints reject when the primary drive is already mounted."""
|
||||
|
|
@ -196,3 +198,26 @@ class TestOnboardingCancelEndpoint:
|
|||
):
|
||||
response = test_client.post("/api/onboarding/cancel")
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
class TestOnboardingWithoutDrive:
|
||||
|
||||
def test_without_drive_success(self, test_client):
|
||||
with mock.patch("controller.api.onboarding.is_primary_drive_mounted", return_value=False), \
|
||||
mock.patch("controller.api.onboarding.onboard_without_drive",
|
||||
return_value={"success": True, "mounts": [], "repair_started": True}) as onboard:
|
||||
response = test_client.post("/api/onboarding/without-drive")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json()["success"] is True
|
||||
assert response.json()["repair_started"] is True
|
||||
onboard.assert_called_once_with()
|
||||
|
||||
def test_without_drive_failure(self, test_client):
|
||||
with mock.patch("controller.api.onboarding.is_primary_drive_mounted", return_value=False), \
|
||||
mock.patch("controller.api.onboarding.onboard_without_drive",
|
||||
return_value={"success": False, "error": "disk full"}):
|
||||
response = test_client.post("/api/onboarding/without-drive")
|
||||
|
||||
assert response.status_code == 500
|
||||
assert "disk full" in response.json()["detail"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue