04-03-2023 07:15 PM
Hi all,
I have created a mock device using pyats genie library. That means my mock device has learnt all possible features of real device.
My requirement is how do I SSH the mock device from NSO , how do I onboard the mock device in NSO so that I can use the mock device in my testing. Also is mock device writable ? I mean can we push configurations into the mock device like we do in real device.
04-04-2023 12:39 AM
Not sure what mock device you referring here, you can create a LAB environment Like CML / PNET / any other and use the device to automation.
04-04-2023 06:44 AM
For development you can use netsim which simulates devices. Take a look at this learning lab https://developer.cisco.com/learning/modules/nso-labs/nso-intro/setting-up-nso/ which includes instructions to help you get started on NSO and you will have an NSO instance right away.
If you want to get closer to real devices, you can use CML as balaji suggested. There are sandboxes available along learning labs where you can test this. See Cisco DevNet Sandbox
Take a look at the learning labs available here https://developer.cisco.com/learning/search/categories/Networking/products/NSO/?contentType=track,module,lab&isDevEnvOnly=true&page=1
I would suggest to use netsim or virtual devices for your testing, since they will interact better with NSO.
04-04-2023 08:59 PM
Hi Balaji / Jesus, Thanks for your replies.
My goal or purpose here is to use a mock device in NSO for my regression testing. Because a mock device is just a recording of real device configurations in yaml format (I am talking in terms of pyATS framework). But the limitation in pyATS mock device is that the mock device (the yaml format recording of real device configs) is only readable, we can not write/ config the mock device and also I m not able to SSH the mock device in NSO , rather I can just telnet the mock device using localhost 8266 port from NSO.
As per your suggestions we can use CML devices, but the capability on which I am working is not going to work with CML devices. That needs only real devices. Also CML devices are sometimes out of sync or not reachable that affects the regression test. Hence I was planning to use a mock device concept, where we don't have dependencies on any devices , we won't have sync from issue since mock device is just a recordings of real device.
Please suggest how I Should proceed.
04-07-2023 11:04 AM
You dont have to use CML, you can run a lot of the routers as virtual versions but can skip the CML part. Take a look at https://github.com/vrnetlab/vrnetlab.
Do development on netsims and testing on virtual and physical.
04-05-2023 12:44 AM
Jesus Illescas suggested to use netsim, not CML, and that is the right answer. Netsim also has the capability of responding to commands with mocked responses, to see how, just look at the scripts within the netsim directory of a CLI NED as well as the files confd.c.cli and confd.i.cli. You could add more by copying how those scripts are done and get the mocked reponses from you pyats genie recording.
If you wanted to use the mocked device, which is started by running a script. One way would be to set up a user in linux and set them up to start that script immediately on login (in their .profile or .bashrc). Another option is that some NEDs have setting to manage devices that have to be reached via jumphosts or terminal servers. There you can specify prompts and responses (a bit like tcl expect) and so you could in the ned setting define that when it logs in it expects a linux prompt and then should start the script.
I just mention it for completeness. what you should use is netsim.
04-05-2023 02:14 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide