ANTA catalog for services tests
Tests¶
Module related to the EOS various services tests.
VerifyDNSLookup ¶
Verifies the DNS (Domain Name Service) name to IP address resolution.
Expected Results
- Success: The test will pass if a domain name is resolved to an IP address.
- Failure: The test will fail if a domain name does not resolve to an IP address.
- Error: This test will error out if a domain name is invalid.
Examples
anta.tests.services:
- VerifyDNSLookup:
domain_names:
- arista.com
- www.google.com
- arista.ca
Source code in anta/tests/services.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
VerifyDNSServers ¶
Verifies if the DNS (Domain Name Service) servers are correctly configured.
This test performs the following checks for each specified DNS Server:
- Confirming correctly registered with a valid IPv4 or IPv6 address with the designated VRF.
- Ensuring an appropriate priority level.
Expected Results
- Success: The test will pass if the DNS server specified in the input is configured with the correct VRF and priority.
- Failure: The test will fail if any of the following conditions are met:
- The provided DNS server is not configured.
- The provided DNS server with designated VRF and priority does not match the expected information.
Examples
anta.tests.services:
- VerifyDNSServers:
dns_servers:
- server_address: 10.14.0.1
vrf: default
priority: 1
- server_address: 10.14.0.11
vrf: MGMT
priority: 0
Source code in anta/tests/services.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
VerifyErrdisableRecovery ¶
Verifies the error disable recovery functionality.
This test performs the following checks for each specified error disable reason:
- Verifying if the specified error disable reason exists.
- Checking if the recovery timer status matches the expected enabled/disabled state.
- Validating that the timer interval matches the configured value.
Expected Results
- Success: The test will pass if:
- The specified error disable reason exists.
- The recovery timer status matches the expected state.
- The timer interval matches the configured value.
- Failure: The test will fail if:
- The specified error disable reason does not exist.
- The recovery timer status does not match the expected state.
- The timer interval does not match the configured value.
Examples
anta.tests.services:
- VerifyErrdisableRecovery:
reasons:
- reason: acl
interval: 30
status: Enabled
- reason: bpduguard
interval: 30
status: Enabled
Inputs¶
Name | Type | Description | Default |
---|---|---|---|
reasons |
list[ErrdisableRecovery]
|
List of errdisable reasons.
|
- |
Source code in anta/tests/services.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
VerifyHostname ¶
Verifies the hostname of a device.
Expected Results
- Success: The test will pass if the hostname matches the provided input.
- Failure: The test will fail if the hostname does not match the provided input.
Examples
anta.tests.services:
- VerifyHostname:
hostname: s1-spine1
Source code in anta/tests/services.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
Input models¶
Module containing input models for services tests.
DnsServer ¶
Model for a DNS server configuration.
Name | Type | Description | Default |
---|---|---|---|
server_address |
IPv4Address | IPv6Address
|
The IPv4 or IPv6 address of the DNS server.
|
- |
vrf |
str
|
The VRF instance in which the DNS server resides. Defaults to 'default'.
|
'default'
|
priority |
int
|
The priority level of the DNS server, ranging from 0 to 4. Lower values indicate a higher priority, with 0 being the highest and 4 the lowest.
|
Field(ge=0, le=4)
|
Source code in anta/input_models/services.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
ErrDisableReason ¶
Alias for the ErrdisableRecovery model to maintain backward compatibility.
When initialised, it will emit a deprecation warning and call the ErrdisableRecovery model.
TODO: Remove this class in ANTA v2.0.0.
Source code in anta/input_models/services.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
ErrdisableRecovery ¶
Model for the error disable recovery functionality.
Name | Type | Description | Default |
---|---|---|---|
reason |
ErrDisableReasons
|
Name of the error disable reason.
|
- |
status |
Literal['Enabled', 'Disabled']
|
Operational status of the reason. Defaults to 'Enabled'.
|
'Enabled'
|
interval |
int
|
Timer interval of the reason in seconds.
|
Field(ge=30, le=86400)
|
Source code in anta/input_models/services.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|