Files
rdp-proxy/scripts/fabric/c18z15-live-service-channel-effective-quality-smoke.ps1
T
2026-05-12 21:02:29 +03:00

73 lines
3.2 KiB
PowerShell

param(
[string]$ApiBaseUrl = "http://192.168.200.61:18121/api/v1",
[string]$ClusterID = "cfc0743d-d960-49fb-9de8-96e063d5e4aa",
[string]$ActorUserID = "f67d943f-5397-4b3a-a229-695fe67ad700",
[string]$EntryNodeName = "test-1",
[string]$RelayNodeName = "test-3",
[string]$ExitNodeName = "test-2",
[string]$EntryBaseUrl = "http://192.168.200.61:19131",
[string]$DockerSSH = "test-docker",
[int]$InitialBatchCount = 12,
[int]$LearningBatchCount = 24,
[int]$PostChurnBatchCount = 24,
[int]$PacketsPerBatch = 8,
[int]$BatchDelayMilliseconds = 25,
[string]$ResultPath = "artifacts\c18z15-live-service-channel-effective-quality-smoke-result.json"
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$repoRoot = (Resolve-Path (Join-Path $scriptDir "..\..")).ProviderPath
$innerResultPath = "artifacts\c18z15-live-service-channel-effective-quality-inner-result.json"
$innerResultFullPath = Join-Path $repoRoot $innerResultPath
ssh $DockerSSH "docker restart rap_test_node_test_1 rap_test_node_test_2 rap_test_node_test_3 >/dev/null && sleep 5" | Out-Null
& (Join-Path $scriptDir "c18z14-live-service-channel-active-quality-shift-smoke.ps1") `
-ApiBaseUrl $ApiBaseUrl `
-ClusterID $ClusterID `
-ActorUserID $ActorUserID `
-EntryNodeName $EntryNodeName `
-RelayNodeName $RelayNodeName `
-ExitNodeName $ExitNodeName `
-EntryBaseUrl $EntryBaseUrl `
-DockerSSH $DockerSSH `
-InitialBatchCount $InitialBatchCount `
-LearningBatchCount $LearningBatchCount `
-PostChurnBatchCount $PostChurnBatchCount `
-PacketsPerBatch $PacketsPerBatch `
-BatchDelayMilliseconds $BatchDelayMilliseconds `
-ResultPath $innerResultPath
$result = Get-Content -Path $innerResultFullPath -Raw | ConvertFrom-Json
$qualityIngress = $result.telemetry.quality_entry_ingress
$preferences = @($qualityIngress.route_quality_preferences)
$decayedPreferences = @($preferences | Where-Object {
$_.raw_score_adjustment -gt $_.score_adjustment -and
@($_.reasons) -contains "service_channel_feedback_age_decay"
})
$result.schema_version = "c18z15.live_service_channel_effective_quality_smoke.v1"
$result | Add-Member -NotePropertyName c18z15_checks -NotePropertyValue ([ordered]@{
route_quality_preferences_exposed = ($preferences.Count -gt 0)
effective_score_visible = (@($preferences | Where-Object { $_.raw_score_adjustment -gt 0 -and $_.score_adjustment -gt 0 }).Count -gt 0)
decayed_effective_score_visible = ($decayedPreferences.Count -gt 0)
}) -Force
$result.passed = [bool]($result.passed -and
$result.c18z15_checks.route_quality_preferences_exposed -and
$result.c18z15_checks.effective_score_visible -and
$result.c18z15_checks.decayed_effective_score_visible)
$resolvedResultPath = Join-Path $repoRoot $ResultPath
$result | ConvertTo-Json -Depth 100 | Set-Content -Path $resolvedResultPath -Encoding UTF8
Remove-Item -Path $innerResultFullPath -Force -ErrorAction SilentlyContinue
if (-not $result.passed) {
throw "C18Z15 effective route-quality smoke failed. Result: $resolvedResultPath"
}
Write-Host "C18Z15 live service-channel effective quality smoke passed. Result: $resolvedResultPath"
$result