# Cisco Test

> Generate Python scripts that test and validate Cisco network configurations, reachability, and protocol state. Use when the user wants to verify network behavior, run connectivity tests, or validate routing/switching state.

- Skill: `bradmccloskey/cisco-test` (Agent Skill)
- Install (CLI): `npx skillmds@latest add bradmccloskey/cisco-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bradmccloskey/cisco-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bradmccloskey (https://skillmd.com/u/bradmccloskey)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bradmccloskey/cisco-test

---


## Cisco Network Testing Scripts

Write Python scripts that test and validate Cisco network state. Follow these standards:

### Test Categories

#### Connectivity Tests
- ICMP ping sweeps across subnets
- TCP port reachability checks
- Traceroute path validation
- Latency and jitter measurement

#### Routing Validation
- Verify expected routes exist in routing table (`show ip route`)
- Validate BGP neighbor state and prefix counts
- Check OSPF neighbor adjacencies and LSA database
- Verify EIGRP neighbor table and topology
- Compare routing table against expected baseline

#### Switching Validation
- Verify VLAN assignments on ports
- Check trunk allowed VLANs and native VLAN
- Validate STP root bridge election
- Verify EtherChannel bundle state
- MAC address table validation

#### Security Validation
- Verify ACL hit counts and expected blocks/permits
- Check NAT translations are active
- Validate VPN tunnel status (ISAKMP SA, IPsec SA)
- Verify AAA authentication is working
- Check CoPP policy counters

#### Interface Checks
- Verify interface up/up state
- Check for errors/drops/CRC on interfaces
- Validate speed/duplex settings
- Monitor interface utilization

### Libraries to Use
- `netmiko` for SSH command execution
- `paramiko` for low-level SSH if needed
- `napalm` for vendor-neutral getters
- `pyats` + `genie` for structured parsing (preferred for parsing show commands)
- `textfsm` or `ttp` for custom show command parsing
- `rich` for formatted test output (pass/fail tables)
- `pytest` for structured test framework

### Script Structure
```python
# Always follow this pattern:
# 1. Load device inventory (YAML)
# 2. Define expected state
# 3. Connect and collect actual state
# 4. Compare expected vs actual
# 5. Report pass/fail with details
```

### Output Requirements
- Clear PASS/FAIL for each test case
- Show expected vs actual on failures
- Summary count at the end (X passed, Y failed)
- Support JSON output for CI/CD integration
- Log all raw command output for debugging
- Exit code 0 on all pass, 1 on any failure

