Installation of NUTS

Installation Instructions

Nuts requires Python 3.8 or higher.

Installation via pip

NUTS is published on the Python Package Index (PyPI), therefore you can install nuts using pip:

pip install nuts

Installation via poetry

Nuts uses poetry as a dependency manager.

  1. Install poetry.

  2. Clone the nuts repository

  3. Change into the cloned folder, then install all necessary dependencies: $ poetry install

  4. Install nuts: $ pip install .

Installation via container

Nuts is also available in a dockerized version. It uses the GitHub registry.

docker pull ghcr.io/network-unit-testing-system/nuts:latest
docker run -it ghcr.io/network-unit-testing-system/nuts

Parsing with ntc-templates

In order to parse answers from network devices, some NUTS test classes use netmiko in combination with ntc-templates (ntc-templates: TextFSM Templates for Network Devices). These NUTS tests rely on ntc-templates:

  • TestNetmikoCdpNeighbors

  • TestNetmikoOspfNeighborsCount

  • TestNetmikoOspfNeighbors

If you run these test classes, please make sure to configure access to ntc-templates correctly:

  1. Clone the ntc-templates repository into your project root, on the same hierarchical level as your inventory and tests folder.

  2. Set environment variable:

$ export NET_TEXTFSM=/path/to/ntc-templates/templates/

More on Netmiko and TextFSM

Deinstallation

pip uninstall nuts

If you installed everything in a virtual environment, you can delete the folder that contains the virtual environment.