In this lesson, you will learn:
- What is Nornir and NAPALM?
- The use-case that this integration can be applied to.
- A code walkthrough of the integration.
You can find the scripts and code for this lesson within the Pytest repo under the directory: 005_integrations/002_nornir.
Integration Overview
The integration we will cover first will be based on Nornir and NAPALM. For those of you who are new to Nornir and NAPALM:
Nornir
Nornir (from the creator of Napalm, David Barrasso) is a pluggable multi-threaded framework with inventory management to help operate collections of devices. Nornir is 100% Python. Whereas many automation frameworks (such as Ansible) use their own domain-specific language (DSL), Nornir lets you control everything from Python.
NAPALM
NAPALM (Network Automation and Programmability Abstraction Layer with Multi-vendor support) is a Python library that implements a set of functions to interact with different network device operating systems using a unified API.
Key Points
Our integration will therefore be based on the following (diagram below):
- NAPALM getters will be used to collect data from our devices and return the data in a normalized/vendor-agnostic format.
- Nornir will be used to run NAPALM against our devices using a static-based inventory.
- Multi-layer parametrization will be used within Pytest to dynamically generate the required tests.
- We will perform tests to validate the CPU and memory usage, and also the interface errors across a multi-vendor (Cisco, Juniper and Arista) network.