non-asyn interface without I/O

This commit is contained in:
zimoch
2011-02-24 14:29:19 +00:00
parent 9c18afb178
commit 82066af0e0

View File

@ -0,0 +1,75 @@
#!/usr/bin/env tclsh
source streamtestlib.tcl
# Define records, protocol and startup (text goes to files)
# The asynPort "dummy" is not connected to any I/O
# Send commands to the ioc shell with ioccmd
set records {
record (ao, "DZ:test1")
{
field (DTYP, "stream")
field (OUT, "@test.proto test1 dummy")
}
}
set protocol {
Terminator = LF;
test1 {exec "dbpr %(NAME)s %i >testDummyInterface.out";}
}
set startup {
}
set debug 0
startioc
ioccmd {dbpf DZ:test1 3}
after 1000
if [catch {
set fd [open testDummyInterface.out]
set output [read $fd]
close $fd
} msg] {
puts stderr $msg
incr faults
}
set expected {ACKS: NO_ALARM ACKT: YES ADEL: 0 ALST: 0
AOFF: 0 ASG: ASLO: 0 BKPT: 00
DESC: DISA: 0 DISP: 0 DISS: NO_ALARM
DISV: 1 DOL:CONSTANT DRVH: 0 DRVL: 0
DTYP: stream EGU: EGUF: 0 EGUL: 0
EOFF: 0 ESLO: 1 EVNT: 0 FLNK:CONSTANT 0
HHSV: NO_ALARM HIGH: 0 HIHI: 0 HOPR: 0
HSV: NO_ALARM HYST: 0 INIT: 1
IVOA: Continue normally IVOV: 0 LALM: 3
LBRK: 0 LCNT: 0 LINR: NO CONVERSION LLSV: NO_ALARM
LOLO: 0 LOPR: 0 LOW: 0 LSV: NO_ALARM
MDEL: 0 MLST: 0 NAME: DZ:test1 NSEV: NO_ALARM
NSTA: NO_ALARM OIF: Full OMOD: 1 OMSL: supervisory
ORAW: 0 ORBV: 0 OROC: 0
OUT:INST_IO @test.proto test1 dummy OVAL: 3 PACT: 1
PHAS: 0 PINI: NO PREC: 0 PRIO: LOW
PROC: 0 PUTF: 1 PVAL: 3 RBV: 0
ROFF: 0 RPRO: 0 RVAL: 3 SCAN: Passive
SDIS:CONSTANT SEVR: INVALID SIML:CONSTANT SIMM: NO
SIMS: NO_ALARM SIOL:CONSTANT STAT: UDF TIME: <undefined>
TPRO: 0 TSE: 0 TSEL:CONSTANT UDF: 0
VAL: 3
}
if {"$output" != "$expected"} {
puts stderr "Wrong output:"
puts stderr "$output"
puts stderr "instead of:"
puts stderr "$expected"
incr faults
} else {
file delete testDummyInterface.out
}
finish