Topic
No replies
kbutler
kbutler
1 Post
ACCEPTED ANSWER

Pinned topic need help with expect cycle loop

‏2010-04-01T21:40:39Z |
Hi Im new to expect and was asked to write a power on power of 'cycle' test and to report pass or fail and then to continue cycleing....i borowed what i have so far and added some. but am kind of lost to it.
can some one look at and tell me or suggest, or please eddd what you think will work
source ./SMS_TAH_procs_bootcheck.exp
global CP_Mac
global CP_Port
global ipTermServ
global portNum
global my_debug

proc main {{cycle 1} {start_step 0} uut_id temp_id power_id} {
global my_debug
set my_debug 1
set timeout -1
###################################################
  1. 0 power cycle on off
#
###################################################

if {$start_step <= 0} {
puts "Starting Step 0 - CYCLE $cycle - \r"
cycle_test 1 $uut_id $power_id
sleep 3
}
set pass_in lindex $argv 0
set step_in lindex $argv 1
set fail_in lindex $argv 2

if {$pass_in < 1} {set pass_in 1}
if {$step_in < 1} {set step_in 1}
if {$fail_in < 1} {set step_in 1}

set uut_id
set power_id

if {$pass_in == 1} {
puts "\r\n"
main 1 $step_in $uut_id $power_id

if {$fail_in ==1_ {
puts "\r\n"
main 1 $step_in $uut_id $power_id

set step_in 1
set pass_in 2
set fail_in 3
}