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

chore: Add vscode python debugger for anta code #908

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 21 additions & 0 deletions .vscode/inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
anta_inventory:
hosts:
- host: 192.168.0.10
name: spine01
tags: ['spine']
- host: 192.168.0.11
name: spine02
tags: ['spine']
- host: 192.168.0.12
name: leaf01
tags: ['leaf']
- host: 192.168.0.13
name: leaf02
tags: ['leaf']
- host: 192.168.0.14
name: leaf03
tags: ['leaf']
# - host: 192.168.0.115
# name: leaf04
# tags: ['leaf']
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Module",
"type": "debugpy",
"console": "integratedTerminal",
"request": "launch",
"module": "anta.cli._main",
titom73 marked this conversation as resolved.
Show resolved Hide resolved
"args": [ "nrfu", "-c", "${workspaceFolder}/.vscode/nrfu.yml", "-i", "${workspaceFolder}/.vscode/inventory.yml", "text"],
"env": {
"ANTA_USERNAME": "ansible",
"ANTA_PASSWORD": "ansible",
"ANTA_ENABLE": "false",
},
"justMyCode": false
}
]
}
43 changes: 43 additions & 0 deletions .vscode/nrfu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
anta.tests.configuration:
- VerifyZeroTouch: # Verifies ZeroTouch is disabled.
- VerifyRunningConfigDiffs:

anta.tests.software:
- VerifyEOSVersion:
versions:
- '4.28.3M-28837868.4283M (engineering build)'

anta.tests.routing.bgp:
- VerifyBGPPeersHealth:
address_families:
- afi: "evpn"
- afi: "ipv4"
safi: "unicast"
vrf: "default"

anta.tests.interfaces:
- VerifyInterfaceUtilization:
- VerifyLoopbackCount:
number: 2
filters:
tags: ['leaf']
- VerifyLoopbackCount:
number: 1
filters:
tags: ['spine']

anta.tests.system:
- VerifyReloadCause:
- VerifyNTP:

anta.tests.mlag:
- VerifyMlagStatus:
filters:
tags: ['leaf']
- VerifyMlagInterfaces:
filters:
tags: ['leaf']
- VerifyMlagConfigSanity:
filters:
tags: ['leaf']
4 changes: 4 additions & 0 deletions anta/cli/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ def cli() -> None:
logger,
)
sys.exit(ExitCode.INTERNAL_ERROR)


if __name__ == "__main__":
anta()