思博伦SpirentTestcenter测试仪的自动化原理是什么?

2019-06-04 14:31:06 283

今天给大家简单介绍下思博伦SpirentTestcenter测试仪的自动化原理。

SpirentTestcenter,美国思博伦公司的网络测试仪表,覆盖以太网L2~L7层,使用过的仪表中功能最强大的。

思博伦|网络分析仪|spirent|屏蔽箱|GPS转发器|GPS信号放大器|卫星信号放大器|暗室|屏蔽房|WIFI测试|蓝牙测试|EMC|OTA

1.SpirentTestcenter的自动化测试场景 

      测试PC上的AT框架---->Tcl驱动库SIG_Teq_Stc.tcl(加载SpirentTestCenter库)-----(以太网线)----->Stc chassis

      Stc的chassis内部命令也是Tcl格式的,但调试时有个缺点,script的执行效果不能即时反应到Spirent TestCenter Application客户端操作界面上,观察结果不方面。

2.SpirentTestcenter的Tcl API组织架构    

      Spirent TestCenter 所有GUI上提供的功能都有对应的API接口,它的API组织架构是面向对象的,并且提供对诸如Tcl  Java  Perl Ruby C++等多种语言的支持.

3.Spirent TestCenter Tcl API大致格式

        STC API通过一系列command/function来操作object,操作的是chassis内部产生的object handle对象句柄,这个handle存在于整个进程之中.

        命令格式:

        FunctionName   ObjectType/ObjectHandle/DDNpath  attributeName(attributeName必须以"-"开头) attrNameValue(属性名称 值)/DANpath [Value]/relationReference

        eg:(以上三种情况)

             stc::create  Project

             stc::get $project_handle

             stc::create Project.Port    /    stc::get $project_handle.Port

             stc::get $port -location   /   stc::get $port -active -location

             stc::config $port -active false -location "//10.1.1.1/1/1"

             stc::create $streamblock -under $port  -frameconfig ""  -ethernet.EthernetII.etherType 880B  /  stc::config $project -Port.active false  /  stc::get $project -Port.active

             stc::get $port1 -children  (children里面是一对相关的对象属性)

            也有一些命令后面是直接跟一些具体的值的,如:

            stc::connect //172.168.1.1          stc::reserve //172.168.1.1/1/1          stc::sleep 5

             path的表示方式:

              • Direct-Descendant Notation (DDN)         直接子代符号

              • Descendant-Attribute Notation (DAN)

              • Indexed Notation (DDN and DAN)

           eg:

                    stc::config $project.Port -active false -location "//10.1.1.1/1/1"

                    stc::config $project -port(1).active false -port(2).active false

                    set enabled [stc::get $port1 -StreamBlock(2).enableControlPlane]

       其基本命令都是stc::xxx,这里stc::表示STC的命名空间来区分确认函数,并且函数名都小写,对象名和属性名不区分大小写

       常用的“xxx”有如下:

          apply   所有配置方面的command敲入后都要stc::apply下 

          config

          connect

          create

          delete

          disconnect

          get

          help

          log

          perform

          release

          reserve

          sleep        解释器停止执行一段时间

          subscribe

          unsubscribe

          waitUntilComplete

4.一些Stc AT时的注意事项

   (1)Stc的客户端Spirent TestCenter Application安装完成后目录下有定义Stc chassis内部Tcl命令的.tcl库文件:

       C:/Program Files/Spirent Communications/Spirent TestCenter 3.55/Spirent TestCenter Application/SpirentTestCenter.tcl.

       这个库文件需要写入到Tcl包目录下的pkgIndex.tcl,以便SIG_Teq_Stc.tcl文件里可以“package require SpirentTestCenter”找到并加载该Tcl库

   (2)Spirent TestCenter Application没有自带的Tcl interrupt,所以操作Stc时可以使用任何一个Tcl interrupt,只要把用到的库文件都加载了即可