question

stc_amateur avatar image
stc_amateur asked ericnute commented

how to relocate ports through script

I need to relocate 10G ports to 1G ports in multiple xml files. Is there a way to do through script. I opened the xml file via notepad++ and changed the location. However 10G is entirely different from 1G. So is this proper method to do?
Spirent TestCenter (STC)xml
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjefferson avatar image
mjefferson answered mjefferson edited
# You can create a list of port locations that is larger than the number of ports # in the configuration file. set portlocationlist {10.41.3.251/1/1 10.41.3.251/1/2} stc::perform LoadFromXml -filename $filename foreach port [stc::get system1.project -children-port] location $portlocationlist { if { $port ne "" && $location ne "" } { stc::config $port -location $location } } # You only need this if you want to save the configuration back to the # same XML file. stc::perform saveAsXml -config system1 -filename [file normalize $filename]
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

stebhla avatar image
stebhla answered
When you do a GUI to TCL conversion, there will be two files generated filename.tcl (wrapper) and a logic file. You can change the location of the ports to 1G in Wrapper script and run the script. This script will be run on 1G ports
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

LarryVeilleux avatar image
LarryVeilleux answered
I don't know the exact answer but try and save two configs from the GUI as XML and compare them. Even with offline ports you can create one with a 10G port and another with a 1G port. I guess even a single config with both port types should do.
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.