param( [string]$ResultPath = "artifacts\c18x-service-channel-logical-channel-smoke-result.json" ) Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).ProviderPath $agentRoot = Join-Path $repoRoot "agents\rap-node-agent" $runId = "c18x-" + (Get-Date -Format "yyyyMMdd-HHmmss") $testPattern = "TestFabricClientPacketIngress(IsolatesRouteFailoverPerLogicalChannel|ReportsBoundedBackpressurePerLogicalChannel|SplitsIndependentFlowsIntoLogicalChannels)" Push-Location $agentRoot try { $output = & go test ./internal/vpnruntime -run $testPattern -v 2>&1 | ForEach-Object { $_.ToString() } $exitCode = $LASTEXITCODE } finally { Pop-Location } $passed = $exitCode -eq 0 $result = [ordered]@{ schema_version = "c18x.service_channel_logical_channel_smoke.v1" run_id = $runId test_package = "github.com/example/remote-access-platform/agents/rap-node-agent/internal/vpnruntime" test_pattern = $testPattern passed = $passed exit_code = $exitCode checks = [ordered]@{ independent_logical_channel_route_failover = [bool]($output -match "PASS: TestFabricClientPacketIngressIsolatesRouteFailoverPerLogicalChannel") bounded_backpressure_telemetry = [bool]($output -match "PASS: TestFabricClientPacketIngressReportsBoundedBackpressurePerLogicalChannel") logical_channel_split = [bool]($output -match "PASS: TestFabricClientPacketIngressSplitsIndependentFlowsIntoLogicalChannels") } output = $output } $absoluteResultPath = Join-Path $repoRoot $ResultPath New-Item -ItemType Directory -Force -Path (Split-Path -Parent $absoluteResultPath) | Out-Null $result | ConvertTo-Json -Depth 20 | Set-Content -Encoding UTF8 $absoluteResultPath if (-not $passed) { throw "C18X logical-channel smoke failed. Result: $absoluteResultPath" } Write-Host "C18X logical-channel smoke passed. Result: $absoluteResultPath" $result