set Test {2001} ;#Test的窗口名称
set power {com2} ;#上下电的窗口名称
set cnt 1
while {1} {
tsend2 $power "0"
tsend2 $power "0"
after 5000
tsend2 $power "1"
tsend2 $power "1"
after 300000
tsend2 $Test "\n"
tsend2 $Test "\n"
tsend2 $Test "sy"
#连接TC口速率切换
tsend2 $Test "interface range ge0/2 to ge0/3"
after 2000
tsend2 $Test "speed 10"
after 4000
#奇数口速率切换
tsend2 $Test "interface ge0/5"
tsend2 $Test "speed 10"
after 3000
tsend2 $Test "interface ge0/7"
tsend2 $Test "speed 10"
after 3000
tsend2 $Test "interface ge0/9"
tsend2 $Test "speed 10"
after 3000
set output [tsend2 $Test "ping -vpn-instance 100 101.0.0.2" -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 101 202.0.0.2 " -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 100 1.0.0.2 " -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 102 1.0.0.1" -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 102 1.0.2.2" -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 103 1.0.2.1" -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 103 1.0.4.2" -r -t 3600 -s "H3C"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
set output [tsend2 $Test "ping -vpn-instance 101 1.0.4.1" -r -t 3600 -s "huawei"]
after 5000
set isMatch [regexp {out} $output]
# tsend "$isMatch"
if { $isMatch == 1 } {
tsend2 $Test "quit"
tsend2 $Test "quit"
tsend2 $Test "d c i i"
tsend2 $Test "d c o i"
break
# tsend "dis time all"
} else {
#tsend "dis dev"
#tsend2 $Test "quit"
#tsend2 $Test "quit"
}
puts "-------------------$cnt-------------------------------------"
set cnt [expr $cnt + 1]
}