From 5e196e1ab8a11950efe7f018f1da3d24eaeb7aed Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sat, 24 Oct 2026 13:47:23 +0200 Subject: [PATCH] box_walk: a leftover is an app.yaml, not the template folder /opt/docker/stacks/ is the catalog's template copy and stays after a clean remove, so every remove printed it as a leftover (2026-10-24, 9202). --- CHANGELOG.md | 3 +++ REPORT.md | 2 ++ scripts/box_walk.py | 4 +++- scripts/test_upgrade_bench.py | 13 +++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efbdbd6..1eb7930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ HDD_PATH that is a folder inside a drive; the walk still sent `DRIVE/` and got 409 (measured on 9202 while installing a throwaway qBittorrent for felhom.eu R-1250's live proof; the empty folder it made was removed). Other `path` fields keep their own folder. `test_hdd_path_is_the_drive_itself` (seen failing with the rule off). +- `remove()`'s leftover check looks for the install record `/opt/docker/stacks//app.yaml`, not the folder: the folder is the + catalog's template copy and stays after a clean remove, so every remove read „leftovers=". + `test_remove_looks_for_the_install_record_not_the_template_folder` (seen failing on the old check). ## 2026-10-23 (day, after the release) — the box walk reads Tester 1's address from the guest diff --git a/REPORT.md b/REPORT.md index 1f24e11..0787bc2 100644 --- a/REPORT.md +++ b/REPORT.md @@ -7,4 +7,6 @@ - **Test:** `scripts/test_upgrade_bench.py` `BoxWalkTargets.test_hdd_path_is_the_drive_itself` — seen failing with the rule switched off; the bench suite green after. - **Live:** the same install went through with the drive root (202, running). The stray empty folder was removed. +- `remove()` no longer reports the template folder as a leftover: it checks for `app.yaml`, the install's record (the + folder stays after every clean remove). Test seen failing on the old check. - No template changed; no catalog version moved. diff --git a/scripts/box_walk.py b/scripts/box_walk.py index 3669327..0277bb0 100644 --- a/scripts/box_walk.py +++ b/scripts/box_walk.py @@ -595,7 +595,9 @@ def remove(name): say(f" [X] remove (keeping drive data) -> {code} {str(d)[:160]}") time.sleep(5) st = stack(name) - left = guest(f"ls -d /opt/docker/stacks/{name} 2>/dev/null; " + # The stack folder itself stays: it is the catalog's template copy (every app has one). An install leaves its record, + # app.yaml — that is the leftover to look for (2026-10-24: the folder alone read as a leftover after a clean remove). + left = guest(f"ls -d /opt/docker/stacks/{name}/app.yaml 2>/dev/null; " f"docker ps -a --filter label=com.docker.compose.project={name} --format '{{{{.Names}}}}'") say(f" [X] after remove: deployed={st.get('deployed')} leftovers={left.strip()!r}") return code diff --git a/scripts/test_upgrade_bench.py b/scripts/test_upgrade_bench.py index 6295228..3921ed3 100644 --- a/scripts/test_upgrade_bench.py +++ b/scripts/test_upgrade_bench.py @@ -454,6 +454,19 @@ class BoxWalkTargets(unittest.TestCase): self.assertEqual(len(made), 1) self.assertNotIn("scratch_hdd ", made[0] + " ") # the drive root itself is never mkdir-ed + def test_remove_looks_for_the_install_record_not_the_template_folder(self): + """/opt/docker/stacks/ is the catalog's template copy and stays after a clean remove; app.yaml is the + install's record. RED-PROOF: check the folder again → fails.""" + bw = self.load({"BASE": "https://192.0.2.1"}) + seen = [] + with mock.patch.object(bw, "ctl", return_value=("200", {"ok": True})), \ + mock.patch.object(bw, "stack", return_value={"deployed": False}), \ + mock.patch.object(bw, "guest", side_effect=lambda script, timeout=600: seen.append(script) or ""), \ + mock.patch.object(bw, "say"), mock.patch.object(bw.time, "sleep"): + bw.remove("qbittorrent") + check = [c for c in seen if "/opt/docker/stacks/" in c] + self.assertTrue(check and "/opt/docker/stacks/qbittorrent/app.yaml" in check[-1], seen) + def test_an_unknown_target_is_refused(self): with self.assertRaises(SystemExit): self.load({"TARGET": "ep0"})