Skip to content

Fix "override config" tests to support LT2/FT2#22696

Open
kazinator-arista wants to merge 2 commits intosonic-net:masterfrom
kazinator-arista:master
Open

Fix "override config" tests to support LT2/FT2#22696
kazinator-arista wants to merge 2 commits intosonic-net:masterfrom
kazinator-arista:master

Conversation

@kazinator-arista
Copy link
Copy Markdown

@kazinator-arista kazinator-arista commented Mar 3, 2026

Description of PR

This PR gets two test cases working, which fail due to finding a discrepancy
in two tables.

The fix is to ignore the FEATURE and PORT tables in the test, which
have some run-time configuration state that is altered when the golden
config is overridden empty. FEATURE is missing the "BMP" node, and
records in PORT are missing "fec" : "rs" fields.

The first commit in the PR is an improvement in the diagnostic that occurs
when these tests fail due to a configuration discrepancy. Rather than stopping
on the first discrepancy (non-matching configuration table), all mismatches
are identified, and reported in a single exception.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • [X ] 202505
  • [X ] 202511

How did you verify/test it?

Failing tests went green on LT2 and FT2 DUTs in our test bed, without regressions in numerous other duts.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 3, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

compare_dicts_ignore_list_order(initial_config[table], current_config[table]),
"empty input ACL_TABLE compare fail!"
)
if not compare_dicts_ignore_list_order(initial_config[table], current_config[table]):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand why we need to ignore list order for ACL table? How is that working before?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something that came from #12763 and was discussed there.

I'm being careful to preserve that comparison expression in order to not regress whatever issue that addressed.

@bingwang-ms
Copy link
Copy Markdown
Collaborator

Can you please fix DCO? Thanks
image

@StormLiangMS
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

* tests/override_config_table/test_override_config_table.py
(load_minigraph_with_golden_empty_input): This function
asserts on the first discrepancy found. We instead gather the
names of the nonmatching tables into a list, and assert if the
list is not empty, showing the list in the assertion message.

* tests/override_config_table/test_override_config_table_masic.py:
Similar changes to multi-asic version of test
(load_minigraph_with_golden_empty_input): The difference is
that rather than gathering names of nonmatching tables,
we have (asic, tasble) tuples.

Signed-Off-By: Kaz Kylheku <[email protected]>
In the test case test_load_minigraph_with_golden_config, the function
load_minigraph_with_golden_empty_input asserts. This function expects all the
tables to be identical after the golden config is overridden to be empty.  But
it looks as if the golden config is the source of several configurations: the
"BMP" table, and "fec" : "rs" entries in the "PORT".  Thus, when the golden
config is replaced with an empty configuration, the entire "BMP" table,
well as those "fec" properties in the "PORT" table, disappear.

We propose a variable GOLDEN_OVERRIDDEN_TABLES for additional tables
which that function should skip. This is similar to the existing variable
NON_USER_CONFIG_TABLES which non-user-config tables that need to be skipped.

tests/override_config_table/test_override_config_table.py
(GOLDEN_OVERRIDDEN_TABLES): New variable.
(load_minigraph_with_golden_empty_input): Skip tables found in
GOLDEN_OVERRIDDEN_TABLES.

tests/override_config_table/test_override_config_table_masic.py:
Same changes as in test_override_config_table.py.

Signed-Off-By: Kaz Kylheku <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms bingwang-ms enabled auto-merge (squash) March 19, 2026 04:56
@bingwang-ms
Copy link
Copy Markdown
Collaborator

@kazinator-arista Please fix the pre-check failure

========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /agent/_work/_temp/baa9d19a-612f-4a51-a4e4-79d6515541b6.sh
Pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/override_config_table/test_override_config_table.py:114:1: E302 expected 2 blank lines, found 1
tests/override_config_table/test_override_config_table_masic.py:132:1: E302 expected 2 blank lines, found 1

flake8...............................................(no files to check)Skipped
flake8 (tests/common2)...............................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped
isort (python).......................................(no files to check)Skipped
black................................................(no files to check)Skipped
mypy.................................................(no files to check)Skipped
pylint...............................................(no files to check)Skipped

@StormLiangMS
Copy link
Copy Markdown
Collaborator

@kazinator-arista — This PR has 2 CI failures (Static Analysis + Azure build). Could you investigate and fix? Has 1 approval from @bingwang-ms, pending @wenyiz2021 @yutongzhang-microsoft. This fixes override_config tests for LT2/FT2, tracked in aristanetworks/sonic-qual.msft#583 and #582.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Request for msft-202503 Branch Request for 202511 branch Request to backport a change to 202511 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants