Files
Assistant/tests/production_recovery/verify_latest_backup_test.ps1
T

11 lines
609 B
PowerShell

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$script = Get-Content -LiteralPath (Join-Path $PSScriptRoot '../../deploy/verify-latest-postgres-backup.sh') -Raw
if ($script -notmatch "-regex '\.\*/\[0-9\]\{8\}T\[0-9\]\{6\}Z\$'") {
throw 'restore selector does not restrict candidates to timestamp directories'
}
if ($script -notmatch 'invalid timestamp') { throw 'restore selector lacks timestamp fail-closed guard' }
if ($script -match "! -name '\.\*'") { throw 'restore selector still accepts arbitrary non-hidden directories' }
Write-Output 'verify-latest backup selector tests: PASS'