The deploy API refuses an HDD_PATH that is a folder inside a registered drive; the walk sent DRIVE/<app> and got 409 on 9202 (2026-10-24, felhom.eu R-1250 live proof).
This commit is contained in:
1 parent
3d98779869
commit
7de554e954
4 files changed
+41
-15
No files matched your search
+7
-2
@@ -270,7 +270,8 @@ def wait_app(sub, path="/", want=("200", "302", "303", "401", "403"), tries=60,
|
||||
# ------------------------------------------------------------------ the walk
|
||||
|
||||
|
||||
DRIVE = "/mnt/felhom-drives/scratch_hdd/userdata"
|
||||
DRIVE_ROOT = "/mnt/felhom-drives/scratch_hdd" # the registered drive: what an HDD_PATH must name (R-839)
|
||||
DRIVE = DRIVE_ROOT + "/userdata"
|
||||
|
||||
# What THIS run generated for a deploy, per app. Deploy secrets are ENCRYPTED AT REST in
|
||||
# `app.yaml` (`ENC:…`), which is right and which means a fixture cannot read an app's admin
|
||||
@@ -309,7 +310,11 @@ def deploy_values(name, sub, given=None):
|
||||
# caller that trusts the contract gets a 400. Measured tonight on grafana; filed.
|
||||
if not f.get("required") and ty != "password":
|
||||
continue # the controller generates the optional secrets itself
|
||||
if ty == "path":
|
||||
if ty == "path" and ev == "HDD_PATH":
|
||||
# R-839 (controller): the deploy API refuses an HDD_PATH that is a folder INSIDE a registered drive —
|
||||
# the app's data place is the drive itself. Measured 2026-10-24: DRIVE/<app> came back 409.
|
||||
values[ev] = DRIVE_ROOT
|
||||
elif ty == "path":
|
||||
p = f"{DRIVE}/{name}"
|
||||
values[ev] = p
|
||||
made.append(p)
|
||||
|
||||
@@ -437,6 +437,23 @@ class BoxWalkTargets(unittest.TestCase):
|
||||
self.assertEqual(a[-1], "root@192.168.0.154")
|
||||
self.assertIn(("tester-1", "9201"), fxbox.BOX_ADMIN_SEED_GUESTS)
|
||||
|
||||
def test_hdd_path_is_the_drive_itself(self):
|
||||
"""R-839: the deploy API refuses an HDD_PATH that is a folder inside a registered drive (409, measured
|
||||
2026-10-24 on 9202 with DRIVE/qbittorrent). The walk sends the drive and makes no folder for it; another
|
||||
path field still gets its own folder. RED-PROOF: send DRIVE/<app> for HDD_PATH again → fails."""
|
||||
bw = self.load({"BASE": "https://192.0.2.1"})
|
||||
fields = [{"env_var": "HDD_PATH", "type": "path", "required": True},
|
||||
{"env_var": "MEDIA_DIR", "type": "path", "required": True}]
|
||||
made = []
|
||||
with mock.patch.object(bw, "ctl", return_value=("200", {"data": {"metadata": {"deploy_fields": fields}}})), \
|
||||
mock.patch.object(bw, "guest", side_effect=lambda script, timeout=600: made.append(script) or ""), \
|
||||
mock.patch.object(bw, "say"):
|
||||
v = bw.deploy_values("qbittorrent", "x")
|
||||
self.assertEqual(v["HDD_PATH"], "/mnt/felhom-drives/scratch_hdd")
|
||||
self.assertEqual(v["MEDIA_DIR"], bw.DRIVE + "/qbittorrent")
|
||||
self.assertEqual(len(made), 1)
|
||||
self.assertNotIn("scratch_hdd ", made[0] + " ") # the drive root itself is never mkdir-ed
|
||||
|
||||
def test_an_unknown_target_is_refused(self):
|
||||
with self.assertRaises(SystemExit):
|
||||
self.load({"TARGET": "ep0"})
|
||||
|
||||
Reference in new issue
Block a user