← 返回命令列表

Linux command

pyats 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run test script

pyats run job [job.py]

Parse device output

pyats parse "[show version]" --testbed [testbed.yaml]

Learn device feature

pyats learn [interface] --testbed [testbed.yaml]

Compare states

pyats diff [snapshot1] [snapshot2]

Shell with testbed

pyats shell --testbed [testbed.yaml]

Validate testbed

pyats validate testbed [testbed.yaml]

Create testbed

pyats create testbed interactive

说明

pyats (Python Automated Test System) is Cisco's open-source network test automation framework for validating network device configurations and behavior. It uses YAML testbed files to define network topology, device connections, and credentials, providing a structured approach to automated network testing. The framework includes a powerful parsing engine (Genie) that converts unstructured CLI output from show commands into structured Python dictionaries across hundreds of device types. The learn feature captures comprehensive device state for features like interfaces, routing tables, and VLANs, while diff compares snapshots taken at different times to identify configuration drift or changes after maintenance windows.

参数

run
Execute test jobs.
parse
Parse command output.
learn
Learn device state.
diff
Compare snapshots.
shell
Interactive shell.
validate
Validate configuration.
create
Create configurations.
logs
Manage test logs.
--testbed _FILE_
Testbed YAML file.
--device _NAME_
Specific device.
--output _DIR_
Output directory for results.

FAQ

What is the pyats command used for?

pyats (Python Automated Test System) is Cisco's open-source network test automation framework for validating network device configurations and behavior. It uses YAML testbed files to define network topology, device connections, and credentials, providing a structured approach to automated network testing. The framework includes a powerful parsing engine (Genie) that converts unstructured CLI output from show commands into structured Python dictionaries across hundreds of device types. The learn feature captures comprehensive device state for features like interfaces, routing tables, and VLANs, while diff compares snapshots taken at different times to identify configuration drift or changes after maintenance windows.

How do I run a basic pyats example?

Run `pyats run job [job.py]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does run do in pyats?

Execute test jobs.