Skip to content

Commit 2b6e2ff

Browse files
authored
AVE check + pytest + doc (#240)
* AVE check + pytest + doc * fix sw_cversions check ERROR * PASS to NA * fix verbiage
1 parent 5d60b04 commit 2b6e2ff

4 files changed

Lines changed: 106 additions & 6 deletions

File tree

aci-preupgrade-validation-script.py

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3282,7 +3282,7 @@ def telemetryStatsServerP_object_check(index, total_checks, sw_cversion=None, tv
32823282
print_title(title, index, total_checks)
32833283

32843284
if not sw_cversion or not tversion:
3285-
print_result(title, MANUAL, 'Current and target Switch version not supplied. Skipping.')
3285+
print_result(title, MANUAL, 'Current or target Switch version not supplied. Skipping.')
32863286
return MANUAL
32873287

32883288
if sw_cversion.older_than("4.2(4d)") and tversion.newer_than("5.2(2d)"):
@@ -4205,8 +4205,8 @@ def unsupported_fec_configuration_ex_check(index, total_checks, sw_cversion, tve
42054205
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#unsupported-fec-configuration-for-n9k-c93180yc-ex'
42064206
print_title(title, index, total_checks)
42074207

4208-
if not tversion:
4209-
print_result(title, MANUAL, "Target version not supplied. Skipping.")
4208+
if not sw_cversion or not tversion:
4209+
print_result(title, MANUAL, "Current or Target switch version not supplied. Skipping.")
42104210
return MANUAL
42114211

42124212
if sw_cversion.older_than('5.0(1a)') and tversion.newer_than("5.0(1a)"):
@@ -5062,6 +5062,35 @@ def observer_db_size_check(index, total_checks, username, password, **kwargs):
50625062
return result
50635063

50645064

5065+
def ave_eol_check(index, total_checks, tversion, **kwargs):
5066+
title = 'AVE End-of-Life'
5067+
result = NA
5068+
msg = ''
5069+
headers = ["AVE Domain Name"]
5070+
data = []
5071+
recommended_action = 'AVE domain(s) must be migrated to supported domain types prior to 6.0+ upgrade'
5072+
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#ave-end-of-life'
5073+
print_title(title, index, total_checks)
5074+
5075+
ave_api = 'vmmDomP.json'
5076+
ave_api += '?query-target-filter=eq(vmmDomP.enableAVE,"true")'
5077+
5078+
if not tversion:
5079+
print_result(title, MANUAL, "Target version not supplied. Skipping.")
5080+
return MANUAL
5081+
5082+
if tversion.newer_than("6.0(1a)"):
5083+
ave = icurl('class', ave_api)
5084+
for domain in ave:
5085+
name = domain['vmmDomP']['attributes']['name']
5086+
data.append([name])
5087+
if data:
5088+
result = FAIL_O
5089+
5090+
print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url)
5091+
return result
5092+
5093+
50655094
if __name__ == "__main__":
50665095
prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION))
50675096
prints('!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!\n')
@@ -5149,6 +5178,7 @@ def observer_db_size_check(index, total_checks, username, password, **kwargs):
51495178
https_throttle_rate_check,
51505179
aes_encryption_check,
51515180
service_bd_forceful_routing_check,
5181+
ave_eol_check,
51525182

51535183
# Bugs
51545184
ep_announce_check,

docs/docs/validations.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ Items | Faults | This Script
128128
[HTTPS Request Throttle Rate][c20] | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
129129
[Global AES Encryption][c21] | :white_check_mark: | :white_check_mark: 6.1(2) | :no_entry_sign:
130130
[Service Graph BD Forceful Routing][c22] | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
131+
[AVE End-of-life][c23] | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
132+
131133

132134
[c1]: #vpc-paired-leaf-switches
133135
[c2]: #overlapping-vlan-pool
@@ -151,6 +153,7 @@ Items | Faults | This Script
151153
[c20]: #https-request-throttle-rate
152154
[c21]: #global-aes-encryption
153155
[c22]: #service-graph-bd-forceful-routing
156+
[c23]: #ave-end-of-life
154157

155158
### Defect Condition Checks
156159

@@ -1433,7 +1436,7 @@ Failure to do so may lead to outages during switch upgrades due to leaf nodes no
14331436
```
14341437

14351438

1436-
## Equipment Disk Limits Exceeded
1439+
### Equipment Disk Limits Exceeded
14371440

14381441
This fault occurs when the disk usage of a partiton increases beyond its threshold.
14391442

@@ -2137,7 +2140,8 @@ When **Global AES Encryption** is not enabled, this script alerts users in two d
21372140
* When it is not enabled and the target version is older than 6.1(2), this check is flagged as `MANUAL CHECK REQUIRED` to encourage users to follow the best practice to enable it (and take a configuration back again before the upgrade).
21382141

21392142

2140-
## Service Graph BD Forceful Routing
2143+
2144+
### Service Graph BD Forceful Routing
21412145

21422146
Starting from ACI 6.0(2), a bridge domain containing an L4-L7 service graph device (a.k.a service BD) starts to forward packets based on their IP headers even for bridging traffic which used to be forwarded based on their MAC addresses in their ethernet headers and ignored their IP headers. This "forceful routing" is to support IP-based selectors in ESG or microsegement EPG (uSeg EPG) when service graph is configured between those ESGs/uSeg EPGs and they are in the same bridge domain as the service graph device.
21432147

@@ -2187,6 +2191,12 @@ See below for the workaround and examples of traffic that will stop working afte
21872191
See [SNAT Traffic for Kubernetes with Cisco ACI CNI][52] for details about ACI CNI with SNAT.
21882192

21892193

2194+
### AVE End-of-life
2195+
As outlined in the [End-of-Sale and End-of-Life Announcement for Cisco Application Centric Infrastructure Virtual Edge and Virtual Pod][55], the Cisco ACI Virtual Edge (AVE) Domain is end-of-life and end-of-support for ACI releases 6.0 and above.
2196+
2197+
If planning an upgrade to 6.0+, review the [Cisco ACI Virtual Edge Migration Guide][56] and complete a domain migration prior to performing the upgrade.
2198+
2199+
21902200
## Defect Check Details
21912201

21922202
### EP Announce Compatibility
@@ -2585,4 +2595,6 @@ This check logs in to each APIC, checks the contents of the `/data2/dbstats/` di
25852595
[51]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-739971.html
25862596
[52]: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/kb/cisco-aci-plug-in-snat-on-egress.html
25872597
[53]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvw45531
2588-
[54]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvt47850
2598+
[54]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvt47850
2599+
[55]: https://www.cisco.com/c/en/us/products/collateral/cloud-systems-management/application-policy-infrastructure-controller-apic/eol-apic-virtual-edge-pod-pb.html
2600+
[56]: https://www.cisco.com/c/en/us/td/docs/dcn/whitepapers/cisco-aci-virtual-edge-migration.html
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import os
2+
import pytest
3+
import logging
4+
import importlib
5+
from helpers.utils import read_data
6+
7+
script = importlib.import_module("aci-preupgrade-validation-script")
8+
9+
log = logging.getLogger(__name__)
10+
dir = os.path.dirname(os.path.abspath(__file__))
11+
12+
13+
# icurl queries
14+
15+
ave_api = 'vmmDomP.json'
16+
ave_api += '?query-target-filter=eq(vmmDomP.enableAVE,"true")'
17+
18+
@pytest.mark.parametrize(
19+
"icurl_outputs, tversion, expected_result",
20+
[
21+
# FABRIC HAS AVE and going to affected tversion
22+
(
23+
{ave_api: read_data(dir, "vmmDomP_POS.json")},
24+
"6.1(3b)",
25+
script.FAIL_O,
26+
),
27+
# FABRIC HAS AVE and going to NOT-affected tversion
28+
(
29+
{ave_api: read_data(dir, "vmmDomP_POS.json")},
30+
"5.2(7e)",
31+
script.NA,
32+
),
33+
# NO AVE
34+
(
35+
{ave_api: []},
36+
"6.1(3b)",
37+
script.NA,
38+
),
39+
# NO TVERSION
40+
(
41+
{ave_api: []},
42+
None,
43+
script.MANUAL,
44+
),
45+
],
46+
)
47+
def test_logic(mock_icurl, tversion, expected_result):
48+
result = script.ave_eol_check(1, 1, script.AciVersion(tversion) if tversion else None)
49+
assert result == expected_result
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[{
2+
"vmmDomP": {
3+
"attributes": {
4+
"dn": "uni/vmmp-VMware/dom-my-ave",
5+
"enableAVE": "yes",
6+
"name": "my-ave"
7+
}
8+
}
9+
}]

0 commit comments

Comments
 (0)