What is a pyATS testbed file, and why is it so central?
A YAML file (or a YAML/Python combination) describing the devices under test: names, OS, type and how to connect. pyATS uses it to load the right library APIs for each device and to know how to talk to it.
Before pyATS can test anything, it needs to know what exists and how to reach it. The testbed answers that. A minimal one:
testbed:
name: simple_testbed
devices:
Router1:
os: iosxe # tells Genie which parsers/APIs to load
type: router
connections:
cli:
protocol: ssh
ip: 192.168.1.1
The os field is the important one. It is how the framework picks the right set of library APIs for each device, since show ip interface brief output on IOS XE looks different from NX-OS.
The testbed is the essential input for the rest of the pyATS ecosystem. For large topologies these files get long, deeply nested and complex.
Related terms: a pyATS script is a Python file in which pyATS tests are declared. The test syntax is inspired by unit-testing frameworks such as pytest: it supports assertions (for example that a variable has a certain value) and can also report results explicitly.
Go deeper:
Creating Topology — pyATS documentation — the full testbed YAML schema with examples.