question

Dinesh_Shenoy avatar image
Dinesh_Shenoy asked Spirent_Admin edited

Continuing test execution when SSH login fails

I am login to devices using a SSH session. IP i am passing that thro a variable. If authenthication is failed in the middle of the execution, then i need to skip that execution and continue execution of others. Example: I am passing 10 IP's in SSH session profile from a test case with a variable. I could login to box till 3rd input. But the 4th input i cound not able to login to the box due to some authentication failure (as an example). I need to skip this execution and still continue with 5th input till 10th. Is this possible..? Will the iTest stop the execution, if it gets an error and not able to open the session?
iTestsession profilessh
10 |950

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

1 Answer

·
JeffJ avatar image
JeffJ answered JeffJ posted

Dinesh,

 

When the SSH connection fails due iTest executes a Global Event called OnTerminalOpenConnectionFail.  You can see this in the test report when you execute your test case and find a missing ip address.

 

You have the ability to modify this event.  While editing your test case, there is a tab (look at the bottom of the editor view) that is labeled "Global Events".  If you click on that tab, the editor will change to show you all the global events for that test case.  Above the list on the left, you'll see a search box.  Type "OnTerminalOpenConnectionFail" in that box and you find the global event.

 

You can change the steps by unchecking the inherit checkbox.  If you notice, one of the steps is "AbortExecution".  This is the step that is ending your test case at the point of the missing ip address.  You can remove this step and execution will continue.

 

Depending on what you want to do after the open call, you may need to set a variable and add an "if" statement to your for/foreach loop.  If the device doesn't open, you don't want to try to use it!

 

 

1 comment
10 |950

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

KumarS avatar image KumarS commented ·

You can override the event mentioned by Jeff at any level - session profile, testbed, or testcase or a step. In this case, I would suggest overriding it on the open step of the testcase.

0 Likes 0 ·

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.