@@ -77,6 +77,13 @@ async function expectPathMissing(targetPath: string): Promise<void> {
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
| 80 | +function expectPrivatePosixMode(mode: number, label: string): void { |
| 81 | +if (process.platform === "win32") { |
| 82 | +return; |
| 83 | +} |
| 84 | +expect(mode & 0o077, `${label} permissions are too broad: ${(mode & 0o777).toString(8)}`).toBe(0); |
| 85 | +} |
| 86 | + |
80 | 87 | function matrixQaScenarioContext(): MatrixQaScenarioContext { |
81 | 88 | return { |
82 | 89 | baseUrl: "http://127.0.0.1:28008/", |
@@ -5587,13 +5594,14 @@ describe("matrix live qa scenarios", () => {
|
5587 | 5594 | const cliArtifactDir = path.join(outputDir, "cli-self-verification", cliRunDir ?? ""); |
5588 | 5595 | const cliArtifactMode = (await stat(cliArtifactDir)).mode; |
5589 | 5596 | expect(typeof cliArtifactMode).toBe("number"); |
5590 | | -expect(cliArtifactMode & 0o777).toBe(0o700); |
| 5597 | +expectPrivatePosixMode(cliArtifactMode, "Matrix QA CLI artifact directory"); |
5591 | 5598 | await expect( |
5592 | 5599 | readFile(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt"), "utf8"), |
5593 | 5600 | ).resolves.toContain('"success":true'); |
5594 | | -expect( |
5595 | | -(await stat(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt"))).mode & 0o777, |
5596 | | -).toBe(0o600); |
| 5601 | +const restoreStdoutMode = ( |
| 5602 | +await stat(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt")) |
| 5603 | +).mode; |
| 5604 | +expectPrivatePosixMode(restoreStdoutMode, "Matrix QA CLI restore stdout artifact"); |
5597 | 5605 | await expect( |
5598 | 5606 | readFile(path.join(cliArtifactDir, "verify-self.stdout.txt"), "utf8"), |
5599 | 5607 | ).resolves.toContain("Device verified by owner: yes"); |
|