This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

published

Cisco Live! DEVWKS-2595: Stateful Network Validation using pyATS/Genie

This repository contains the files required for the participants of
Cisco Live! workshop
DEVWKS-2595: Stateful Network Validation using pyATS/Genie.

Note: This workshop can be completed at home.

All files required are included in this repository. You do not need physical
devices - mock devices are provided.

General Information

Requirements

  • Mac OSX, Linux or Windows 10 WSL
  • Python 3.5, 3.6 or 3.7
  • Network connectivity (for downloading PyPI packages)
  • Working knowledge of Python is a plus, but not required.

Preparation Instructions

Note:

For those attending Cisco Live! Workshop in person, these instructions
have already been performed on the laptop you are using in front of you.

Step 1: Create a Python Virtual Environment

In a new terminal window:

# go to your workspace directory
# (or where you typical work from)
cd ~/workspace

# create python virtual environment python3 -m venv devwks-2595

# activate virtual environment cd devwks-2595 source bin/activate

# update your pip/setuptools pip install --upgrade pip setuptools

Step 2: Install pyATS & Genie

# install our packages 
pip install pyats[full]

Note:

The install target pyATS[full] performs a full installation, that is,
including the core framework pyATS, the standard libraries Genie, and
additional components such as RobotFramework support etc.

Step 3: Clone This Repository

# clone this repo
git clone https://github.com/CiscoTestAutomation/CL-DevNet-2595.git workshop

# cd to the directory cd workshop

and now you should be ready to get going!

Head to the >Main Workshop< to start!


Repository Content

    testbed.yaml                      testbed YAML file to connect to our devices
    robot_initial_snapshot/           Directory with RobotFramework script to gather the first snapshot
    robot_compare_snapshot/           Directory with RobotFramework script to collect the second snapshot and compare with the initial snapshot
    mocked_devices/                   Data for the mocked devices.
    README.md                         Introduction text for this Workshop
    workshop.md                       Workshop instruction

Use Case

Are you interested in NetDevOps validation, but haven't yet picked up coding/programming in Python?

Cisco pyATS | Genie features shell CLI commands that enable you to leverage the power of the available parsers and models and make intuitive decisions about your network, without having to write a single line of Python code.

This is a great way to get into validation and testing - start with comparing your device states and letting the libraries do the heavy lifting. Of course, the libraries on GitHub: CiscoTestAutomation are open-source, so when it comes time for you to move up to the next level and start coding your own - it's a great reference!

This repository is a self-guided replay of the workshop that has taken place in Cisco Live Europe 2019. You can run it straight on your laptop, without connecting to any real devices - the tutorial session uses Python mock devices.

Objectives

  • pyATS is a foundation-layer test framework. It is designed to provide a reasonable end-to-end test environment for developers to write use cases.
  • Genie extends its capabilities and specializing in network device automation and validation.
  • With this use case, you will be able to validate the state of networks, using pyATS CLI and Genie robot.

Tutorial

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.