# ============================================================================== # ClassNotify P1 RC2 Acceptance Gate RC-1: Fresh Install & Upgrade # Validates: # 1. Cryptographic pre-flight verification against immutable RC2 manifest # 2. Complete clean environment teardown # 3. RC2 Fresh unattended installation & live cloud notification # 4. Real Cross-Version Upgrade: RC1 actively running -> RC2 in-place upgrade (RC1-BLOCKER-01 Fix Verification) # 5. Same-Version Upgrade / Repair: RC2 actively running -> RC2 in-place upgrade # 6. Real Fail-Closed Negative Test: Stubborn unkillable process triggers non-zero abort without payload extraction # 7. GUI Smoke Test on existing installation # 8. Clean uninstallation & service deletion # 9. Final Re-installation leaving system in operational state for Gate RC-2 # ============================================================================== param ( [string]$BaseUrl = "https://classnotify.paradise.eu.org", [string]$AuditUrl = "https://audit.paradise.eu.org", [string]$RC2ArtifactId = "P1-RC2-20260922-151442-F2C14966", [string]$RC2InstallerPath = "C:\Users\Administrator\.gemini\antigravity\scratch\ClassNotify\rc2_artifacts\ClassNotifySetup.exe", [string]$ExpectedRC2Sha256 = "F2C14966E99B47A5A67436F7E4E1FB72A363FCB560BF19C07BDF23DEA5BDADD9", [string]$RC1InstallerPath = "C:\Users\Administrator\.gemini\antigravity\scratch\ClassNotify\rc_artifacts\ClassNotifySetup.exe", [string]$ExpectedRC1Sha256 = "FBF8BF67E7722B971D14D6A33093DFA2B519CA5F4D5274ED820D41AA074CB38B" ) $ErrorActionPreference = "Stop" # Load credentials from user environment securely if (-not $env:CLASSNOTIFY_E2E_PASSWORD) { $env:CLASSNOTIFY_E2E_PASSWORD = [System.Environment]::GetEnvironmentVariable('CLASSNOTIFY_E2E_PASSWORD', 'User') } if (-not $env:CLASSNOTIFY_E2E_USERNAME) { $env:CLASSNOTIFY_E2E_USERNAME = [System.Environment]::GetEnvironmentVariable('CLASSNOTIFY_E2E_USERNAME', 'User') if (-not $env:CLASSNOTIFY_E2E_USERNAME) { $env:CLASSNOTIFY_E2E_USERNAME = "teacher_rc1" } } if (-not $env:CLASSNOTIFY_SCHOOLADMIN_PASSWORD) { $env:CLASSNOTIFY_SCHOOLADMIN_PASSWORD = [System.Environment]::GetEnvironmentVariable('CLASSNOTIFY_SCHOOLADMIN_PASSWORD', 'User') } if (-not $env:CLASSNOTIFY_SCHOOLADMIN_USERNAME) { $env:CLASSNOTIFY_SCHOOLADMIN_USERNAME = [System.Environment]::GetEnvironmentVariable('CLASSNOTIFY_SCHOOLADMIN_USERNAME', 'User') if (-not $env:CLASSNOTIFY_SCHOOLADMIN_USERNAME) { $env:CLASSNOTIFY_SCHOOLADMIN_USERNAME = "admin_bj4" } } if (-not $env:CLASSNOTIFY_E2E_PASSWORD -or -not $env:CLASSNOTIFY_SCHOOLADMIN_PASSWORD) { throw "Security Guard: E2E and SchoolAdmin passwords must be available in environment." } Write-Host "==========================================================" -ForegroundColor Cyan Write-Host " ClassNotify P1 RC2 — Gate RC-1: Install & Upgrade Suite " -ForegroundColor Cyan Write-Host " Target RC2 ArtifactId: $RC2ArtifactId" -ForegroundColor Cyan Write-Host "==========================================================" -ForegroundColor Cyan $passed = 0 $failed = 0 function Report-Result([string]$testName, $condition, [string]$details = "") { $boolCond = [bool]$condition if ($boolCond) { Write-Host " [PASS] $testName" -ForegroundColor Green if ($details) { Write-Host " $details" -ForegroundColor DarkGray } $script:passed++ } else { Write-Host " [FAIL] $testName" -ForegroundColor Red if ($details) { Write-Host " $details" -ForegroundColor Yellow } $script:failed++ } } $installDir = "C:\Program Files\ClassNotify" $programDataDir = "C:\ProgramData\ClassNotify" $targetClassId = "cls_802" # ------------------------------------------------------------------------------ # STEP 1: Cryptographic Pre-Flight Verification # ------------------------------------------------------------------------------ Write-Host "`n>>> [1/9] Pre-Flight Cryptographic Integrity Checks..." -ForegroundColor Yellow $rc2Hash = (Get-FileHash -Path $RC2InstallerPath -Algorithm SHA256).Hash.ToUpper() $rc2Match = ($rc2Hash -eq $ExpectedRC2Sha256) Report-Result "Local RC2 ClassNotifySetup.exe SHA256 matches baseline ($ExpectedRC2Sha256)" $rc2Match $rc2Hash $rc1Hash = (Get-FileHash -Path $RC1InstallerPath -Algorithm SHA256).Hash.ToUpper() $rc1Match = ($rc1Hash -eq $ExpectedRC1Sha256) Report-Result "Local RC1 ClassNotifySetup.exe SHA256 matches frozen baseline ($ExpectedRC1Sha256)" $rc1Match $rc1Hash $manifestUrl = "$AuditUrl/release-candidates/$RC2ArtifactId/P1_RC2_BUILD_MANIFEST.json" $remoteManifest = Invoke-RestMethod -Uri $manifestUrl -UseBasicParsing $remoteSetupHash = $remoteManifest.artifacts."ClassNotifySetup.exe".sha256.ToUpper() $manifestMatch = ($remoteSetupHash -eq $ExpectedRC2Sha256) Report-Result "Remote Immutable Manifest binds exact RC2 installer SHA256" $manifestMatch "Remote: $remoteSetupHash" # ------------------------------------------------------------------------------ # STEP 2: Complete Environment Teardown # ------------------------------------------------------------------------------ Write-Host "`n>>> [2/9] Cleaning Environment for Fresh Start..." -ForegroundColor Yellow function Invoke-Teardown { sc.exe stop ClassNotifyService 2>&1 | Out-Null Start-Sleep -Seconds 1 sc.exe delete ClassNotifyService 2>&1 | Out-Null Get-Process -Name ClassNotify.Client, ClassNotify.Service -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue Start-Sleep -Seconds 1 if (Test-Path $installDir) { Remove-Item -Path $installDir -Recurse -Force -ErrorAction SilentlyContinue } if (Test-Path $programDataDir) { Remove-Item -Path $programDataDir -Recurse -Force -ErrorAction SilentlyContinue } } Invoke-Teardown $cleanProcs = @(Get-Process -Name ClassNotify.Client, ClassNotify.Service -ErrorAction SilentlyContinue).Count -eq 0 $cleanSvc = (sc.exe query ClassNotifyService 2>&1) -match "1060|FAILED" $cleanFiles = -not (Test-Path $installDir) Report-Result "Teardown: zero ClassNotify processes active" $cleanProcs Report-Result "Teardown: ClassNotifyService unregistered from Windows SCM" $cleanSvc Report-Result "Teardown: C:\Program Files\ClassNotify directory removed" $cleanFiles # ------------------------------------------------------------------------------ # STEP 3: RC2 Fresh Unattended Installation & Live Notification # ------------------------------------------------------------------------------ Write-Host "`n>>> [3/9] Executing Fresh Silent Installation of RC2..." -ForegroundColor Yellow # Generate activation code $adminLoginBody = @{ username = $env:CLASSNOTIFY_SCHOOLADMIN_USERNAME password = $env:CLASSNOTIFY_SCHOOLADMIN_PASSWORD } | ConvertTo-Json $adminLoginRes = Invoke-RestMethod -Uri "$BaseUrl/api/auth/login" -Method Post -Body $adminLoginBody -ContentType "application/json" $adminHeaders = @{ Authorization = "Bearer $($adminLoginRes.token)" } $codeGenRes = Invoke-RestMethod -Uri "$BaseUrl/api/schooladmin/activation-codes?classId=$targetClassId" -Method Post -Headers $adminHeaders $activationCode1 = $codeGenRes.code Report-Result "Generated activation code for fresh install: $activationCode1" (-not [string]::IsNullOrWhiteSpace($activationCode1)) # Execute RC2 silent install $installProc1 = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/code=$activationCode1", "/server=$BaseUrl" ` -PassThru -Wait Report-Result "RC2 fresh silent install exited with code 0" ($installProc1.ExitCode -eq 0) "ExitCode: $($installProc1.ExitCode)" Start-Sleep -Seconds 5 # Verify binaries and services $serviceExeInstalled = Test-Path "$installDir\Service\ClassNotify.Service.exe" $clientExeInstalled = Test-Path "$installDir\Client\ClassNotify.Client.exe" $credentialsInstalled = Test-Path "$programDataDir\device_credentials.json" Report-Result "RC2 Service binary installed in Program Files" $serviceExeInstalled Report-Result "RC2 Client binary installed in Program Files" $clientExeInstalled Report-Result "RC2 Device credentials stored in ProgramData" $credentialsInstalled $svcStatus1 = sc.exe query ClassNotifyService 2>&1 Report-Result "Windows Service 'ClassNotifyService' is RUNNING" ([bool]($svcStatus1 -match "RUNNING")) $svcProc1 = Get-Process -Name ClassNotify.Service -ErrorAction SilentlyContinue | Select-Object -First 1 $cliProc1 = Get-Process -Name ClassNotify.Client -ErrorAction SilentlyContinue | Select-Object -First 1 Report-Result "Service process active (Session: $($svcProc1.SessionId))" ($null -ne $svcProc1) Report-Result "Client process active (Session: $($cliProc1.SessionId))" ($null -ne $cliProc1) $sessionSeparation = ($svcProc1.SessionId -eq 0 -and $cliProc1.SessionId -gt 0) Report-Result "Session Isolation: Service in Session 0, Client in Session $($cliProc1.SessionId)" $sessionSeparation # Verify DPAPI credentials Add-Type -AssemblyName System.Security $rawCreds = [System.IO.File]::ReadAllBytes("$programDataDir\device_credentials.json") $entropy = [System.Text.Encoding]::UTF8.GetBytes("ClassNotify_Device_Credential_V1") $decrypted = [System.Security.Cryptography.ProtectedData]::Unprotect($rawCreds, $entropy, [System.Security.Cryptography.DataProtectionScope]::LocalMachine) $credObj1 = [System.Text.Encoding]::UTF8.GetString($decrypted) | ConvertFrom-Json Report-Result "DPAPI Encrypted Credentials bind to $targetClassId (DeviceId: $($credObj1.DeviceId))" ($credObj1.ClassId -eq $targetClassId) # Send live cloud notification $teacherLoginBody = @{ username = $env:CLASSNOTIFY_E2E_USERNAME password = $env:CLASSNOTIFY_E2E_PASSWORD } | ConvertTo-Json $teacherLoginRes = Invoke-RestMethod -Uri "$BaseUrl/api/auth/login" -Method Post -Body $teacherLoginBody -ContentType "application/json" $teacherHeaders = @{ Authorization = "Bearer $($teacherLoginRes.token)" } $notifBody1 = @{ classId = $targetClassId studentName = "RC2 Fresh Install Student" title = "RC-1 Fresh Install Test" message = "Automated acceptance test notification for RC2 fresh install." voice = $true durationSeconds = 15 } | ConvertTo-Json $sendRes1 = Invoke-RestMethod -Uri "$BaseUrl/api/notification/send" -Method Post -Headers $teacherHeaders -Body $notifBody1 -ContentType "application/json" Report-Result "Teacher sent live notification to RC2 fresh install" ($sendRes1.success -eq $true -or -not [string]::IsNullOrWhiteSpace($sendRes1.notificationId)) Start-Sleep -Seconds 3 $latestLog = Get-ChildItem "$programDataDir\logs" -Filter "*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 $logContent1 = if ($latestLog) { Get-Content $latestLog.FullName -Tail 40 } else { "" } $logReceived = ($logContent1 -match "RC2 Fresh Install Student" -or $logContent1 -match $sendRes1.notificationId -or $logContent1 -match "Relayed notification") Report-Result "Local Service received and processed live cloud notification" $logReceived # ------------------------------------------------------------------------------ # STEP 4: Real Cross-Version Upgrade Test (P1-RC1 Running -> P1-RC2 In-Place Upgrade) # This directly proves the resolution of RC1-BLOCKER-01! # ------------------------------------------------------------------------------ Write-Host "`n>>> [4/9] Real Cross-Version Upgrade: Install RC1 -> In-Place Upgrade to RC2..." -ForegroundColor Yellow # Clean teardown for authentic upgrade test Invoke-Teardown # 4a. Install P1-RC1 cleanly $codeGenRes2 = Invoke-RestMethod -Uri "$BaseUrl/api/schooladmin/activation-codes?classId=$targetClassId" -Method Post -Headers $adminHeaders $activationCode2 = $codeGenRes2.code $rc1InstallProc = Start-Process -FilePath $RC1InstallerPath ` -ArgumentList "/silent", "/code=$activationCode2", "/server=$BaseUrl" ` -PassThru -Wait Report-Result "P1-RC1 baseline fresh install exited with code 0" ($rc1InstallProc.ExitCode -eq 0) Start-Sleep -Seconds 5 # Verify RC1 is actively running and holding DLL locks $rc1SvcProc = Get-Process -Name ClassNotify.Service -ErrorAction SilentlyContinue | Select-Object -First 1 $rc1CliProc = Get-Process -Name ClassNotify.Client -ErrorAction SilentlyContinue | Select-Object -First 1 $rc1ActivelyRunning = ($null -ne $rc1SvcProc -and $null -ne $rc1CliProc) Report-Result "P1-RC1 Service (PID: $($rc1SvcProc.Id)) and Client (PID: $($rc1CliProc.Id)) actively running with open handles" $rc1ActivelyRunning # Explicitly dispose process objects so test PowerShell process releases handles if ($rc1SvcProc) { $rc1SvcProc.Dispose(); $rc1SvcProc = $null } if ($rc1CliProc) { $rc1CliProc.Dispose(); $rc1CliProc = $null } # Read pre-upgrade credentials $rawCredsPre = [System.IO.File]::ReadAllBytes("$programDataDir\device_credentials.json") $decryptedPre = [System.Security.Cryptography.ProtectedData]::Unprotect($rawCredsPre, $entropy, [System.Security.Cryptography.DataProtectionScope]::LocalMachine) $credPre = [System.Text.Encoding]::UTF8.GetString($decryptedPre) | ConvertFrom-Json $preUpgradeDeviceId = $credPre.DeviceId Start-Sleep -Seconds 2 # 4b. Perform in-place upgrade using P1-RC2 installer (/silent without code) Write-Host " Invoking P1-RC2 installer against running P1-RC1..." -ForegroundColor White $upgradeProc = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/server=$BaseUrl" ` -PassThru -Wait # THIS WAS THE EXACT ASSERTION THAT FAILED IN RC1 (RC1-BLOCKER-01)! $upgradeSuccess = ($upgradeProc.ExitCode -eq 0) Report-Result "RC1 -> RC2 In-Place Upgrade exited with returncode 0 (RC1-BLOCKER-01 RESOLVED!)" $upgradeSuccess "ExitCode: $($upgradeProc.ExitCode)" Start-Sleep -Seconds 5 # Verify credentials retained $rawCredsPost = [System.IO.File]::ReadAllBytes("$programDataDir\device_credentials.json") $decryptedPost = [System.Security.Cryptography.ProtectedData]::Unprotect($rawCredsPost, $entropy, [System.Security.Cryptography.DataProtectionScope]::LocalMachine) $credPost = [System.Text.Encoding]::UTF8.GetString($decryptedPost) | ConvertFrom-Json Report-Result "Cross-Version Upgrade preserved DeviceId ($preUpgradeDeviceId)" ($credPost.DeviceId -eq $preUpgradeDeviceId) Report-Result "Cross-Version Upgrade preserved ClassId ($targetClassId)" ($credPost.ClassId -eq $targetClassId) # Verify Service and Client running post-upgrade $svcPost = Get-Process -Name ClassNotify.Service -ErrorAction SilentlyContinue | Select-Object -First 1 $cliPost = Get-Process -Name ClassNotify.Client -ErrorAction SilentlyContinue | Select-Object -First 1 Report-Result "Service automatically restored post-upgrade (PID: $($svcPost.Id))" ($null -ne $svcPost) Report-Result "Client automatically restored post-upgrade (PID: $($cliPost.Id))" ($null -ne $cliPost) # Send live notification post-upgrade $notifBody2 = @{ classId = $targetClassId studentName = "RC1->RC2 Upgrade Student" title = "RC1->RC2 Cross-Version Upgrade Test" message = "Automated notification verifying post-upgrade live delivery." voice = $true durationSeconds = 15 } | ConvertTo-Json $sendRes2 = Invoke-RestMethod -Uri "$BaseUrl/api/notification/send" -Method Post -Headers $teacherHeaders -Body $notifBody2 -ContentType "application/json" Report-Result "Teacher sent live notification post cross-version upgrade" ($sendRes2.success -eq $true -or -not [string]::IsNullOrWhiteSpace($sendRes2.notificationId)) Start-Sleep -Seconds 3 $latestLog2 = Get-ChildItem "$programDataDir\logs" -Filter "*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 $logContent2 = if ($latestLog2) { Get-Content $latestLog2.FullName -Tail 40 } else { "" } $logReceived2 = ($logContent2 -match "RC1->RC2 Upgrade Student" -or $logContent2 -match $sendRes2.notificationId -or $logContent2 -match "Relayed notification") Report-Result "Local Service received and processed notification after cross-version upgrade" $logReceived2 # ------------------------------------------------------------------------------ # STEP 5: Same-Version Upgrade / Repair (RC2 -> RC2) # ------------------------------------------------------------------------------ Write-Host "`n>>> [5/9] Same-Version Upgrade / Repair (RC2 -> RC2)..." -ForegroundColor Yellow $repairProc = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/server=$BaseUrl" ` -PassThru -Wait Report-Result "Same-version repair installer exited with returncode 0" ($repairProc.ExitCode -eq 0) "ExitCode: $($repairProc.ExitCode)" Start-Sleep -Seconds 5 $repairSvc = Get-Process -Name ClassNotify.Service -ErrorAction SilentlyContinue | Select-Object -First 1 $repairCli = Get-Process -Name ClassNotify.Client -ErrorAction SilentlyContinue | Select-Object -First 1 Report-Result "Service active after same-version repair (PID: $($repairSvc.Id))" ($null -ne $repairSvc) Report-Result "Client active after same-version repair (PID: $($repairCli.Id))" ($null -ne $repairCli) # ------------------------------------------------------------------------------ # STEP 6: Real Fail-Closed Negative Test # Demonstrates that an unkillable/residual ClassNotify process causes immediate fail-closed abort # WITHOUT overwriting the installed binaries! # ------------------------------------------------------------------------------ Write-Host "`n>>> [6/9] Real Fail-Closed Negative Test (Stubborn Process Blocks Upgrade)..." -ForegroundColor Yellow $canaryFile = "$installDir\canary.marker" [System.IO.File]::WriteAllText($canaryFile, "PRE_TEST_CANARY_INTEGRITY_CHECK") $serviceDllPath = "$installDir\Service\ClassNotify.Service.dll" $origServiceDllMtime = (Get-Item $serviceDllPath).LastWriteTimeUtc # Launch a stubborn standalone mock process named ClassNotify.Service $tempDir = "$env:TEMP\FailClosedMock_" + [Guid]::NewGuid().ToString("N") New-Item -ItemType Directory -Path $tempDir -Force | Out-Null $mockServiceExe = "$tempDir\ClassNotify.Service.exe" Copy-Item "C:\Windows\System32\cmd.exe" $mockServiceExe -Force $mockProc = Start-Process -FilePath $mockServiceExe -ArgumentList "/c ping -n 35 127.0.0.1 > NUL" -PassThru Start-Sleep -Milliseconds 500 $stubbornActive = ($mockProc.ProcessName -eq "ClassNotify.Service" -and -not $mockProc.HasExited) Report-Result "Stubborn mock process spawned with name '$($mockProc.ProcessName)' (PID: $($mockProc.Id))" $stubbornActive # Now attempt upgrade with RC2 installer: must FAIL CLOSED with exit code 1! $failClosedProc = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/server=$BaseUrl" ` -PassThru -Wait $failedAsExpected = ($failClosedProc.ExitCode -eq 1) Report-Result "Fail-closed check: installer aborted with non-zero exit code (1)" $failedAsExpected "ExitCode: $($failClosedProc.ExitCode)" # Stop mock process immediately and clean up try { $mockProc.Kill(); $mockProc.WaitForExit(1000); } catch { } Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue # Verify payload extraction was aborted before touching files: $canaryStillPresent = Test-Path $canaryFile $mtimeUnchanged = ((Get-Item $serviceDllPath).LastWriteTimeUtc -eq $origServiceDllMtime) $setupLogContent = Get-Content "$programDataDir\setup.log" -Tail 30 -ErrorAction SilentlyContinue $failClosedLogged = [bool]($setupLogContent -match "Installation failed") Report-Result "Fail-closed check: Canary file preserved (Payload extraction NEVER began)" $canaryStillPresent Report-Result "Fail-closed check: Core binaries intact and untouched" $mtimeUnchanged Report-Result "Fail-closed check: Expected fail-closed abort message recorded in setup.log" $failClosedLogged Remove-Item $canaryFile -Force -ErrorAction SilentlyContinue # ------------------------------------------------------------------------------ # STEP 7: GUI Smoke Test on Existing Installation # ------------------------------------------------------------------------------ Write-Host "`n>>> [7/9] GUI Smoke Test on Existing Installation..." -ForegroundColor Yellow # Launch installer in GUI mode (no /silent) $guiProc = Start-Process -FilePath $RC2InstallerPath -PassThru Start-Sleep -Seconds 3 $guiRunning = ($null -ne (Get-Process -Id $guiProc.Id -ErrorAction SilentlyContinue)) Report-Result "GUI Installer successfully launched for interactive upgrade inspection" $guiRunning "PID: $($guiProc.Id)" # Cleanly close GUI window try { $guiProc.CloseMainWindow() | Out-Null Start-Sleep -Seconds 1 } catch { } if (-not $guiProc.HasExited) { Stop-Process -Id $guiProc.Id -Force -ErrorAction SilentlyContinue } # ------------------------------------------------------------------------------ # STEP 8: Clean Uninstallation Verification # ------------------------------------------------------------------------------ Write-Host "`n>>> [8/9] Executing Clean Uninstallation Scenario (/silent /uninstall)..." -ForegroundColor Yellow $uninstallProcess = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/uninstall" ` -PassThru -Wait Report-Result "Uninstaller exited with returncode 0" ($uninstallProcess.ExitCode -eq 0) "ExitCode: $($uninstallProcess.ExitCode)" Start-Sleep -Seconds 5 $procsPostUninstall = @(Get-Process -Name ClassNotify.Client, ClassNotify.Service -ErrorAction SilentlyContinue).Count $svcPostUninstall = [bool]((sc.exe query ClassNotifyService 2>&1) -match "1060|FAILED") $installDirPostUninstall = -not (Test-Path "$installDir\Service\ClassNotify.Service.exe") Report-Result "Post-Uninstall: processes terminated (Count: $procsPostUninstall)" ($procsPostUninstall -eq 0) Report-Result "Post-Uninstall: Service deleted from Windows Service Control Manager" $svcPostUninstall Report-Result "Post-Uninstall: Application binaries removed from Program Files" $installDirPostUninstall # ------------------------------------------------------------------------------ # STEP 9: Final Re-Installation for Subsequent Gate RC-2 Readiness # ------------------------------------------------------------------------------ Write-Host "`n>>> [9/9] Re-installing Clean RC2 Instance for Gate RC-2 Readiness..." -ForegroundColor Yellow # Uninstallation with keepCredentials=true retains device binding. Reinstall directly in /silent mode: $finalInstallProcess = Start-Process -FilePath $RC2InstallerPath ` -ArgumentList "/silent", "/server=$BaseUrl" ` -PassThru -Wait Report-Result "Final re-installation exited with returncode 0" ($finalInstallProcess.ExitCode -eq 0) "ExitCode: $($finalInstallProcess.ExitCode)" Start-Sleep -Seconds 5 $readySvc = (Get-Service -Name ClassNotifyService -ErrorAction SilentlyContinue).Status -eq 'Running' $readyCli = @(Get-Process -Name ClassNotify.Client -ErrorAction SilentlyContinue).Count -gt 0 Report-Result "Host restored to operational state for Gate RC-2 (Service Running: $readySvc, Client Running: $readyCli)" ($readySvc -and $readyCli) # ------------------------------------------------------------------------------ # SUMMARY # ------------------------------------------------------------------------------ Write-Host "`n==========================================================" -ForegroundColor Cyan Write-Host " Gate RC-1 Acceptance Test Summary: $passed Passed, $failed Failed" -ForegroundColor $(if ($failed -eq 0) { "Green" } else { "Red" }) Write-Host "==========================================================" -ForegroundColor Cyan if ($failed -gt 0) { throw "Gate RC-1 FAILED with $failed assertion failures!" } exit 0