question

satheesh avatar image
satheesh asked DebbieLandis edited

Landslide python runningTest sample script automation

How to automate to run a script in landslide using python. Kindly help refer the below screenshot which we use to do manually

Looking for a stub code which uses python to run a landslide script. Any pointers would help

automationpythonLandslidepython script
ls-1.png (181.2 KiB)
10 |950

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

DebbieLandis avatar image
DebbieLandis answered DebbieLandis edited

Hi @satheesh,

Just FYI, Spirent won't support this script solution, as it is not part of the Landslide product line nor a formal feature, but I hope you find it useful: Note <dot> replaces . in the instructions, otherwise the filename is detected as a link.

  1. Install python
  2. Copy files linked here to home directory
  3. set path to python
  4. Set TAS information in SpirentTAS<dot>txt file (enter TAS IP, username and password)
  5. Besides Start test session and Stop test session; define your REST-API commands in LandslideRest<dot>py
  6. Invoke your command by typing: cmdline_rest<dot>py -t <session> -a <command>
  7. Example: cmdline_rest<dot>py -t rest_test4 -a start

ZIP file attached. rest-start-stop.zip

Debbie


10 |950

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

satheesh avatar image
satheesh answered satheesh edited

Hi, the link is inaccessible for me. Kindly provide the access or attach the script here.

10 |950

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

DebbieLandis avatar image
DebbieLandis answered

Hi @satheesh,

There is no "Save as Python" option in the test session FILE menu, like there is for "Save as Tcl", however, there is a sample Python script in SOL 13739 with which you can control the REST-API using PYTHON.

https://support.spirent.com/SpirentCSC/SC_KnowledgeView?cid=null&id=SOL13739

If you would like to open an enhancement request for more comprehensive Python support, please use the "New Support Case" when logged into the CSC home page (http://support.spirent.com).

Hope this helps!

Debbie

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.