Network Unit Testing System (NUTS)

Warning

This integration is experimental. Please report any issues you encounter on the NUTS GitHub repository.

NUTS is a Pytest plugin that enables automated network testing using simple YAML files. It’s ideal for validating your network configuration and state.

  • Add the following lines to the lab topology file to use NUTS with netlab:

tools:
  nuts:

Then use one of the following commands to interact with the test container:

  • netlab connect nuts — Opens a shell in the NUTS Docker container for manual test execution and debugging.

  • After connecting:

    • pytest — Runs the tests inside the NUTS Docker container.

    • pip install <pkg> — Install additional Python packages. For example NAPALM Community Drivers.

All necessary files (including default test templates) are created in the nuts/ directory and mounted automatically into the container.

Test Drivers and Compatibility

NUTS built-in Test Bundles rely on NAPALM and Netmiko drivers to interact with network devices. It is primarily tested with standard NAPALM drivers, ensuring wide compatibility across multiple platforms (e.g., Cisco IOS, Juniper JunOS, Arista EOS).

Where to Find and Customize Tests

When you generate a lab with NUTS enabled, the system creates default test cases in the nuts/test/ directory. These are meant as starting templates, and you should customize them based on your specific testing requirements.

You can:

  • Modify existing YAML test files.

  • Add new YAML files with test parameters for different features.

  • Write your own NUTS test bundles.

  • If needed, you can also write custom Pytest tests in the nuts/test/ directory.