pyATS Easypy

26.3 · active · verified Thu Apr 16

pyATS Easypy is the launcher and runtime environment for executing pyATS test scripts and harnesses. It provides jobfile parsing, plugin management, and the overall execution framework for network test automation. Part of the broader pyATS ecosystem from Cisco, it is actively maintained with frequent releases, currently at version 26.3, often following a monthly or bi-monthly cadence aligning with other pyATS components.

Common errors

Warnings

Install

Imports

Quickstart

Create a simple AETest script and run it using the `easypy` command-line utility. The `easypy` command acts as the main runner for pyATS test jobs. This example demonstrates a basic test with CommonSetup, a Testcase, and CommonCleanup.

import os
from pyats import aetest

class CommonSetup(aetest.CommonSetup):
    @aetest.subsection
    def initial_setup(self):
        self.parent.parameters['example_param'] = 'Hello, pyATS!'
        self.log.info(f"Running initial setup with param: {self.parent.parameters['example_param']}")

class Testcase1(aetest.Testcase):
    @aetest.test
    def example_test(self):
        param = self.parent.parameters['example_param']
        self.log.info(f"Executing example_test with param: {param}")
        assert param == 'Hello, pyATS!'

class CommonCleanup(aetest.CommonCleanup):
    @aetest.subsection
    def final_cleanup(self):
        self.log.info("Running final cleanup.")

# To run this script:
# 1. Save it as e.g., `my_test.py`
# 2. Run from your terminal: `easypy my_test.py`
# Optional: To specify a testbed (e.g., if tests use device connections):
#    `easypy my_test.py --testbed-file my_testbed.yaml`
#    For quick demo, --testbed-file isn't strictly needed for this simple test.

view raw JSON →