Skip to content

Commit

Permalink
Merge branch 'main' into public-repo-secret-scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Jun 12, 2024
2 parents 2ed3140 + 0202460 commit 4f8f935
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 23 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Arista Network Test Automation (ANTA) Framework

| **Code** | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Numpy](https://img.shields.io/badge/Docstring_format-numpy-blue)](https://numpydoc.readthedocs.io/en/latest/format.html) |
| **Code** | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Numpy](https://img.shields.io/badge/Docstring_format-numpy-blue)](https://numpydoc.readthedocs.io/en/latest/format.html) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=aristanetworks_anta&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=aristanetworks_anta) |
| :------------: | :-------|
| **License** | [![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](https://github.com/aristanetworks/anta/blob/main/LICENSE) |
| **GitHub** | [![CI](https://github.com/aristanetworks/anta/actions/workflows/code-testing.yml/badge.svg)](https://github.com/aristanetworks/anta/actions/workflows/code-testing.yml) ![Coverage](https://raw.githubusercontent.com/aristanetworks/anta/coverage-badge/latest-release-coverage.svg) ![Commit](https://img.shields.io/github/last-commit/aristanetworks/anta) ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/aristanetworks/anta) [![Github release](https://img.shields.io/github/release/aristanetworks/anta.svg)](https://github.com/aristanetworks/anta/releases/) [![Contributors](https://img.shields.io/github/contributors/aristanetworks/anta)](https://github.com/aristanetworks/anta/graphs/contributors) |
Expand Down Expand Up @@ -77,7 +77,7 @@ pip install anta[cli]

## Documentation

The documentation is published on [ANTA package website](https://anta.arista.com). Also, a [demo repository](https://github.com/titom73/atd-anta-demo) is available to facilitate your journey with ANTA.
The documentation is published on [ANTA package website](https://anta.arista.com).

## Contribution guide

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced_usages/custom-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ For that, you need to create your own Python package as described in this [hitch

It is very similar to what is documented in [catalog section](../usage-inventory-catalog.md) but you have to use your own package name.2

Let say the custom Python package is `anta_titom73` and the test is defined in `anta_titom73.dc_project` Python module, the test catalog would look like:
Let say the custom Python package is `anta_custom` and the test is defined in `anta_custom.dc_project` Python module, the test catalog would look like:

```yaml
anta_titom73.dc_project:
anta_custom.dc_project:
- VerifyFeatureX:
minimum: 1
```
Expand Down
18 changes: 9 additions & 9 deletions docs/cli/nrfu.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Options:
```bash
anta nrfu --device DC1-LEAF1A text
```
[![anta nrfu text results](../imgs/anta-nrfu-text-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-text-output.png)
![anta nrfu text results](../imgs/anta-nrfu-text-output.png){ loading=lazy width="1600" }

## Performing NRFU with table rendering

Expand All @@ -92,31 +92,31 @@ The `--group-by` option show a summarized view of the test results per host or p
```bash
anta nrfu --tags LEAF table
```
[![anta nrfu table results](../imgs/anta-nrfu-table-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-table-output.png)
![anta nrfu table results](../imgs/anta-nrfu-table-output.png){ loading=lazy width="1600" }

For larger setups, you can also group the results by host or test to get a summarized view:

```bash
anta nrfu table --group-by device
```
[![anta nrfu table group_by_host_output](../imgs/anta-nrfu-table-group-by-host-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-table-group-by-host-output.png)
![$1anta nrfu table group_by_host_output](../imgs/anta-nrfu-table-group-by-host-output.png){ loading=lazy width="1600" }

```bash
anta nrfu table --group-by test
```
[![anta nrfu table group_by_test_output](../imgs/anta-nrfu-table-group-by-test-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-table-group-by-test-output.png)
![$1anta nrfu table group_by_test_output](../imgs/anta-nrfu-table-group-by-test-output.png){ loading=lazy width="1600" }

To get more specific information, it is possible to filter on a single device or a single test:

```bash
anta nrfu --device spine1 table
```
[![anta nrfu table filter_host_output](../imgs/anta-nrfu-table-filter-host-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-table-filter-host-output.png)
![$1anta nrfu table filter_host_output](../imgs/anta-nrfu-table-filter-host-output.png){ loading=lazy width="1600" }

```bash
anta nrfu --test VerifyZeroTouch table
```
[![anta nrfu table filter_test_output](../imgs/anta-nrfu-table-filter-test-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-table-filter-test-output.png)
![$1anta nrfu table filter_test_output](../imgs/anta-nrfu-table-filter-test-output.png){ loading=lazy width="1600" }

## Performing NRFU with JSON rendering

Expand All @@ -143,7 +143,7 @@ The `--output` option allows you to save the JSON report as a file.
```bash
anta nrfu --tags LEAF json
```
[![anta nrfu json results](../imgs/anta-nrfu-json-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-json-output.png)
![$1anta nrfu json results](../imgs/anta-nrfu-json-output.png){ loading=lazy width="1600" }

## Performing NRFU with custom reports

Expand Down Expand Up @@ -173,7 +173,7 @@ The `--output` option allows you to choose the path where the final report will
```bash
anta nrfu --tags LEAF tpl-report --template ./custom_template.j2
```
[![anta nrfu tpl_resultss](../imgs/anta-nrfu-tpl-report-output.png){ loading=lazy width="1600" }](../imgs/anta-nrfu-tpl-report-output.png)
![$1anta nrfu tpl_results](../imgs/anta-nrfu-tpl-report-output.png){ loading=lazy width="1600" }

The template `./custom_template.j2` is a simple Jinja2 template:

Expand Down Expand Up @@ -205,4 +205,4 @@ cat nrfu-tpl-report.txt

It is possible to run `anta nrfu --dry-run` to execute ANTA up to the point where it should communicate with the network to execute the tests. When using `--dry-run`, all inventory devices are assumed to be online. This can be useful to check how many tests would be run using the catalog and inventory.

[![anta nrfu dry_run](../imgs/anta_nrfu___dry_run.svg){ loading=lazy width="1600" }](../imgs/anta_nrfu___dry_run.svg)
![$1anta nrfu dry_run](../imgs/anta_nrfu___dry_run.svg){ loading=lazy width="1600" }
12 changes: 6 additions & 6 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ anta.tests.configuration:
## Test your network
### Basic usage in a python script
```python
--8<-- "anta_runner.py"
```

### CLI
ANTA comes with a generic CLI entrypoint to run tests in your network. It requires an inventory file as well as a test catalog.
Expand Down Expand Up @@ -264,3 +258,9 @@ $ anta nrfu \
```

You can find more information under the __usage__ section of the website

### Basic usage in a Python script

```python
--8<-- "anta_runner.py"
```
4 changes: 2 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ A couple of things to check when hitting an issue with ANTA:
```mermaid
flowchart LR
A>Hitting an issue with ANTA] --> B{Is my issue <br >listed in the FAQ?}
B -- Yes --> C{Does the FAQ solution<<br />works for me?}
B -- Yes --> C{Does the FAQ solution<br />works for me?}
C -- Yes --> V(((Victory)))
B -->|No| E{Is my problem<br />mentioned in one<<br />of the open issues?}
B -->|No| E{Is my problem<br />mentioned in one<br />of the open issues?}
C -->|No| E
E -- Yes --> F{Has the issue been<br />fixed in a newer<br />release or in main?}
F -- Yes --> U[Upgrade]
Expand Down
4 changes: 2 additions & 2 deletions docs/usage-inventory-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ anta.tests.configuration:
### Catalog with custom tests

In case you want to leverage your own tests collection, use your own Python package in the test catalog.
So for instance, if my custom tests are defined in the `titom73.tests.system` Python module, the test catalog will be:
So for instance, if my custom tests are defined in the `custom.tests.system` Python module, the test catalog will be:

```yaml
titom73.tests.system:
custom.tests.system:
- VerifyPlatform:
type: ['cEOS-LAB']
```
Expand Down
8 changes: 8 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ plugins:
- git-revision-date-localized:
type: date
- mike:
- glightbox:
background: none
shadow: true
touchNavigation: true
loop: false
effect: fade
slide_effect: slide
width: 90vw

markdown_extensions:
- attr_list
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ doc = [
"mkdocs-material>=8.3.9",
"mkdocs>=1.3.1",
"mkdocstrings[python]>=0.20.0",
"mkdocs-glightbox>=0.4.0"
]

[project.urls]
Expand Down

0 comments on commit 4f8f935

Please sign in to comment.