Skip to content

Commit

Permalink
doc: Update usage section (#124)
Browse files Browse the repository at this point in the history
* doc: Update usage section

* doc: Update usage section with ANTA as lib

* doc: Hide repo website URL

* cut: Remove unused files

* doc: Update content

* doc: Update content
  • Loading branch information
titom73 authored Sep 22, 2022
1 parent 39f80e4 commit 9888c49
Show file tree
Hide file tree
Showing 19 changed files with 612 additions and 520 deletions.
44 changes: 0 additions & 44 deletions .github/scripts/anta_test.py

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This repository comes with a set of [scripts](./scripts) to run __Arista Network
- `collect-eos-commands.py` to collect commands output from devices
- `collect-sheduled-show-tech.py` to collect the scheduled show tech-support files from devices

<img src="./docs/imgs/anta-getting-started.png" width="500px"></img>

In addition you have also some useful scripts to help around testing:

- `clear-counters.py` to clear counters on devices
Expand All @@ -28,7 +30,7 @@ In addition you have also some useful scripts to help around testing:
# Documentation

The documentation is published on https://arista-netdevops-community.github.io/network-test-automation/
The documentation is published on [ANTA package website](https://arista-netdevops-community.github.io/network-test-automation/)

# Contribution guide

Expand Down
62 changes: 62 additions & 0 deletions demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"host": "10.73.252.11",
"test": "verify_eos_version",
"result": "failure",
"messages": "[\"device is running version 4.27.2F-26069621.4272F (engineering build) not in expected versions: ['4.25.4M', '4.26.1F']\"]"
},
{
"host": "10.73.252.11",
"test": "verify_field_notice_44_resolution",
"result": "skipped",
"messages": "['verify_field_notice_44_resolution test is not supported on cEOSLab.']"
},
{
"host": "10.73.252.11",
"test": "verify_uptime",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_zerotouch",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_running_config_diffs",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_mlag_status",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_mlag_interfaces",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_mlag_config_sanity",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_routing_protocol_model",
"result": "success",
"messages": "[]"
},
{
"host": "10.73.252.11",
"test": "verify_bgp_ipv4_unicast_state",
"result": "success",
"messages": "[]"
}
]
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This website provides generic documentation related to the Arista Network Test Automation framework (ANTA)

<img src="./imgs/anta-getting-started.png" class="img_center"></img>

# Arista Network Test Automation (ANTA) Framework

This repository is a Python package to automate tests on Arista devices.
Expand Down
18 changes: 18 additions & 0 deletions docs/api/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ANTA Tests landing page

This section describes all the available tests provided by ANTA package.


- [Configuration](tests.configuration.md)
- [Hardware](tests.hardware.md)
- [interfaces](tests.interfaces.md)
- [MLAG](tests.mlag.md)
- [Multicast](tests.multicast.md)
- [Profiles](tests.profiles.md)
- [System](tests.system.md)
- [Software](tests.software.md)
- [Routing Generic](tests.routing.generic.md)
- [Routing BGP](tests.routing.bgp.md)
- [Routing OSPF](tests.routing.ospf.md)

Al these tests can be imported in a [catalog](../usage-inventory-catalog.md) to be used by [`check-devices.py`](../usage-check-devices.md) script.
91 changes: 91 additions & 0 deletions docs/contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# How to contribute to ANTA

!!! warning
Still a work in progress, feel free to reach out to the team.

## Install repository

`python setup.py install` is used to install packages that you're not going to modify yourself.
If you want to install the package and then be able to edit the code without having to re-install the package every time for the changes take effect, you can use `python setup.py develop`

you can also use `pip install -e .`
The `.` refers to the current working directory (the directory where is the setup.py file).
The `-e` flag specifies that we want to install in editable mode, which means that when we edit the files in our package we do not need to re-install the package before the changes come into effect. You will need to reload the package though!

Run these commands to install:

- The package [ANTA](https://github.com/arista-netdevops-community/network-test-automation/blob/master/anta) and its dependencies
- These [scripts](https://github.com/arista-netdevops-community/network-test-automation/blob/master/scripts) and the packages they required

```shell
git clone https://github.com/arista-netdevops-community/network-test-automation.git
cd network-test-automation
```

```shell
python setup.py develop
```

or

```shell
pip install -e .
```

Run these commands to verify:

```bash
pip list
check-devices-reachability.py --help
which check-devices-reachability.py
```

### Clone & Install package requirements

Run these commands to install the packages indicated in the [requirements.txt](https://github.com/arista-netdevops-community/network-test-automation/blob/master/requirements.txt) file.

```shell
# Clone repository
git clone https://github.com/arista-netdevops-community/network-test-automation.git

# Enter into the repository
cd network-test-automation

# Install requirements
pip install -r requirements.txt
```

These packages are required by:

- These [scripts](https://github.com/arista-netdevops-community/network-test-automation/blob/master/scripts)
- The package [ANTA](https://github.com/arista-netdevops-community/network-test-automation/blob/master/anta)

But this will **not** install:

- The [ANTA](https://github.com/arista-netdevops-community/network-test-automation/blob/master/anta) package
- These [scripts](https://github.com/arista-netdevops-community/network-test-automation/blob/master/scripts)

Run this command to verify:

```shell
# Check ANTA has been installed in your python path
pip list | grep anta

# Check scripts are in your $PATH
check-devices-reachability.py --help

# Find where the script is located
which check-devices-reachability.py
```

### Install dev requirements

Run the following command to install all required packages for the development process.

```shell
# Install dev requirements
pip install -r requirements-dev.txt

# Install pre-commit hook
pre-commit install
```
48 changes: 9 additions & 39 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This section shows how to use ANTA with basic configuration.
The easiest way to intall ANTA package is to run Python (`>=3.7`) and its pip package to install:

```bash
pip install git+https://github.com/arista-netdevops-community/network-test-automation.git
pip install \
git+https://github.com/arista-netdevops-community/network-test-automation.git
```

For more details about how to install package, please see the [requirements and intallation](./requirements-and-installation.md) section.
Expand All @@ -17,15 +18,19 @@ For more details about how to install package, please see the [requirements and
First, you need to configure your management interface

```eos
vrf instance MGMT
!
interface Management1
description oob_management
vrf MGMT
ip address 10.73.1.105/24
!
```

Then, configure access to eAPI:

```eos
!
management api http-commands
protocol https port 443
no shutdown
Expand All @@ -42,46 +47,9 @@ First, we need to list devices we want to test. You can create a file manually w
```yaml
anta_inventory:
hosts:
- host: 192.168.0.10
- host: 192.168.0.11
# Optional tag to assign to this device
tags: ['tag01', 'tag02']
- host: 192.168.0.12
- host: 192.168.0.13
- host: 192.168.0.14
- host: 192.168.0.15
networks:
- network: '192.168.110.0/24'
# Optional tag to assign to all devices in this subnet
tags: ['tag01', 'tag02']
ranges:
- start: 10.0.0.9
end: 10.0.0.11
# Optional tag to assign to all devices in this range
tags: ['tag01', 'tag02']
- start: 10.0.0.100
end: 10.0.0.101
- host: 10.73.1.105
```
Or you can use [create-devices-inventory-from-cvp.py](https://github.com/arista-netdevops-community/network-test-automation/blob/master/scripts/create-devices-inventory-from-cvp.py) script to generate from Cloudvision
```bash
# Available options
create-devices-inventory-from-cvp.py -h
usage: create-devices-inventory-from-cvp.py [-h] -cvp CVP -u USERNAME [-c CONTAINER] -o OUTPUT_DIRECTORY

Create devices inventory based on CVP containers

optional arguments:
-h, --help show this help message and exit
-cvp CVP CVP address
-u USERNAME CVP username
-c CONTAINER CVP container
-o OUTPUT_DIRECTORY Output directory

# Example
$ create-devices-inventory-from-cvp.py -cvp 192.168.0.5 -u arista -o inventory -c Spine
```
## Test Catalog
To test your network, it is important to define a test catalog to list all the tests to run against your inventory. Test catalog references python functions into a yaml file. This file can be loaded by anta.loader.py
Expand Down Expand Up @@ -193,3 +161,5 @@ $ check-devices.py -i .personal/avd-lab.yml -c .personal/ceos-catalog.yml --tabl
│ 10.73.252.21 │ 0 │ 1 │ 0 │ 0 │ [] │
└──────────────┴──────────────┴──────────────┴──────────────┴─────────────┴────────────────────────────┘
```

You can find more information under the __usage__ section of the website
Binary file added docs/imgs/anta-check-devices-by-host-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/anta-check-devices-by-test-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/anta-check-devices-table-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/anta-getting-started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9888c49

Please sign in to comment.