Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixing issue-423-fx3-memory-filter-limit_with_batch_proccessing #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fixing issue-423-fx3-memory-filter-limit_with_batch_proccessing #430
Changes from all commits
e8aff63db16b2255b77540ac263f05e0c700179c15File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check failure on line 114 in tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py
test_n9k_c93180yc_fx3_switch_memory_check.test_logic[fabric_nodes2-icurl_outputs2-PASS--expected_data2]
Raw output
run_check = <function run_check.<locals>._run_check at 0x7f1cd4292040> mock_icurl = None fabric_nodes = [{'fabricNode': {'attributes': {'dn': 'topology/pod-1/node-101', 'id': '101', 'model': 'N9K-C93180YC-FX3', 'name': 'leaf101', ...}}}] expected_result = 'PASS', expected_msg = '', expected_data = [] @pytest.mark.parametrize( "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", [ # No nodes returned ( [], {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # Non-N9K-C93180YC-FX3 node (N9K-C9508) ( read_data(dir, "fabricNode_N9K-C9508.json"), {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: [], }, script.PASS, '', [], ), # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty ( read_data(dir, "fabricNode_two.json"), { 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, '', [], ), # N9K-C93180YC-FX3 node with <32GB memory (fail case) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"), }, script.FAIL_O, ( 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' 'One or more switches with less than 32GB of memory may experience service instability. ' 'Upgrade the switch memory to at least 32GB.' ), [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], ), ], ) def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): result = run_check( fabric_nodes=fabric_nodes, ) > assert result.result == expected_result E AssertionError: assert 'ERROR !!' == 'PASS' E - PASS E + ERROR !! tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py:114: AssertionErrorCheck failure on line 114 in tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py
test_n9k_c93180yc_fx3_switch_memory_check.test_logic[fabric_nodes3-icurl_outputs3-PASS--expected_data3]
Raw output
run_check = <function run_check.<locals>._run_check at 0x7f1cd40f2c10> mock_icurl = None fabric_nodes = [{'fabricNode': {'attributes': {'dn': 'topology/pod-1/node-101', 'id': '101', 'model': 'N9K-C93180YC-FX3', 'name': 'le...cNode': {'attributes': {'dn': 'topology/pod-1/node-102', 'id': '102', 'model': 'N9K-C9364C', 'name': 'leaf102', ...}}}] expected_result = 'PASS', expected_msg = '', expected_data = [] @pytest.mark.parametrize( "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", [ # No nodes returned ( [], {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # Non-N9K-C93180YC-FX3 node (N9K-C9508) ( read_data(dir, "fabricNode_N9K-C9508.json"), {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: [], }, script.PASS, '', [], ), # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty ( read_data(dir, "fabricNode_two.json"), { 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, '', [], ), # N9K-C93180YC-FX3 node with <32GB memory (fail case) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"), }, script.FAIL_O, ( 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' 'One or more switches with less than 32GB of memory may experience service instability. ' 'Upgrade the switch memory to at least 32GB.' ), [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], ), ], ) def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): result = run_check( fabric_nodes=fabric_nodes, ) > assert result.result == expected_result E AssertionError: assert 'ERROR !!' == 'PASS' E - PASS E + ERROR !! tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py:114: AssertionErrorCheck failure on line 114 in tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py
test_n9k_c93180yc_fx3_switch_memory_check.test_logic[fabric_nodes4-icurl_outputs4-PASS--expected_data4]
Raw output
run_check = <function run_check.<locals>._run_check at 0x7f1cd40f2280> mock_icurl = None fabric_nodes = [{'fabricNode': {'attributes': {'dn': 'topology/pod-1/node-101', 'id': '101', 'model': 'N9K-C93180YC-FX3', 'name': 'le...cNode': {'attributes': {'dn': 'topology/pod-1/node-102', 'id': '102', 'model': 'N9K-C9364C', 'name': 'leaf102', ...}}}] expected_result = 'PASS', expected_msg = '', expected_data = [] @pytest.mark.parametrize( "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", [ # No nodes returned ( [], {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # Non-N9K-C93180YC-FX3 node (N9K-C9508) ( read_data(dir, "fabricNode_N9K-C9508.json"), {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: [], }, script.PASS, '', [], ), # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty ( read_data(dir, "fabricNode_two.json"), { 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, '', [], ), # N9K-C93180YC-FX3 node with <32GB memory (fail case) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"), }, script.FAIL_O, ( 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' 'One or more switches with less than 32GB of memory may experience service instability. ' 'Upgrade the switch memory to at least 32GB.' ), [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], ), ], ) def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): result = run_check( fabric_nodes=fabric_nodes, ) > assert result.result == expected_result E AssertionError: assert 'ERROR !!' == 'PASS' E - PASS E + ERROR !! tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py:114: AssertionErrorCheck failure on line 114 in tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py
test_n9k_c93180yc_fx3_switch_memory_check.test_logic[fabric_nodes5-icurl_outputs5-PASS--expected_data5]
Raw output
run_check = <function run_check.<locals>._run_check at 0x7f1cd40f23a0> mock_icurl = None fabric_nodes = [{'fabricNode': {'attributes': {'dn': 'topology/pod-1/node-101', 'id': '101', 'model': 'N9K-C93180YC-FX3', 'name': 'le...ttributes': {'dn': 'topology/pod-1/node-106', 'id': '106', 'model': 'N9K-C93180YC-FX3', 'name': 'leaf106', ...}}}, ...] expected_result = 'PASS', expected_msg = '', expected_data = [] @pytest.mark.parametrize( "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", [ # No nodes returned ( [], {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # Non-N9K-C93180YC-FX3 node (N9K-C9508) ( read_data(dir, "fabricNode_N9K-C9508.json"), {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: [], }, script.PASS, '', [], ), # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty ( read_data(dir, "fabricNode_two.json"), { 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, '', [], ), # N9K-C93180YC-FX3 node with <32GB memory (fail case) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"), }, script.FAIL_O, ( 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' 'One or more switches with less than 32GB of memory may experience service instability. ' 'Upgrade the switch memory to at least 32GB.' ), [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], ), ], ) def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): result = run_check( fabric_nodes=fabric_nodes, ) > assert result.result == expected_result E AssertionError: assert 'ERROR !!' == 'PASS' E - PASS E + ERROR !! tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py:114: AssertionErrorCheck failure on line 114 in tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py
test_n9k_c93180yc_fx3_switch_memory_check.test_logic[fabric_nodes6-icurl_outputs6-FAIL - OUTAGE WARNING!!-N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. One or more switches with less than 32GB of memory may experience service instability. Upgrade the switch memory to at least 32GB.-expected_data6]
Raw output
run_check = <function run_check.<locals>._run_check at 0x7f1cd40f2d30> mock_icurl = None fabric_nodes = [{'fabricNode': {'attributes': {'dn': 'topology/pod-1/node-101', 'id': '101', 'model': 'N9K-C93180YC-FX3', 'name': 'leaf101', ...}}}] expected_result = 'FAIL - OUTAGE WARNING!!' expected_msg = 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. One or more switches with less than 32GB of memory may experience service instability. Upgrade the switch memory to at least 32GB.' expected_data = [['101', 'leaf101', 'N9K-C93180YC-FX3', 16.0]] @pytest.mark.parametrize( "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", [ # No nodes returned ( [], {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # Non-N9K-C93180YC-FX3 node (N9K-C9508) ( read_data(dir, "fabricNode_N9K-C9508.json"), {}, script.NA, 'No N9K-C93180YC-FX3 switches found. Skipping.', [], ), # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: [], }, script.PASS, '', [], ), # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty ( read_data(dir, "fabricNode_two.json"), { 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, '', [], ), # N9K-C93180YC-FX3 node with <32GB memory (fail case) ( read_data(dir, "fabricNode_one.json"), { proc_mem_query: read_data(dir, "procMemUsage_lt32gb.json"), }, script.FAIL_O, ( 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' 'One or more switches with less than 32GB of memory may experience service instability. ' 'Upgrade the switch memory to at least 32GB.' ), [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], ), ], ) def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): result = run_check( fabric_nodes=fabric_nodes, ) > assert result.result == expected_result E AssertionError: assert 'ERROR !!' == 'FAIL - OUTAGE WARNING!!' E - FAIL - OUTAGE WARNING!! E + ERROR !! tests/checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_check.py:114: AssertionErrorUh oh!
There was an error while loading. Please reload this page.