Backup: probe the target with a real write instead of access(W_OK)

On the server the backup folder is a Synology NFS share with "map all
users to admin": access(W_OK) returns EACCES for uid 1000 although
writes succeed, so the first scheduled run failed with "not usable".
Create and remove a probe file instead; test that it leaves nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MaashkinoozheandClaude Opus 5.5 committed 2026-10-22 18:12:41 +02:00
1 parent 086f6353f8
commit f8f21ab42a
3 files changed
+18 -2

No files matched your search

+10
View File
@@ -168,6 +168,16 @@ test('backups are off without BACKUP, and a missing folder is reported, never cr
} finally { f.cleanup(); }
});
test('the writability probe leaves nothing behind in the backup folder', async () => {
const f = fixture();
try {
const backup = service(f);
await backup.refreshTarget();
assert.equal(backup.publicState().targetError, null);
assert.deepEqual(fs.readdirSync(f.target).filter(name => name.startsWith('.circus-backup-probe')), []);
} finally { f.cleanup(); }
});
test('only one run at a time', async () => {
const f = fixture();
try {