Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing testcases in example folder #749

Merged
merged 5 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# ANTA Example files

This section provides some examples about how to use ANTA as listed in [the documentation](https://anta.arista.com)

## Device Inventory

- Filename: [`inventory.yaml`](./inventory.yaml)

The file [inventory.yaml](inventory.yaml) is an example of [device inventory](https://anta.arista.com/stable/usage-inventory-catalog/#create-an-inventory-file).

## Test Catalog

- Filename: [`tests.yaml`](./tests.yaml)

The file [tests.yaml](tests.yaml) is an example of a [test catalog](https://anta.arista.com/stable/usage-inventory-catalog/#test-catalog).
This file should contain all the tests implemented in [anta.tests](../anta/tests) with arbitrary parameters.

## eos-commands.yaml file
## Commands to get from snapshot

- Filename: [`eos-commands.yaml file`](./eos-commands.yaml)

The file [eos-commands.yaml](eos-commands.yaml) is an example of input given with the `--commands-list` option to the [anta exec snapshot](https://anta.arista.com/stable/cli/exec/#collect-a-set-of-commands) command.

## ANTA runner in Python

- Filename: [`anta_runner.py`](./anta_runner.py)

The file is an example demonstrating how to run ANTA using a python script

## ANTA template for results rendering

- Filename: [`template.j2`](./template.j2)

This file is a simple Jinja2 file to customize ANTA CLI output as documented in [anta documentation](https://anta.arista.com/stable/cli/nrfu/#performing-nrfu-with-custom-reports)
33 changes: 32 additions & 1 deletion examples/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ anta.tests.bfd:
anta.tests.configuration:
- VerifyZeroTouch:
- VerifyRunningConfigDiffs:
- VerifyRunningConfigLines:
regex_patterns:
- "^enable password.*$"
- "bla bla"

anta.tests.connectivity:
- VerifyReachability:
Expand Down Expand Up @@ -574,4 +578,31 @@ anta.tests.routing:
- name: Ethernet1
mode: point-to-point
vrf: default
# level is set to 2 by default
# level is set to 2 by default
- VerifyISISSegmentRoutingAdjacencySegments:
instances:
- name: CORE-ISIS
vrf: default
segments:
- interface: Ethernet2
address: 10.0.1.3
sid_origin: dynamic
- VerifyISISSegmentRoutingDataplane:
instances:
- name: CORE-ISIS
vrf: default
dataplane: MPLS
- VerifyISISSegmentRoutingTunnels:
entries:
# Check only endpoint
- endpoint: 1.0.0.122/32
# Check endpoint and via TI-LFA
- endpoint: 1.0.0.13/32
vias:
- type: tunnel
tunnel_id: ti-lfa
# Check endpoint and via IP routers
- endpoint: 1.0.0.14/32
vias:
- type: ip
nexthop: 1.1.1.1
Loading