Аноним

Изменения

Groovy

2135 байт добавлено, 12:56, 22 апреля 2016
Нет описания правки
Примеры:
* <code>withTimeoutMs 7000 expect "# "</code>
 
 
= Примеры скриптов =
 
== CommutatorLogin ==
<pre>
expect "sername:"
sendLine login
expect "assword:"
sendLine password
expect prompt
</pre>
 
== PortAuth ==
<pre>
(olt_port, onu_number) = port_number.tokenize(':')
sendLine "con t"
expect prompt
sendLine "interface gpon-olt_$olt_port"
expect prompt
sendLine "no onu $onu_number"
withTimeout 30, SECONDS expect prompt
 
if (onu_sn != null) {
sendLine "onu $onu_number type $onu_model sn $onu_sn"
expect prompt
sendLine "exit"
expect prompt
sendLine "interface gpon-onu_$port_number"
expect prompt
sendLine "tcont 1 name T1 profile 500M"
expect prompt
sendLine "gemport 1 unicast tcont 1 dir both"
expect prompt
sendLine "service-port 1 vport 1 user-vlan $vlan_number vlan $vlan_number"
expect prompt
sendLine "name $port_name"
expect prompt
sendLine "port-location format flexible-syntax vport 1"
expect prompt
sendLine "dhcp-option82 enable vport 1"
expect prompt
sendLine "dhcp-option82 trust true replace vport 1"
expect prompt
sendLine "ip dhcp snooping enable vport 1"
expect prompt
sendLine "security storm-control broadcast rate 200 direction ingress vport 1"
expect prompt
sendLine "security storm-control broadcast rate 200 direction egress vport 1"
expect prompt
sendLine "security storm-control unknowncast rate 200 direction ingress vport 1"
expect prompt
sendLine "security storm-control unknowncast rate 200 direction egress vport 1"
expect prompt
sendLine "no shutdown"
expect prompt
sendLine "exit"
expect prompt
sendLine "pon-onu-mng gpon-onu_$port_number"
expect prompt
sendLine "interface eth eth_0/1 state lock"
expect prompt
sendLine "service HSI type internet gemport 1 cos 0 vlan $vlan_number"
expect prompt
sendLine "vlan port eth_0/1 mode tag vlan $vlan_number priority 0"
expect prompt
sendLine "loop-detect ethuni eth_0/1 enable"
expect prompt
Thread.sleep(5000)
sendLine "interface eth eth_0/1 state unlock"
expect prompt
}
 
sendLine "exit"
expect prompt
sendLine "exit"
expect prompt
</pre>
 
== CommutatorLogout==
<pre>
sendLine 'exit'
</pre>