Debian Codegraph @

docs/cli/get-tests.md

raw symbols SCIP
1 ---
2 title: Retrieving Tests information
3 hide:
4 - tags
5 tags:
6 - CLI
7 - Tests
8 ---
9
10 <!--
11 ~ Copyright (c) 2023-2026 Arista Networks, Inc.
12 ~ Use of this source code is governed by the Apache License 2.0
13 ~ that can be found in the LICENSE file.
14 -->
15
16 ## `anta get tests`
17
18 `anta get tests` commands help you discover the available tests in ANTA.
19
20 ### Command overview
21
22 ```bash
23 --8<-- "anta_get_tests_help.txt"
24 ```
25
26 !!! tip
27 By default, `anta get tests` retrieves all the tests available in ANTA.
28
29 ### Examples
30
31 #### Default usage
32
33 ``` yaml title="anta get tests"
34 anta.tests.aaa:
35 - VerifyAcctConsoleMethods:
36 # Verifies the AAA accounting console method lists for different accounting types (system, exec, commands, dot1x).
37 methods:
38 - local
39 - none
40 - logging
41 types:
42 - system
43 - exec
44 - commands
45 - dot1x
46 - VerifyAcctDefaultMethods:
47 # Verifies the AAA accounting default method lists for different accounting types (system, exec, commands, dot1x).
48 methods:
49 - local
50 - none
51 - logging
52 types:
53 - system
54 - exec
55 - commands
56 - dot1x
57 [...]
58 ```
59
60 #### Filtering using `--module`
61
62 To retrieve all the tests from `anta.tests.stun`.
63
64 ``` yaml title="anta get tests --module anta.tests.stun"
65 anta.tests.stun:
66 - VerifyStunClient:
67 # Verifies STUN client settings, including local IP/port and optionally public IP/port.
68 stun_clients:
69 - source_address: 172.18.3.2
70 public_address: 172.18.3.21
71 source_port: 4500
72 public_port: 6006
73 - source_address: 100.64.3.2
74 public_address: 100.64.3.21
75 source_port: 4500
76 public_port: 6006
77 - VerifyStunServer:
78 # Verifies the STUN server status is enabled and running.
79 ```
80
81 #### Filtering using `--test`
82
83 ``` yaml title="anta get tests --test VerifyTacacsSourceIntf"
84 anta.tests.aaa:
85 - VerifyTacacsSourceIntf:
86 # Verifies TACACS source-interface for a specified VRF.
87 intf: Management0
88 vrf: MGMT
89 ```
90
91 !!! tip
92 You can filter tests by providing a prefix - ANTA will return all tests that start with your specified string.
93
94 ```yaml title="anta get tests --test VerifyTacacs"
95 anta.tests.aaa:
96 - VerifyTacacsServerGroups:
97 # Verifies if the provided TACACS server group(s) are configured.
98 groups:
99 - TACACS-GROUP1
100 - TACACS-GROUP2
101 - VerifyTacacsServers:
102 # Verifies TACACS servers are configured for a specified VRF.
103 servers:
104 - 10.10.10.21
105 - 10.10.10.22
106 vrf: MGMT
107 - VerifyTacacsSourceIntf:
108 # Verifies TACACS source-interface for a specified VRF.
109 intf: Management0
110 vrf: MGMT
111 ```
112
113 #### Count the tests
114
115 ```bash title="anta get tests --count"
116 There are 155 tests available in `anta.tests`.
117 ```
118
119 ## `anta get commands`
120
121 `anta get commands` returns the EOS commands used by the targeted tests, if no filter is provided, the targeted tests are all the built-in ANTA tests.
122
123 ### Command overview
124
125 ```bash
126 --8<-- "anta_get_commands_help.txt"
127 ```
128
129 !!! tip
130 By default, `anta get commands` retrieves commands from all ANTA's built-in tests.
131
132 ### Examples
133
134 #### Default usage
135
136 ``` yaml title="anta get commands"
137 anta.tests.aaa:
138 - VerifyAcctConsoleMethods:
139 - show aaa methods accounting
140 - VerifyAcctDefaultMethods:
141 - show aaa methods accounting
142 - VerifyAuthenMethods:
143 - show aaa methods authentication
144 - VerifyAuthzMethods:
145 - show aaa methods authorization
146 - VerifyTacacsServerGroups:
147 - show tacacs
148 - VerifyTacacsServers:
149 - show tacacs
150 - VerifyTacacsSourceIntf:
151 - show tacacs
152 anta.tests.avt:
153 - VerifyAVTPathHealth:
154 - show adaptive-virtual-topology path
155 - VerifyAVTRole:
156 - show adaptive-virtual-topology path
157 - VerifyAVTSpecificPath:
158 - show adaptive-virtual-topology path
159 [...]
160 ```
161
162 #### Filtering using `--module`
163
164 To retrieve all the commands from the tests in `anta.tests.stun`.
165
166 ``` yaml title="anta get commands --module anta.tests.stun"
167 anta.tests.stun:
168 - VerifyStunClient:
169 - show stun client translations {source_address} {source_port}
170 - VerifyStunClientTranslation:
171 - show stun client translations {source_address} {source_port}
172 - VerifyStunServer:
173 - show stun server status
174 ```
175
176 #### Filtering using `--test`
177
178 ``` yaml title="anta get commands --test VerifyBGPExchangedRoutes"
179 anta.tests.routing.bgp:
180 - VerifyBGPExchangedRoutes:
181 - show bgp neighbors {peer} advertised-routes vrf {vrf}
182 - show bgp neighbors {peer} routes vrf {vrf}
183 vrf: MGMT
184 ```
185
186 !!! tip
187 You can filter tests by providing a prefix - ANTA will return all tests that start with your specified string.
188
189 ```yaml title="anta get tests --test VerifyTacacs"
190 anta.tests.aaa:
191 - VerifyTacacsServerGroups:
192 - show tacacs
193 - VerifyTacacsServers:
194 - show tacacs
195 - VerifyTacacsSourceIntf:
196 - show tacacs
197 ```
198
199 #### Filtering using `--catalog`
200
201 To retrieve all the commands from the tests in a catalog:
202
203 ``` yaml title="anta get commands --catalog my-catalog.yml"
204 anta.tests.interfaces:
205 - VerifyL3MTU:
206 - show interfaces
207 anta.tests.mlag:
208 - VerifyMlagStatus:
209 - show mlag
210 anta.tests.system:
211 - VerifyAgentLogs:
212 - show agent logs crash
213 - VerifyCPUUtilization:
214 - show processes top once
215 - VerifyCoredump:
216 - show system coredump
217 - VerifyFileSystemUtilization:
218 - bash timeout 10 df -h
219 - VerifyMemoryUtilization:
220 - show version
221 - VerifyNTP:
222 - show ntp status
223 - VerifyReloadCause:
224 - show reload cause
225 - VerifyUptime:
226 - show uptime
227 ```
228
229 #### Output using `--unique`
230
231 Using the `--unique` flag will output only the list of unique commands that will be run which can be useful to configure a AAA system.
232
233 For instance with the previous catalog, the output would be:
234
235 ``` yaml title="anta get commands --catalog my-catalog.yml --unique"
236 show processes top once
237 bash timeout 10 df -h
238 show system coredump
239 show agent logs crash
240 show interfaces
241 show uptime
242 show ntp status
243 show version
244 show reload cause
245 show mlag
246 ```