published

pyats_ping_tests

A connectivity test starter kit for pyATS

Installation

Create virtual environment

$ python3 -m venv ping_test
$ source ping_test/bin/activate
(ping_test) $

Install prerequisites

(ping_test) $ pip install pyats[full]
(ping_test) $ pip install tabulate

Clone the repo

(ping_test) $ git clone https://github.com/automateyournetwork/pyats_ping_tests.git
(ping_test) $ cd pyats_ping_tests
(ping_test) pyats_ping_tests $ 

Reserve Cisco DevNet CML Sandbox

Cisco Modeling Labs Enterprise
https://devnetsandbox.cisco.com/RM/Diagram/Index/45100600-b413-4471-b28e-b014eb824555?diagramType=Topology

Connect to VPN

Wait for CML to fully initialize

Please confirm you can SSH to the following devices before running the pyATS job:
10.10.20.175
10.10.20.176
10.10.20.177
10.10.20.178

Run the pyATS Job

(ping_test) pyats_ping_tests $ pyats run job pyats_ping_tests_job.py

(Optional) View the logs with the pyATS Log Viewer

(ping_test) pyats_ping_tests $ pyats logs view

Make adjustments

You can adjust the number of pings

number_of_pings = 5

You can adjust the minimum, maximum, and average millisecond response times

ping_min_ms_threshold = 5
ping_max_ms_threshold = 10
ping_avg_ms_threshold = 7

Use Case

pyATS Ping Tests

Get Started with Test-Driven Automation using reachability tests with pyATS PING Parser and testing

This code has examples of hard coded IP address PING reachability tests including success rate (100%), minimum, maximum, and average millisecond response time.

This code also has examples of using CDP neighbor address PING reachability tests including success rate (100%), minimum, maximum, and average millisecond response time.

This code works with the DevNet Cisco Modeling Labs Enterprise Sandbox (see README for instructions to enable CDP on all 4 devices).

Cisco Modeling Labs Enterprise Sandbox

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.