Cisco pyATS (Python Automated Test System) alongside Genie forms a powerful network automation framework that complements both CLI-based and YANG-based automation tools. In this lesson, we will explore the capabilities of pyATS and Genie to understand how they enhance network testing and automation.

pyATS & Genie: A Comprehensive Overview

Originally, pyATS (Python Automated Test System) was developed as a test automation framework that could be applied across various domains, including software, hardware, security, and IoT. However, when combined with Genie, it is primarily used in network automation.

pyATS and Genie Framework
pyATS and Genie Framework

The power of pyATS + Genie in network automation revolves around four key concepts:

  1. Parsing

  2. Learning

  3. APIs

  4. Automated Test Cases

Among these, automated test cases are the core functionality of pyATS, while the other three (parse, learn, and APIs) are the main components of the Genie framework. Genie features can be used independently or in combination with automated test cases to unlock advanced network automation capabilities.

Quick Practical Definitions of pyATS & Genie Components

๐Ÿ”น Parser:
When running a network command like โ€œshow ip interface briefโ€, the output is raw text. To extract meaningful informationโ€”such as identifying which interfaces are up or downโ€”you typically need to apply regular expressions or manual text processing. However, Genie parsers eliminate this need by converting CLI outputs into structured Python data (lists & dictionaries).

Genie supports 500+ commands across 10+ network device types & vendors.

Feature pyATS (Core Framework) Genie (Enhancement Layer) Explanation
Primary Role Test Automation Framework Network Automation Toolkit pyATS is a general-purpose testing framework, and Genie extends it for network automation.
Parsing (Parser) โŒ Not available โœ… Yes Converts raw CLI output into structured JSON/Python objects.
Learning (Learner) โŒ Not available โœ… Yes Learns device/protocol state and stores structured data for before/after comparison.
APIs โŒ Limited APIs โœ… Rich APIs Provides vendor-agnostic APIs for retrieving structured data and configurations.
Automated Test Cases โœ… Core feature โœ… Enhanced with Genie Automates network tests, such as verifying connectivity, routing, and configurations.
Device & Vendor Support โœ… Supports multiple vendors โœ… 10+ vendors, 500+ commands Works across multi-vendor environments.
CLI-Based Automation โœ… Yes โœ… Yes Can execute CLI commands via SSH/Telnet.
YANG-Based Automation โœ… Yes (via NETCONF, RESTCONF) โœ… Yes (abstracted through APIs) Supports model-driven network automation.
Configuration Abstraction โŒ No direct abstraction โœ… Yes Genie provides API-based configuration abstraction across vendors.
Use Cases Testing & validation Parsing, learning, API-based automation, and validation pyATS is more focused on test automation, while Genie expands it into full network automation.

๐Ÿ”น Learner:
Genie can learn and store structured profiles of various protocols and technologies.

For example, learning the BGP profile involves running key BGP-related commands, collecting both raw and structured outputs, and storing them for analysis.

This feature enables before-and-after comparisons to detect changes in configuration, routing tables, neighbor states, or troubleshoot network issues.

๐Ÿ”น APIs:
Genie provides an abstraction layer for both configuration and monitoring, offering vendor-agnostic APIs.

For example, instead of manually running different routing commands across different vendors, a single API like get_route() can retrieve structured routing table data from multiple device types without needing to know the exact command behind it.

๐Ÿ”น Automated Test Cases:
Perhaps the most well-known (but in practice, often underutilized) feature of pyATS is its ability to automate network test cases.

You can automate post-change verifications after network modifications, such as:

  • Checking BGP & OSPF neighbors

  • Verifying route advertisements

  • Ensuring connectivity via ping/traceroute

  • Detecting configuration drift

These tests ensure network stability after updates, reducing manual effort and human error.

Summary

To summarize the operation and differences between pyATS and Genie:

  • pyATS manages inventory (called testbed in pyATS, as its primary application is running test case scripst agains these devices), establishes device connections, executes test scripts, and provides comprehensive logging and reporting.

  • Genie enhances pyATS by enabling command parsing into structured formats, learning device profiles, and simplifying automation by providing structured data for easier processing in scripts.

Together, they form a powerful framework for network testing and automation.

pyATS definition
pyATS definition

References:

Back to: Network Automation with pyATS & Genie (in Progress) > pyATS Introduction

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment