ANTA catalog for IS-IS tests
VerifyISISInterfaceMode ¶
Verifies ISIS Interfaces are running in correct mode.
Expected Results
- Success: The test will pass if all listed interfaces are running in correct mode.
- Failure: The test will fail if any of the listed interfaces is not running in correct mode.
- Skipped: The test will be skipped if no ISIS neighbor is found.
Examples
anta.tests.routing:
isis:
- VerifyISISInterfaceMode:
interfaces:
- name: Loopback0
mode: passive
# vrf is set to default by default
- name: Ethernet2
mode: passive
level: 2
# vrf is set to default by default
- name: Ethernet1
mode: point-to-point
vrf: default
# level is set to 2 by default
Inputs¶
Source code in anta/tests/routing/isis.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
VerifyISISNeighborCount ¶
Verifies number of IS-IS neighbors per level and per interface.
Expected Results
- Success: The test will pass if the number of neighbors is correct.
- Failure: The test will fail if the number of neighbors is incorrect.
- Skipped: The test will be skipped if no IS-IS neighbor is found.
Examples
anta.tests.routing:
isis:
- VerifyISISNeighborCount:
interfaces:
- name: Ethernet1
level: 1
count: 2
- name: Ethernet2
level: 2
count: 1
- name: Ethernet3
count: 2
# level is set to 2 by default
Inputs¶
Source code in anta/tests/routing/isis.py
157 158 159 160 161 162 163 164 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 |
|
VerifyISISNeighborState ¶
Verifies all IS-IS neighbors are in UP state.
Expected Results
- Success: The test will pass if all IS-IS neighbors are in UP state.
- Failure: The test will fail if some IS-IS neighbors are not in UP state.
- Skipped: The test will be skipped if no IS-IS neighbor is found.
Examples
anta.tests.routing:
isis:
- VerifyISISNeighborState:
Source code in anta/tests/routing/isis.py
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 |
|
_count_isis_neighbor ¶
_count_isis_neighbor(isis_neighbor_json: dict[str, Any]) -> int
Count the number of isis neighbors.
Args
isis_neighbor_json: The JSON output of the show isis neighbors
command.
Returns:
Type | Description |
---|---|
int: The number of isis neighbors.
|
|
Source code in anta/tests/routing/isis.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
_get_full_isis_neighbors ¶
_get_full_isis_neighbors(isis_neighbor_json: dict[str, Any], neighbor_state: Literal['up', 'down'] = 'up') -> list[dict[str, Any]]
Return the isis neighbors whose adjacency state is up
.
Args
isis_neighbor_json: The JSON output of the show isis neighbors
command.
neighbor_state: Value of the neihbor state we are looking for. Default up
Returns:
Type | Description |
---|---|
list[dict[str, Any]]: A list of isis neighbors whose adjacency state is not `UP`.
|
|
Source code in anta/tests/routing/isis.py
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 |
|
_get_interface_data ¶
_get_interface_data(interface: str, vrf: str, command_output: dict[str, Any]) -> dict[str, Any] | None
Extract data related to an IS-IS interface for testing.
Source code in anta/tests/routing/isis.py
107 108 109 110 111 112 113 114 115 116 117 118 |
|
_get_isis_neighbors_count ¶
_get_isis_neighbors_count(isis_neighbor_json: dict[str, Any]) -> list[dict[str, Any]]
Count number of IS-IS neighbor of the device.
Source code in anta/tests/routing/isis.py
95 96 97 98 99 100 101 102 103 104 |
|
_get_not_full_isis_neighbors ¶
_get_not_full_isis_neighbors(isis_neighbor_json: dict[str, Any]) -> list[dict[str, Any]]
Return the isis neighbors whose adjacency state is not up
.
Args
isis_neighbor_json: The JSON output of the show isis neighbors
command.
Returns:
Type | Description |
---|---|
list[dict[str, Any]]: A list of isis neighbors whose adjacency state is not `UP`.
|
|
Source code in anta/tests/routing/isis.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|