tests: the unmounted-disk test names a disk no box mounts

ACacheWhoseDiskIsNotMounted wrote a fake fstab naming /mnt/ssd, the reference box's own SSD: with the CI's temporary
files on that disk (its system disk had 21 GiB free, the video lane's tests ask 28), the temporary home sat under the
fake entry and read as on that disk. The fake fstab names /mnt/alzeo-test-disk now: green with TMPDIR on the SSD and in
/tmp, red on the old test with TMPDIR on the SSD (2026-12-04).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hasan BasbunarandClaude Opus 5.5 committed 2026-12-04 14:12:36 +01:00
1 parent b909ff0aee
commit af9c1ae87f
1 file changed
+9 -7
+9 -7
View File
@@ -146,22 +146,24 @@ class ACacheWhoseDiskIsNotMounted(Tmp):
self.assertEqual(r.returncode, 0, r.stderr)
return r.stdout.strip()
# A disk no box mounts: with the reference box's own (its SSD), a TMPDIR on that disk put the temporary home under the
# fake fstab's entry, and it read as on that disk (the CI of v1.62.0 with its temporary files on the SSD, 2026-12-04).
FSTAB = ("# a comment\nUUID=1 / ext4 defaults 0 1\n/swap.img none swap sw 0 0\n"
"UUID=2 /mnt/ssd ext4 nofail 0 2\nUUID=3 /mnt/my\\040disk ext4 nofail 0 2\n")
"UUID=2 /mnt/alzeo-test-disk ext4 nofail 0 2\nUUID=3 /mnt/my\\040disk ext4 nofail 0 2\n")
def test_named(self):
self.assertEqual(self.disk(self.FSTAB, "/mnt/ssd/hf"), "/mnt/ssd")
self.assertEqual(self.disk(self.FSTAB, "/mnt/alzeo-test-disk/hf"), "/mnt/alzeo-test-disk")
self.assertEqual(self.disk(self.FSTAB, "/mnt/my disk/hf"), "/mnt/my disk")
def test_mounted_or_elsewhere(self):
self.assertEqual(self.disk(self.FSTAB, "/mnt/ssd/hf", ("/mnt/ssd",)), "")
self.assertEqual(self.disk(self.FSTAB, "/mnt/ssd2/hf"), "")
self.assertEqual(self.disk(self.FSTAB, "/mnt/alzeo-test-disk/hf", ("/mnt/alzeo-test-disk",)), "")
self.assertEqual(self.disk(self.FSTAB, "/mnt/alzeo-test-disk2/hf"), "")
self.assertEqual(self.disk(self.FSTAB, self.d / "home/.cache/huggingface"), "")
self.assertEqual(self.disk("", "/mnt/ssd/hf"), "")
self.assertEqual(self.disk("", "/mnt/alzeo-test-disk/hf"), "")
def test_through_a_link(self):
os.symlink("/mnt/ssd/hf", self.d / "huggingface")
self.assertEqual(self.disk(self.FSTAB, self.d / "huggingface"), "/mnt/ssd")
os.symlink("/mnt/alzeo-test-disk/hf", self.d / "huggingface")
self.assertEqual(self.disk(self.FSTAB, self.d / "huggingface"), "/mnt/alzeo-test-disk")
def test_the_install_asks_before_anything(self):
self.assertLess(INSTALL.index("unmounted_disk_of"), INSTALL.index('mkdir -p "$HF_CACHE"'))