cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
291
Views
0
Helpful
1
Replies

Test Coverage for NSO

Elvin J
Level 1
Level 1

I want to create test coverage for my service packages in NSO, and my approach involves scripting inputs to test expected outputs. Consider having an input file, and the service package generates a result similar to the example below on the resource side.

 

route-policy quickstart-med
  if med eq 127 then
  set community (123:456) additive
  elseif med eq 63 then
  set community (123:789) additive
  else
  delete community in (123:123)
  endif
  pass
end-policy 

Is it possible to write such cases in Python and how? if not then What would be the preferred method for writing such cases ?




1 Reply 1

You can do this, here is an example https://networklore.com/nso-python-test-coverage/ here the author uses pytest, but you can use pyATS, pyATS is a comprehensive network automation framework that can also be used for testing NSO service packages. It offers a wide range of features for writing and executing tests, including data modeling, configuration management, and test execution.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io