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
@@ -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