Tcl script calls the high-level API to implement its own proactive test example for instrumentation usage and host creation configuration

Source: Internet
Author: User


#设置Chassis的基本參数, including the IP address. Number of ports, etc.
Set CHASSISADDR 10.132.238.190
Set Islot 1
Set Portlist {One-by-one}; #端口的排列顺序是port1, Port2

If {[Catch {
#载入STC API Lib

Cd.. /source
#载入HLAPI Lib
source./cstc.tcl
Setlogoption-debug Enable
# Start connecting the machine
Testdevice Chassis1 $chassisAddr

# Start with two ports reserved
For {set I 0} {$i <[llength $portList]} {incr i} {
Chassis1 createtestport-portlocation $islot/[lindex $portList $i]-portname port[expr $i +1]-porttype Ethernet
}

#port1 Createsubint-subintname Vlan1
# Configure VLAN Sub-interfaces
#vlan1 Configvlanif-vlantag 300

# Create Host Object
Port1 createhost-hostname host1-ipversion ipv4-ipv4addr 192.168.34.242-ipv4addrgateway 192.168.34.1 \
-ipv4addrprefixlen 24-flagping Enable
Port2 createhost-hostname host2-ipversion ipv4-ipv4addr 192.168.34.243-ipv4addrgateway 192.168.34.1 \
-ipv4addrprefixlen 24-flagping Enable
Saveconfigasxml "C:/host.xml"
#host1 ping-host 192.168.34.243-count 4-interval 2-result ret
Host1 ping-host host2-count 4-interval 2-result ret

Array Set Stats1 $ret
Parray Stats1

#host1 ping-host "192.168.34.244"-interval 1-result ret

#array Set Stats2 $ret
#parray stats2

After 3000

#清除測试过程中所作的全部配置和释放測试过程中占用的全部资源
Chassis1 Cleanuptest
} Err]} {
Puts "error occurred in script execution: $err"

#清除測试过程中所作的全部配置和释放測试过程中占用的全部资源
Chassis1 Cleanuptest
}

Tcl script calls the high-level API to implement its own proactive test example for instrumentation usage and host creation configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.