Skip to content
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

Run yang validation in db migrator #3102

Merged
merged 11 commits into from
Nov 13, 2024
Merged

Conversation

ganglyu
Copy link
Contributor

@ganglyu ganglyu commented Dec 27, 2023

What I did

Add unit test/runtime alert for db_migrator.py/load_minigraph: ConfigDB passing yang validation

How I did it

Use subprocess to run yang validation, and then warm-reboot performance will not change.
Check /etc/sonic/mgmt_test_mark, this mark_file means this device is under end to end test.

  • For unit test, db_migrator will wait for validation result and raise exception.
  • For end to end test, db_migrator will wait for validation result and raise exception.

How to verify it

Run unit test and run end to end test

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@ganglyu ganglyu requested a review from qiluo-msft March 21, 2024 13:03
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Mar 26, 2024
What is the motivation for this PR?
We need a flag to mark that DUT is under end to end test.
sonic-net/sonic-utilities#3102
db migrator needs to detect DUT is running in end to end test.

How did you do it?
Create /etc/sonic/mgmt_test_mark with fixture.

How did you verify/test it?
Run end to end test, and check /etc/sonic/mgmt_test_mark.
@ganglyu ganglyu closed this Apr 2, 2024
@ganglyu ganglyu reopened this Apr 2, 2024
except sonic_yang.SonicYangException as e:
log.log_error("Yang validation failed: " + str(e))
raise
if len(yang_parser.tablesWithOutYang):
Copy link
Contributor

Choose a reason for hiding this comment

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

We could make it 100% in our StarLab DUT.
However, I suspect if we could cover it 100% in PROD devices. It will break the PROD workflow if not fully coverred in PROD.
I prefer we make the check as log_warning and not raise exception right now.

@ganglyu ganglyu marked this pull request as ready for review October 11, 2024 08:23
@ganglyu ganglyu merged commit 9677447 into sonic-net:master Nov 13, 2024
7 checks passed
@ganglyu ganglyu deleted the yang_validation branch November 13, 2024 03:57
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Dec 9, 2024
…n added to yang model (#15947)

What is the motivation for this PR?
In sonic-net/sonic-utilities#3102, the feature comparing yang model with configDB was added to sonic-utilities submodule, but feature subnet decap haven't been added to yang model, so the PR test advancing sonic-utilities to buildimage would fail in subnet decap test.

How did you do it?
Created issue sonic-net/sonic-buildimage#21090 and temporary skip subnet decap test until issue resolved

How did you verify/test it?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants