Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › UPOC testing
- This topic has 12 replies, 3 voices, and was last updated 14 years, 9 months ago by Krishna Kumar.
-
CreatorTopic
-
December 8, 2009 at 7:04 pm #51410Krishna KumarParticipant
I have a translate completely written in TCL outside engine and a UPOC using this translate.Then a process is set up in the engine so that just to send translated messages to destination How can I test this translate using testing tool included with IDE
-
CreatorTopic
-
AuthorReplies
-
-
December 8, 2009 at 9:24 pm #70165David BarrParticipant
If it’s callable as a UPOC, you should be able to use the TPS testing tool.
-
December 10, 2009 at 6:47 pm #70166David BarrParticipant
Krishna has asked for me to elaborate on my answer.
It sounds like you’re saying that you have a TPS proc (which you refer to as a UPOC) that is calling another TCL procedure or script. You want to test your procs using the testing tool. The way that you do that is by opening the testing tool, go to the TPS tab, select the TPS proc that you want to test and a data file to test with, fill in all of the other required fields on the testing tool and click the “run command” button.
Does this help? Am I understanding what you’re trying to do?
-
December 10, 2009 at 8:13 pm #70167Mark PerschbacherParticipant
The thing I didn’t realize at first was that to see the output of the proc, you had to select Send to Proc, and choose hciroutetestshowby dest.
-
December 10, 2009 at 8:19 pm #70168David BarrParticipant
Mark, you use hciroutetestshowbydest for testing routes. For TPS procs, you can use hcitpstestshowbydisp.
-
December 10, 2009 at 8:27 pm #70169Krishna KumarParticipant
I tried the way you folks replied but I am not getting any display in Result pane.
-
December 10, 2009 at 8:37 pm #70170David BarrParticipant
Maybe you should post a screen shot.
-
December 10, 2009 at 8:38 pm #70171David BarrParticipant
Actually, if you just copy the text out of the “preview command to issue” field and post that, it might help us determine the problem.
-
December 10, 2009 at 8:44 pm #70172Krishna KumarParticipant
proc tps_upoc_chg_from_ctrc_ {args} {
global HciSite HciConnName
keylget args MODE mode
set dispList {}
switch -exact — $mode {
time {
set mIns {}
set directory [file join F:/Interfaces $HciSite $HciConnName queue]
set files [glob -directory $directory -nocomplain — *.txt]
foreach file $files {
set timestamp [clock seconds]
puts “Polled $file on [clock format $timestamp -format %m/%d/%Y] at [clock format $timestamp -format %H:%M:%S]:”
if {[::ctrc_::poll_chg_from_ctrc_ $file]} {
catch {
set mIn {}
dict set mIn FILE $file
dict set mIn LINES {}
set handle [open $file r]
while {[gets $handle line] >= 0} {
dict lappend mIn LINES $line
}
close $handle
file delete -force $file
lappend mIns $mIn
puts ” Processed:”
puts ” [tcl_::label_ [llength [dict get $mIn LINES]] line lines]”
} message
if {$message != {}} {
puts ” Error:”
puts ” $message”
}
} else {
puts ” Queued…”
}
}
set mOuts [::ctrc_::translate_chg_from_ctrc_ $mIns]
if {$mOuts != {}} {
puts “Processed [tcl_::label_ [llength $mIns] file files]:”
puts ” [tcl_::label_ [llength $mOuts] message messages]”
foreach mOut $mOuts {
set out [dict get $mOut SEGMENTS]
set outMH [msgcreate -class engine -type data -recover — [join $out r]r]
lappend dispList “CONTINUE $outMH”
}
}
}
}
return $dispList
}
-
December 10, 2009 at 9:01 pm #70173David BarrParticipant
So, this proc works on “time” mode instead of “run” mode. You need to make sure that you have that selected in the tester. You also need to make sure that you have data files in the directory referred to by the proc (f:/interfaces/ … /queue or something). Also, it looks like the proc is looking at the $HciConnName variable which will be set when the proc is called from the Cloverleaf thread, but will probably be set to something unusual when run from the testing tool, so you might need to temporarily change the “set directory” line to hardcode the full directory name of your file.
-
December 14, 2009 at 2:36 pm #70174Krishna KumarParticipant
I set up in Time Mode but still did not displaying any thing.
My set up:
Procs: tps_upoc_chg_from_ctrc_
Selected Leak Detection Time Mode selected Initial startup Interval 1 Selected Send to Proc as hcitpstestsowbydisp.
I hardcoded the directory where file is residing
This is what I am seeing as output
Command Issued: hcitpstest -r time -L -i 1 -S -c sms_ib_data -e “hcitpstestshowbydisp ” “tps_upoc_chg_from_ctrc_”
Command output:
count must be > 0
Usage: D:quovadxqdx5.4.1integratorbinhcitpstest.exe [-a] [-c caller] [-e “proc args”] [-f format]
[-i interval] [-L] [-m count] [-r runmode] [-S] [-s savebase]
[file] [“proc1 args1” … “procN argsN”]
-a = process all records in file
-c caller = caller context name
-e “proc args” = end processing config
-f format = file format specifier
-i interval = delay interval (time mode)
-m count = max msg count (time mode)
-L = do Tcl handle leak detection
-r runmode = run mode
-S = run message-less Startup
-s savebase = save file base name
file = data file (run mode)
“procN argsN” = TPS module proc and args
caller values:
ack_control
fileset_ibdel
fileset_ibdirparse
pdupoc_read
pdupoc_write
prewrite
proto_startup
proto_startup_sendfail
proto_startup_sendok
reply_gen
send_data_fail
send_data_ok
send_reply_fail
send_reply_ok
sms_fwd_data
sms_fwd_reply
sms_ib_data
sms_ib_reply
sms_ob_data
sms_ob_reply
xlt_gen
xlt_post
xlt_pre
xlt_raw
httpc_query
format values:
len10 = 10-byte length encoded
nl = newline-terminated (default)
eof = eof-terminated
runmode values:
run = ‘normal’ run mode
start = start-up mode
time = time-based mode
shutdown = shut down mode
-
December 14, 2009 at 8:35 pm #70175David BarrParticipant
It looks like this is the error: “count must be > 0”. I haven’t seen that one before, but I’d guess that you need to fill in the “max messages” field in the testing tool and try again.
-
December 15, 2009 at 5:13 pm #70176Krishna KumarParticipant
Thank you all! It worked. I really appreciate all the help
-
-
AuthorReplies
- The forum ‘Cloverleaf’ is closed to new topics and replies.