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

Adding yang model for PFC watch dog parameters #7839

Merged
merged 25 commits into from
Sep 20, 2021

Conversation

AmitKaushik7
Copy link
Contributor

@AmitKaushik7 AmitKaushik7 commented Jun 10, 2021

Why I did it

Added sonic-pfcwd.yang file that defines the yang model for PFC watch dog parameters
sonic-pfcwd.yang is required for configuring action, detection_time, restoration time of PFC watchdog on the interface port.

How I did it

Defined Yang models for PFC_WD table based on Guideline doc:
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md
and
https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md

How to verify it

sonic_yang_models package build.
Using pytest
pytest tests/yang_model_tests/test_yang_model.py -v

------------------- Test 15: PFC_WDOG_WITH_WRONG_POLL_INTERVAL_LOW_VALUE---------------------
libyang[0]: Value "99" does not satisfy the constraint "100..3000" (range, length, or pattern). (path: /sonic-pfcwd:sonic-pfcwd/PFC_WD/PFC_WD_LIST[ifname='GLOBAL']/POLL_INTERVAL)
INFO:YANG-TEST:Value "99" does not satisfy the constraint "100..3000" (range, length, or pattern).
INFO:YANG-TEST:PFC_WDOG_WITH_WRONG_POLL_INTERVAL_LOW_VALUE Passed

INFO:YANG-TEST:
------------------- Test 16: PFC_WDOG_WITH_CORRECT_ACTION_FORWARD_VALUE no failure.---------------------
INFO:YANG-TEST:PFC_WDOG_WITH_CORRECT_ACTION_FORWARD_VALUE no failure. Passed

INFO:YANG-TEST:
------------------- Test 18: PFC_WDOG_WITH_CORRECT_ACTION_ALERT_VALUE no failure.---------------------
INFO:YANG-TEST:PFC_WDOG_WITH_CORRECT_ACTION_ALERT_VALUE no failure. Passed

INFO:YANG-TEST:
------------------- Test 20: PFC_WDOG_WITH_WRONG_RESTORATION_TIME_LOW_VALUE---------------------
libyang[0]: Value "99" does not satisfy the constraint "100..5000" (range, length, or pattern). (path: /sonic-pfcwd:sonic-pfcwd/PFC_WD/PFC_WD_LIST/detection_time)
INFO:YANG-TEST:Value "99" does not satisfy the constraint "100..5000" (range, length, or pattern).
INFO:YANG-TEST:PFC_WDOG_WITH_WRONG_RESTORATION_TIME_LOW_VALUE Passed

INFO:YANG-TEST:
------------------- Test 21: PFC_WDOG_WITH_CORRECT_ACTION_DROP_VALUE no failure.---------------------
INFO:YANG-TEST:PFC_WDOG_WITH_CORRECT_ACTION_DROP_VALUE no failure. Passed

INFO:YANG-TEST:
------------------- Test 22: PFC_WDOG_WITH_WRONG_DETECTION_TIME_HIGH_VALUE---------------------
libyang[0]: Invalid value "wrong" in "action" element. (path: /sonic-pfcwd:sonic-pfcwd/PFC_WD/PFC_WD_LIST/action)
INFO:YANG-TEST:Invalid value "wrong" in "action" element.
INFO:YANG-TEST:PFC_WDOG_WITH_WRONG_DETECTION_TIME_HIGH_VALUE Passed

INFO:YANG-TEST:
------------------- Test 23: PFC_WDOG_WITH_WRONG_ACTION_VALUE must contain a valid action---------------------
libyang[0]: Invalid value "wrong" in "action" element. (path: /sonic-pfcwd:sonic-pfcwd/PFC_WD/PFC_WD_LIST/action)
INFO:YANG-TEST:Invalid value "wrong" in "action" element.
INFO:YANG-TEST:PFC_WDOG_WITH_WRONG_ACTION_VALUE must contain a valid action Passed

INFO:YANG-TEST:
------------------- Test 24: PFC_WDOG_WITH_WRONG_RESTORATION_TIME_HIGH_VALUE---------------------
libyang[0]: Invalid value "wrong" in "action" element. (path: /sonic-pfcwd:sonic-pfcwd/PFC_WD/PFC_WD_LIST/action)
INFO:YANG-TEST:Invalid value "wrong" in "action" element.
INFO:YANG-TEST:PFC_WDOG_WITH_WRONG_RESTORATION_TIME_HIGH_VALUE Passed

------------------- Test 26: PORT_VALID_ADVTYPES_TEST_2 no failure.---------------------
INFO:YANG-TEST:PORT_VALID_ADVTYPES_TEST_2 no failure. Passed

INFO:YANG-TEST:
------------------- Test 27: PFC_WDOG_WITH_CORRECT_POLL_INTERVAL_VALUE no failure---------------------
INFO:YANG-TEST:PFC_WDOG_WITH_CORRECT_POLL_INTERVAL_VALUE no failure Passed

Which release branch to backport (provide reason below if selected)

Description for the changelog

Added yang models for PFC WD parameters: "Action", "Detection time", "Restoration time", "Poll Interval"

@AmitKaushik7 AmitKaushik7 requested a review from lguohan as a code owner June 10, 2021 03:12
@anshuv-mfst anshuv-mfst added the YANG YANG model related changes label Jun 10, 2021
@lguohan lguohan requested a review from neethajohn June 10, 2021 17:34
@AmitKaushik7
Copy link
Contributor Author

Hi Anshu,
This build is failing due to BGP issue, is not related to changes in this PR. I am observing this failure in other PRs after rebase, like 7838 and 8283. Can you please check if something got broken.
Thanks
Amit

@AmitKaushik7
Copy link
Contributor Author

Hi Anshu, The BGP failure issue was resolved. All checks are passing now.

@zhangyanzhao
Copy link
Collaborator

zhangyanzhao commented Aug 26, 2021

@rathnasabapathyv please follow-up and resolve the conflict.

@smaheshm smaheshm self-requested a review September 1, 2021 20:05
@smaheshm smaheshm self-requested a review September 8, 2021 21:49
@smaheshm
Copy link
Contributor

smaheshm commented Sep 8, 2021

@AmitKaushik7 Please update as per suggestions and update the description with test results under "How to verify" section.

@zhangyanzhao
Copy link
Collaborator

BRCM team will continue to work on this, ETA is next week.

@zhangyanzhao
Copy link
Collaborator

All the comments have been addressed by BRCM, PR can be merged. @lguohan please help to merge. Thanks.

Copy link
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

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

Thanks for updating the description with test results.

@smaheshm smaheshm changed the title Adding PFC yang files Adding yang model for PFC watch dog parameters Sep 20, 2021
@lguohan lguohan merged commit 4049067 into sonic-net:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants