# rig_relay.ps1 -- end-to-end back-to-back mission regression for the relay fix. # # Starts the REAL relay (btconsole.py --relay --manual-launch) plus two real pods. # Operator commands are then issued over the relay's CONTROL PORT (1507) by # ctl.py -- the same channel a remote operator uses, which also exercises the new # 'rearm' command. Records only the PIDs it spawns; teardown kills exactly those. $ErrorActionPreference = 'Continue' $repo = 'C:\git\bt411' $content = Join-Path $repo 'content' $exe = Join-Path $repo 'build\Release\btl4.exe' $scratch = 'C:\Users\EPILECTRIK\AppData\Local\Temp\claude\C--git-bt411\89ab96e9-6cf0-4555-939d-05bf3708745a\scratchpad' $pidfile = Join-Path $scratch 'rig_relay_pids.txt' $relaylog = Join-Path $scratch 'rig_relay.log' $pre = @(Get-Process -Name btl4 -ErrorAction SilentlyContinue) if ($pre.Count -gt 0) { "ABORT: btl4 already running ($($pre.Id -join ','))"; exit 1 } Remove-Item $relaylog -ErrorAction SilentlyContinue $pids = @() $relay = Start-Process -FilePath 'python' ` -ArgumentList '-u', (Join-Path $repo 'tools\btconsole.py'), '--relay', '1500', (Join-Path $content 'FOGDAY.EGG'), '--bind', '127.0.0.1', '--manual-launch' ` -WorkingDirectory $content -PassThru ` -RedirectStandardOutput $relaylog ` -RedirectStandardError (Join-Path $scratch 'rig_relay.err') $pids += $relay.Id Start-Sleep -Seconds 3 "relay pid=$($relay.Id) log=$relaylog" $env:BT_START_INSIDE = '1' $env:BT_DEV_GAUGES = '1' $env:BT_RELAY = '127.0.0.1:1500' $env:BT_MATCHLOG = '0' $env:BT_LOG = 'r_a.log'; $env:BT_SELF = '127.0.0.1:1502' $a = Start-Process -FilePath $exe -ArgumentList '-egg','FOGDAY.EGG','-net','1502' ` -WorkingDirectory $content -PassThru $pids += $a.Id Start-Sleep -Seconds 2 $env:BT_LOG = 'r_b.log'; $env:BT_SELF = '127.0.0.1:1602' $b = Start-Process -FilePath $exe -ArgumentList '-egg','FOGDAY.EGG','-net','1602' ` -WorkingDirectory $content -PassThru $pids += $b.Id Set-Content -Path $pidfile -Value $pids "pods: a=$($a.Id) b=$($b.Id) (pids recorded in $pidfile)"