I am in a project where I have to automate some tasks and for this the program must connect via SSH to some routers. My question is, how should I test this function? How can i simulate the ssh connection to the router and probe scenarios?
the function is something like this:
from jnpr.junos import Device
from lxml import etree
user = 'some_user'
password = 'some_password'
host = 'some_router_IP'
with Device(host=host , user=user, password=password) as jdev:
rsp = jdev.rpc.get_interface_information()
with the response saved in the variable "rsp" calculations are made to show statistics of the network.