Avalanche Automation: How to convert SPF file into TCL scripts with Avalanche TCL API


Doc ID    SOL13565
Version:    2.0
Status:    Published
Published date:    10/24/2017
Created Date:    10/10/2017
 

Objective/Summary

  • Objective is to import configurations from a SPF file and export it as a TCL script by using TCL API.

Environment/Versions

  • Avalanche Commander 4.78
  • C100-U
  • TCL API
  • Windows Command Prompt / Powershell

Procedure

###################################################################################
# Comments: This sample script imports configurations from SPF file and export it as a TCL script
# Author : Masaya Otsu
# Spirent Communication
# Date : October 10, 2017
# ###################################################################################

%set auto_path [linsert $auto_path 0 "C:/Program Files (x86)/Spirent Communications/Spirent TestCenter 4.78/Layer 4-7 Application/TclAPI"]
 
%package require av
%av::login tmp
 
%av::perform import system1 -source {C:\Users\motsu\Desktop\tcl\automation/B2B.spf}
project1
%av::get project1 -tests
test1
 
%av::get project1.test1 -configuration
testspec1
%av::get get project1.test1.testspec1 -topology
topology1
%av::get project1.test1.testspec1.topology1 -interface
interface1 interface2
 
% av::get project2.test1.testspec1.topology1.interface1 -port
10.75.236.153/1/15
% av::get project2.test1.testspec1.topology1.interface2 -port
10.75.236.153/1/16
 
//Finally, you can connect to the appliance without actually opening the SPF file via GUI to find it out.
av::connect 10.75.236.153 -type appliance
 
av::perform ConvertToTclDetailed test1 -outputDirectory "C:/tmp/output" -tclApiDirPath "C:/Program Files (x86)/Spirent Communications/Spirent TestCenter 4.78/Layer 4-7 Application/TclAPI"
 

Find Answers

Specified Languages
English
中文

Please Sign In

Username
Password

Did you forget your password?
Click here for assistance

New user? Start here.