This repository contains two test cases built using Cisco pyATS + Genie, targeting IOS and IOS-XE routers. These tests validate ping connectivity and static route consistency across two routers.
| Router Name | Platform | IP Address | OS | Protocol |
|---|---|---|---|---|
| iosv-0 | IOS | 192.168.30.182 | ios | SSH |
| csr1000v-0 | IOS-XE | 192.168.30.183 | iosxe | SSH |
Both routers must be reachable over SSH and allow CLI access for ping and show ip route.
✅ Overview
Devices:
iosv-0 – 192.168.30.182 (IOS)
csr1000v-0 – 192.168.30.183 (IOS-XE)
- Command:
ping 100.1.1.1 - Validation: Verifies the ping result contains the string
"Success rate is 100 percent" - Pass Criteria: Both routers must return exactly 100% success rate
- Fail Criteria: Any router with less than 100% will fail the test
Testcases:
Ping 100.1.1.1 and verify "Success rate is 100 percent"
Compare static routes ("S") from show ip route
- Command:
show ip route - Validation:
- Extracts all routes starting with
"S"(Static routes) - Compares the route prefixes from both routers
- Extracts all routes starting with
- Pass Criteria: Static routes must match exactly
- Fail Criteria: Any mismatch in static route prefixes causes the test to fail
🔒 Requirements
Python 3.8+
pyATS and Genie installed: pip install pyats[full]
SSH access to routers with valid credentials
Static routes configured on both routers (if test 2 is expected to pass)
📦 Future Enhancements
Add retry logic for ping
Support for dynamic route types (O, B, E, etc.)
Use Genie parsers instead of CLI regex for better accuracy