|
1 | 1 | <# |
2 | 2 | .SYNOPSIS |
3 | | - Automated Test Runner for RackStack v1.122.2 |
| 3 | + Automated Test Runner for RackStack v1.122.3 |
4 | 4 |
|
5 | 5 | .DESCRIPTION |
6 | 6 | Comprehensive non-interactive test suite covering: |
@@ -10333,8 +10333,25 @@ try { |
10333 | 10333 | Write-TestResult "Update: Get-ReleaseAssetHash function exists" ($utilContent204 -match 'function\s+Get-ReleaseAssetHash\b') |
10334 | 10334 | Write-TestResult "Update: hash lookup is delegated, not inlined" ($utilContent204 -match '\$expectedHash\s*=\s*Get-ReleaseAssetHash\s') |
10335 | 10335 | Write-TestResult "Update: asset selection normalizes space/dot" ($utilContent204 -match '\$assetKey\s*=\s*\$assetName\s*-replace\s*''\[\\s\.\]'',\s*''\.''') |
10336 | | - # The old fail-open text must never come back. |
10337 | | - Write-TestResult "Update: no 'skipping verification' fail-open path" (-not ($utilContent204 -match 'skipping verification')) |
| 10336 | + # The old fail-open text must never come back — REPO-WIDE, not just in this module. |
| 10337 | + # Scoping this to 35-Utilities was a mistake: it passed while an identical fail-open |
| 10338 | + # survived in 50-EntryPoint's UpdateSelf action, and only an end-to-end check against the |
| 10339 | + # shipped monolithic caught it. Any code path that replaces a running binary or script must |
| 10340 | + # refuse an update it cannot verify, so assert across every module. |
| 10341 | + $failOpenHits204 = @( |
| 10342 | + Get-ChildItem -Path $modulesPath -Filter '*.ps1' -File | |
| 10343 | + Where-Object { (Get-Content $_.FullName -Raw) -match 'skipping verification' } | |
| 10344 | + ForEach-Object { $_.Name } |
| 10345 | + ) |
| 10346 | + Write-TestResult "Update: no 'skipping verification' fail-open path in ANY module" ` |
| 10347 | + ($failOpenHits204.Count -eq 0) $(if ($failOpenHits204.Count) { "found in: $($failOpenHits204 -join ', ')" } else { "" }) |
| 10348 | + |
| 10349 | + # Both self-update implementations must refuse rather than warn-and-continue. |
| 10350 | + $entryContent204 = Get-Content "$modulesPath\50-EntryPoint.ps1" -Raw |
| 10351 | + Write-TestResult "Update: UpdateSelf refuses an unverified EXE" ` |
| 10352 | + ($entryContent204 -match 'refusing to install an unverified update') |
| 10353 | + Write-TestResult "Update: UpdateSelf exits rather than continuing" ` |
| 10354 | + ($entryContent204 -match 'refusing to install an unverified update[\s\S]{0,400}\[Environment\]::Exit\(1\)') |
10338 | 10355 | Write-TestResult "Update: missing hash refuses the install" ($utilContent204 -match 'refusing to install an unverified update') |
10339 | 10356 | # A refusal must actually return, not just print. |
10340 | 10357 | Write-TestResult "Update: refusal path returns before install" ($utilContent204 -match 'refusing to install an unverified update[\s\S]{0,400}\breturn\b') |
|
0 commit comments