Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 2 additions & 6 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6828,12 +6828,8 @@ def n9k_c93180yc_fx3_switch_memory_check(fabric_nodes, **kwargs):
result = NA
msg = 'No N9K-C93180YC-FX3 switches found. Skipping.'
else:
node_ids = [node['fabricNode']['attributes']['id'] for node in affected_nodes]
node_filter = 'or({})'.format(','.join(
'wcard(procMemUsage.dn,"node-{}/")'.format(nid) for nid in node_ids
))
query = 'procMemUsage.json?query-target-filter=and({},wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"{}"))'.format(
node_filter, min_memory_kb
query = 'procMemUsage.json?query-target-filter=and(wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"{}"))'.format(
min_memory_kb
)
proc_mem_mos = icurl('class', query)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"procMemUsage": {
"attributes": {
"dn": "topology/pod-1/node-102/sys/procmem/memusage-sup",
"Modname": "sup",
"Total": "16000000"
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,25 @@

test_function = "n9k_c93180yc_fx3_switch_memory_check"

# icurl queries - filtered by affected node IDs and memory threshold
proc_mem_query_node101 = 'procMemUsage.json?query-target-filter=and(or(wcard(procMemUsage.dn,"node-101/")),wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"32000000"))'
# icurl query - affected node IDs are filtered from the response
proc_mem_query = 'procMemUsage.json?query-target-filter=and(wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"32000000"))'


def make_fx3_nodes(count):
return [
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-{}".format(node_id),
"id": str(node_id),
"name": "leaf{}".format(node_id),
"model": "N9K-C93180YC-FX3",
"role": "leaf",
}
}
}
for node_id in range(101, 101 + count)
]


@pytest.mark.parametrize(
Expand All @@ -38,7 +55,7 @@
(
read_data(dir, "fabricNode_one.json"),
{
proc_mem_query_node101: [],
proc_mem_query: [],
},
script.PASS,
'',
Expand All @@ -48,7 +65,27 @@
(
read_data(dir, "fabricNode_two.json"),
{
proc_mem_query_node101: [],
proc_mem_query: [],
},
script.PASS,
'',
[],
),
# Low-memory results for other switch models are ignored
(
read_data(dir, "fabricNode_two.json"),
{
proc_mem_query: read_data(dir, "procMemUsage_lt32gb_unaffected.json"),
},
script.PASS,
'',
[],
),
# Query remains below APIC's 20-expression limit on large fabrics
(
make_fx3_nodes(55),
{
proc_mem_query: [],
},
script.PASS,
'',
Expand All @@ -58,7 +95,7 @@
(
read_data(dir, "fabricNode_one.json"),
{
proc_mem_query_node101: read_data(dir, "procMemUsage_lt32gb.json"),
proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"),
},
script.FAIL_O,
(
Expand Down
Loading