ci-server-engineer/examples/CI-Eng-Sample/shared/test_r105.ps1
cliu 39e58af2ff R1.05 V4: reduced CI-Eng-Sample load tested and removed on shared server
Classes, sub-items, Modbus loopback and OPC UA loopback pass on R1.05.
New examples/CI-Eng-Sample/shared/: snapshot, reduced load/remove,
test and DSS temp-file cleanup scripts for shared servers. Before/after
snapshot identical; ISS-091 (dss_*.tmp left in tls\lst); ISS-080 note.
Certificate files of the test await deletion by the user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:10:26 +11:00

36 lines
2 KiB
PowerShell

# Functional test of the reduced CI-Eng-Sample load on R1.05. Starts the Modbus slave mirror only
# for the duration of the test and stops it again.
$P = 'CI-Eng-Sample'
function V($n) { (& itmval -g -n "$P.$n" 2>&1 | Out-String).Trim() -replace '\s+', ' ' }
function W($n, $v) { $null = & itmval -p -n "$P.$n" -v $v 2>&1 }
"--- start Modbus slave mirror"
$mem = Start-Process -FilePath eqpmdcmem -ArgumentList '-n','EQPMDCMEM' -WindowStyle Hidden -PassThru
Start-Sleep 3
$slv = Start-Process -FilePath eqpmdcslvtcp -ArgumentList '-n','EQPMDCSLVTCP','-p','5020' -WindowStyle Hidden -PassThru
"mirror pids $($mem.Id) $($slv.Id)"
"--- classes and sub-items"
"COUNTER t0: $(V 'DEMO.COUNTER')"; Start-Sleep 3; "COUNTER t3: $(V 'DEMO.COUNTER')"
W 'TANK1.LEVEL' 50; W 'TANK1.INFLOW' 120; Start-Sleep 3
"TANK1.CALC.VOLUME (expect 100): $(V 'TANK1.CALC.VOLUME')"
"TANK1.JFLOW.sPerMin (expect 2): $(V 'TANK1.JFLOW.sPerMin')"
"TANK1.LEVEL.MAX: $(V 'TANK1.LEVEL.MAX')"
"--- wait 45 s for Modbus station and OPC UA client"
Start-Sleep 45
W 'PLC1.SETPOINT' 1234; Start-Sleep 4
"PLC1.READBACK (expect 1234): $(V 'PLC1.READBACK')"
"PLC1.COMM_OK (expect 1): $(V 'PLC1.COMM_OK')"
"--- eqpdbg slave info"
('3', '1', '-1') -join "`n" | & eqpdbg 0 EQPCIENG 2>&1 | Select-String -Pattern 'scan status|Slave name|name|Line status|Good|requests' | Select-Object -First 12 | ForEach-Object { $_.Line.Trim() }
"--- OPC UA loopback"
"UA.COMM_OK: $(V 'UA.COMM_OK')"
"UA.SRV_STATE: $(V 'UA.SRV_STATE')"
"UA.LEVEL_COPY: $(V 'UA.LEVEL_COPY')"
$pki = $env:TLS_ALLUSERS_PATH + '\pki'
"client rejected: " + ((Get-ChildItem "$pki\opxuac\pkiclient\rejected" -File -ErrorAction SilentlyContinue | ForEach-Object Name) -join '; ')
"server rejected: " + ((Get-ChildItem "$pki\opxuas\pkiserver\rejected" -File -ErrorAction SilentlyContinue | ForEach-Object Name) -join '; ')
"--- stop mirror"
& durstp -msk -t 10 -p EQPMDCSLVTCP 2>&1 | Out-Null
& durstp -msk -t 10 -p EQPMDCMEM 2>&1 | Out-Null
Start-Sleep 2
"mirror still running: " + ((Get-Process -Id $mem.Id, $slv.Id -ErrorAction SilentlyContinue | ForEach-Object Id) -join ' ')