Skip to content

Demos, examples, content for the talk "Introduction to Writing Network Tests with pyATS"

License

Notifications You must be signed in to change notification settings

hpreston/intro-network-tests

Repository files navigation

intro-network-tests

Demos, examples, content for the talk "Introduction to Writing Network Tests with pyATS"

published

Resources

Demo Network

If you'd like to run the demo tests in this repository, first step is to reserve the network that goes along with the testbed.yaml file.

DevNet Sandbox: Cisco Network Services Orchestrator

This sandbox provides a sample network configured with interfaces, routing, etc that can be used for a variety of tests and labs.

Installing pyATS

It is recommended to review the pyATS Getting Started Guide, but you can get started quickly with this.

pip install pyats[full]

Note: you'll need to be on Linux or macOS and be in a virtualenv of Python 3.5+

Running the Sample Network Test

The folder network_test_project will check that all devices in the testbed are reachable, and that interfaces aren't showing any errors.

The testbed.yaml file is setup to look in the environment variables for the user/password for devices.

testbed:
  name: Multi Platform Network
  credentials:
    default:
      username: '%ENV{PYATS_USERNAME}'
      password: '%ENV{PYATS_PASSWORD}'
    enable:
      password: '%ENV{PYATS_PASSWORD}'
    line:
      password: '%ENV{PYATS_PASSWORD}'
    linux: 
      password: '%ENV{PYATS_PASSWORD}'

As the Sandbox is a sample network, the values for these are included in the pyats_env file in the repository. "source" it to set these variables.

source pyats_env

Now you can run the test with

pyats run job network_test_project/network_test_job.py --testbed testbed.yaml

Note: you'll need to be VPN connected to the DevNet Sandbox to run the test

To checkout the results and logs from the test, use the pyats logs view function to open a browser view.

About

Demos, examples, content for the talk "Introduction to Writing Network Tests with pyATS"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages