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

Yang model modifications #12

Merged

Conversation

praveen-li
Copy link
Collaborator

@praveen-li praveen-li commented Dec 3, 2019

- What I did

[sonic-head.yang]: Minor modification for enumeration of ip-type in ACL yang models.

[sonic-vlan.yang]: modify vlan table key from vlanid(int) to vlan_name(string).

[yangModelTesting.py] Fix Test Code and JSON input.

- How I did it
Minor modification for enumeration of ip-type in ACL yang models.
modify vlan table key from vlanid(int) to vlan_name(string).
Fix Test Code and JSON input.

Note: I need to block Current PLY Tests because they do not pass with new YANG Models.

- How to verify it

INFO:YANG-TEST:
------------------- Test 11: Configure undefined acl_table_type in ACL_TABLE table.---------------------
libyang[0]: Invalid value "LAYER3V4" in "type" element. (path: /sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V6']/type)
INFO:YANG-TEST:Configure undefined acl_table_type in ACL_TABLE table. Passed

INFO:YANG-TEST:
------------------- Test 12: Configure undefined packet_action in ACL_RULE table.---------------------
libyang[0]: Invalid value "SEND" in "PACKET_ACTION" element. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST/PACKET_ACTION)
INFO:YANG-TEST:Configure undefined packet_action in ACL_RULE table. Passed

INFO:YANG-TEST:
------------------- Test 13: Configure wrong value for tagging_mode.---------------------
libyang[0]: Invalid value "non-tagged" in "tagging_mode" element. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST/tagging_mode)
INFO:YANG-TEST:Configure wrong value for tagging_mode. Passed

INFO:YANG-TEST:
------------------- Test 14: Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN  table.---------------------
libyang[0]: Leafref "/sonic-vlan:sonic-vlan/sonic-vlan:VLAN/sonic-vlan:VLAN_LIST/sonic-vlan:vlan_name" of value "Vlan200" points to a non-existing leaf. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlan_name='Vlan200'][port='Ethernet0']/vlan_name)
libyang[0]: Leafref "/sonic-vlan:sonic-vlan/sonic-vlan:VLAN/sonic-vlan:VLAN_LIST/sonic-vlan:vlan_name" of value "Vlan200" points to a non-existing leaf. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlan_name='Vlan200'][port='Ethernet0']/vlan_name)
INFO:YANG-TEST:Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN  table. Passed

INFO:YANG-TEST:All Test Passed
../../target/debs/stretch/libyang_1.0.73_amd64.deb installed
../../target/debs/stretch/libyang-cpp_1.0.73_amd64.deb installed
../../target/debs/stretch/python2-yang_1.0.73_amd64.deb installed
YANG Tests passed

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

…CL yang models.

[sonic-vlan.yang]: modify vlan table key from vlanid(int) to vlan_name(string).

[yangModelTesting.py] Fix Test Code and JSON input.
@@ -38,11 +38,11 @@ module sonic-vlan {

list VLAN_INTERFACE_LIST {

key "vlanid ip-prefix";
key "vlan_name ip-prefix";
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the reason to remove vlanid from the vlan interface list, and replace key from vlanid to vlan_name?

@@ -81,7 +81,13 @@ module sonic-vlan {

list VLAN_LIST {

key "vlanid";
key "vlan_name";
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the reason to remove vlanid?

@li-pingmao li-pingmao removed their assignment Dec 8, 2019
@@ -170,7 +170,7 @@ module sonic-acl {
choice icmp {

case icmp4 {
when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPV4ANY' or .='ARP'])";
when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPv4ANY' or .='IPV4ANY' or .='ARP'])";
Copy link
Owner

Choose a reason for hiding this comment

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

According to the aclorch.cpp backend code, all fields and values are converted to upper case. I think we should convert that too before yang model's validation.

Copy link
Collaborator Author

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

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

I debugged and found, sonic-cfggen\configDB class converts everything to UPPER. So I will convert every string to UPPER while Translation. And we can keep only UPPER in Yang Models.

@zhenggen-xu zhenggen-xu merged commit d3fb685 into zhenggen-xu:sonic-cfg-mgmt Dec 11, 2019
zhenggen-xu pushed a commit that referenced this pull request Jan 10, 2020
* [sonic-head.yang]: Minor modification for enumeration of ip-type in ACL yang models.

[sonic-vlan.yang]: modify vlan table key from vlanid(int) to vlan_name(string).

[yangModelTesting.py] Fix Test Code and JSON input.

* [sonic-acl.yang]: Present Enumeration similar to config DB.

* [sonic-head.yang]: Minor update in enumeration
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 12, 2020
* src/sonic-telemetry fa8d498...3bd7ca3 (4):
  > Update gnmi deps (zhenggen-xu#40)
  > [testdata] Update SFP keys to align with new standard (zhenggen-xu#39)
  > Fixed the parameters for subscribe APIs (zhenggen-xu#38)
  > Azure ro mode (zhenggen-xu#34)

* src/sonic-mgmt-common 444aa9a...cc01ce4 (4):
  > Make gnmi dep version the same as in telemetry repo (zhenggen-xu#17)
  > Cleanup translib and cvl go test cases (zhenggen-xu#13)
  > Package update and enhancements/fixes in YGOT, and Request Binder (zhenggen-xu#12)
  > Translib phase I changes (zhenggen-xu#11)

Note: sonic-telemetry submodule update is dependent upon sonic-mgmt-common submodule update, thus updating both in this patch
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
Updated the hw-mgmt pointer to include some bugfixes related to power supply voltages.
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.

3 participants