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

[sonic-yang-mgmt]: Move yang models to src/sonic-yang-models and build infra changes. #54

Merged
merged 9 commits into from
Apr 8, 2020

Conversation

praveen-li
Copy link
Collaborator

@praveen-li praveen-li commented Feb 24, 2020

- What I did
[sonic-yang-mgmt]: Move yang models to src/sonic-yang-models and build infra changes.

1.) Move yang models to src/sonic-yang-models.
2.) New build infra for src/sonic-yang-models.
3.) Change in build infra for src/sonic-yang-mgmt.
4.) Makefile changes to make sonic-yang-mgmt depend on sonic-yang-models.
5.) Test files changes.

- How I did it
Wrote yang models based on Guideline doc:
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md
and
https://github.com/Azure/SONiC/wiki/Configuration.

Wrote python wheel Package infra which runs test for these Yang models using a json files which consists configuration as per yang models. These configs are for negative tests, which means we want to test that must conditions, patterns and when conditions works as expected.

- How to verify it

Wrote python wheel Package infra which runs test for these Yang models using a json files which consists configuration as per yang models. These configs are for negative tests, which means we want to test that must conditions, patterns and when conditions works as expected.

pchaudha@e8879b00ab3e:/sonic$ make -f slave.mk target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl
SONiC Build System

Build Configuration
"CONFIGURED_PLATFORM"             : "broadcom"
"CONFIGURED_ARCH"                 : "amd64"
"SONIC_CONFIG_PRINT_DEPENDENCIES" : ""
"SONIC_BUILD_JOBS"                : "1"
"SONIC_CONFIG_MAKE_JOBS"          : "24"
"SONIC_USE_DOCKER_BUILDKIT"       : ""
"USERNAME"                        : "admin"
"PASSWORD"                        : "YourPaSsWoRd"
"ENABLE_DHCP_GRAPH_SERVICE"       : ""
"SHUTDOWN_BGP_ON_START"           : ""
"ENABLE_PFCWD_ON_START"           : ""
"INSTALL_DEBUG_TOOLS"             : ""
"ROUTING_STACK"                   : "frr"
"FRR_USER_UID"                    : "300"
"FRR_USER_GID"                    : "300"
"ENABLE_SYNCD_RPC"                : ""
"ENABLE_ORGANIZATION_EXTENSIONS"  : "y"
"HTTP_PROXY"                      : ""
"HTTPS_PROXY"                     : ""
"ENABLE_SYSTEM_TELEMETRY"         : "y"
"ENABLE_RESTAPI"                  : "n"
"ENABLE_ZTP"                      : ""
"SONIC_DEBUGGING_ON"              : ""
"SONIC_PROFILING_ON"              : ""
"KERNEL_PROCURE_METHOD"           : "build"
"BUILD_TIMESTAMP"                 : ""
"BLDENV"                          : ""
"VS_PREPARE_MEM"                  : "yes"
"ENABLE_SFLOW"                    : "y"

pchaudha@e8879b00ab3e:/sonic$ make -f slave.mk target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl

Build Logs:

/sonic/src/sonic-yang-models /sonic
running test
running egg_info
writing dependency_links to sonic_yang_models.egg-info/dependency_links.txt
writing sonic_yang_models.egg-info/PKG-INFO
writing top-level names to sonic_yang_models.egg-info/top_level.txt
reading manifest file 'sonic_yang_models.egg-info/SOURCES.txt'
writing manifest file 'sonic_yang_models.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
running bdist_wheel
running build
running build_py
(Reading database ... 155852 files and directories currently installed.)
Preparing to unpack .../libyang_1.0.73_amd64.deb ...
Unpacking libyang (1.0.73) over (1.0.73) ...
Setting up libyang (1.0.73) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
(Reading database ... 155852 files and directories currently installed.)
Preparing to unpack .../libyang-cpp_1.0.73_amd64.deb ...
Unpacking libyang-cpp (1.0.73) over (1.0.73) ...
Setting up libyang-cpp (1.0.73) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
(Reading database ... 155852 files and directories currently installed.)
Preparing to unpack .../python3-yang_1.0.73_amd64.deb ...
Unpacking python3-yang (1.0.73) over (1.0.73) ...
Setting up python3-yang (1.0.73) ...
INFO:YANG-TEST:module: sonic-vlan is loaded successfully
ERROR:YANG-TEST:Could not get module: sonic-head
ERROR:YANG-TEST:Could not get module: sonic-extension
INFO:YANG-TEST:module: sonic-portchannel is loaded successfully
INFO:YANG-TEST:module: sonic-acl is loaded successfully
INFO:YANG-TEST:module: sonic-loopback-interface is loaded successfully
ERROR:YANG-TEST:Could not get module: sonic-port
INFO:YANG-TEST:module: sonic-interface is loaded successfully
INFO:YANG-TEST:
------------------- Test 1: Configure a member port in VLAN_MEMBER table which does not exist.---------------------
libyang[0]: Leafref "/sonic-port:sonic-port/sonic-port:PORT/sonic-port:PORT_LIST/sonic-port:port_name" of value "Ethernet156" points to a non-existing leaf. (path: /sonic-vlan:sonic-vl
an/VLAN_MEMBER/VLAN_MEMBER_LIST[vlan_name='Vlan100'][port='Ethernet156']/port)
INFO:YANG-TEST:Configure a member port in VLAN_MEMBER table which does not exist. Passed

INFO:YANG-TEST:
------------------- Test 2: Configure non-existing ACL_TABLE in ACL_RULE.---------------------
libyang[0]: Leafref "/sonic-acl:sonic-acl/sonic-acl:ACL_TABLE/sonic-acl:ACL_TABLE_LIST/sonic-acl:ACL_TABLE_NAME" of value "NOT-EXIST" points to a non-existing leaf. (path: /sonic-acl:s
onic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NOT-EXIST'][RULE_NAME='Rule_20']/ACL_TABLE_NAME)
INFO:YANG-TEST:Configure non-existing ACL_TABLE in ACL_RULE. Passed

INFO:YANG-TEST:
------------------- Test 3: Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE.---------------------
libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PAC
L-V4'][RULE_NAME='Rule_40']/ICMPV6_CODE)
INFO:YANG-TEST:Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE. Passed

INFO:YANG-TEST:
------------------- Test 4: Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.---------------------
libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PAC
L-V4'][RULE_NAME='Rule_20']/SRC_IPV6)
INFO:YANG-TEST:Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE. Passed

INFO:YANG-TEST:
------------------- Test 5: Add dhcp_server which is not in correct ip-prefix format.---------------------
libyang[0]: Invalid value "10.186.72.566" in "dhcp_servers" element. (path: /sonic-vlan:sonic-vlan/VLAN/VLAN_LIST/dhcp_servers[.='10.186.72.566'])
INFO:YANG-TEST:Add dhcp_server which is not in correct ip-prefix format. Passed

INFO:YANG-TEST:
------------------- Test 6: 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 7: Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE.---------------------
libyang[0]: Value "0x080C" does not satisfy the constraint "(0x88CC|0x8100|0x8915|0x0806|0x0800|0x86DD|0x8847)" (range, length, or pattern). (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RU
LE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4'][RULE_NAME='Rule_40']/INNER_ETHER_TYPE)
INFO:YANG-TEST:Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE. Passed

INFO:YANG-TEST:
------------------- Test 8: Vlan Interface Ip-prefix must condition failure.---------------------
libyang[0]: Must condition "(current() = ../../VLAN_INTERFACE_LIST[vlan_name=current()]/vlan_name)" not satisfied. (path: /sonic-vlan:sonic-vlan/VLAN_INTERFACE/VLAN_INTERFACE_IPPREFIX_
LIST[vlan_name='Vlan100'][ip-prefix='2a04:5555:66:7777::/64']/vlan_name)
libyang[0]: Must condition not satisfied, Try adding Vlan<vlanid>: {}, Example: 'Vlan100': {} (path: /sonic-vlan:sonic-vlan/VLAN_INTERFACE/VLAN_INTERFACE_IPPREFIX_LIST[vlan_name='Vlan1
00'][ip-prefix='2a04:5555:66:7777::/64']/vlan_name)
INFO:YANG-TEST:Vlan Interface Ip-prefix must condition failure. Passed

INFO:YANG-TEST:
------------------- Test 9: Configure l4_src_port_range as 99999-99999 in ACL_RULE---------------------
libyang[0]: Value "99999-99999" does not satisfy the constraint "([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])-([0-9]{1,4}|[0-5][0
-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])" (range, length, or pattern). (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW
-PACL-V6'][RULE_NAME='Rule_20']/L4_SRC_PORT_RANGE)
INFO:YANG-TEST:Configure l4_src_port_range as 99999-99999 in ACL_RULE Passed

INFO:YANG-TEST:
------------------- Test 10: 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 11: 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 12: Interface Ip-prefix port-name must condition failure.---------------------
libyang[0]: Must condition "(current() = ../../INTERFACE_LIST[port_name=current()]/port_name)" not satisfied. (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_IPPREFIX_LIST[
port_name='Ethernet8'][ip-prefix='10.0.0.0/30']/port_name)
libyang[0]: Must condition not satisfied, Try adding PORT: {}, Example: 'Ethernet0': {} (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_IPPREFIX_LIST[port_name='Ethernet8']
[ip-prefix='10.0.0.0/30']/port_name)
INFO:YANG-TEST:Interface Ip-prefix port-name must condition failure. Passed

INFO:YANG-TEST:
------------------- Test 13: Interface Ip-prefix port-name must condition pass.---------------------
libyang[0]: Missing required element "lanes" in "PORT_LIST". (path: /sonic-port:sonic-port/PORT/PORT_LIST[port_name='Ethernet8'])
INFO:YANG-TEST:Interface Ip-prefix port-name must condition pass. Passed

INFO:YANG-TEST:
------------------- Test 14: Loopback Ip-prefix port-name must condition failure.---------------------
libyang[0]: Must condition "(current() = ../../LOOPBACK_INTERFACE_LIST[loopback_interface_name=current()]/loopback_interface_name)" not satisfied. (path: /sonic-loopback-interface:soni
c-loopback-interface/LOOPBACK_INTERFACE/LOOPBACK_INTERFACE_IPPREFIX_LIST[loopback_interface_name='lo1'][ip-prefix='2a04:5555:66:7777::/64']/loopback_interface_name)
libyang[0]: Must condition not satisfied, Try adding lo<>: {}, Example: 'lo1': {} (path: /sonic-loopback-interface:sonic-loopback-interface/LOOPBACK_INTERFACE/LOOPBACK_INTERFACE_IPPREF
IX_LIST[loopback_interface_name='lo1'][ip-prefix='2a04:5555:66:7777::/64']/loopback_interface_name)
INFO:YANG-TEST:Loopback Ip-prefix port-name must condition failure. Passed

INFO:YANG-TEST:
------------------- Test 15: Configure empty string as ip-prefix in INTERFACE table.---------------------
libyang[0]: Invalid value "" in "ip-prefix" element. (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_IPPREFIX_LIST[ip-prefix='']/ip-prefix)
INFO:YANG-TEST:Configure empty string as ip-prefix in INTERFACE table. Passed

INFO:YANG-TEST:
------------------- Test 16: Configure Wrong family with ip-prefix for VLAN_Interface Table---------------------
libyang[0]: Must condition "(contains(../ip-prefix, ':') and current()='IPv6') or                               (contains(../ip-prefix, '.') and current()='IPv4')" not satisfied. (path
: /sonic-vlan:sonic-vlan/VLAN_INTERFACE/VLAN_INTERFACE_IPPREFIX_LIST[vlan_name='Vlan100'][ip-prefix='2a04:5555:66:7777::/64']/family)
INFO:YANG-TEST:Configure Wrong family with ip-prefix for VLAN_Interface Table Passed

INFO:YANG-TEST:
------------------- Test 17: 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/V
LAN_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/V
LAN_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:
------------------- Test 18: Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.---------------------
libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PAC
L-V6'][RULE_NAME='Rule_20']/DST_IPV6)
INFO:YANG-TEST:Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE. 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/python3-yang_1.0.73_amd64.deb installed
YANG Tests passed

copying tests/yangModelTesting.py -> build/lib/tests
running egg_info
writing sonic_yang_models.egg-info/PKG-INFO
writing top-level names to sonic_yang_models.egg-info/top_level.txt
writing dependency_links to sonic_yang_models.egg-info/dependency_links.txt
reading manifest file 'sonic_yang_models.egg-info/SOURCES.txt'
writing manifest file 'sonic_yang_models.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/tests
copying build/lib/tests/yangModelTesting.py -> build/bdist.linux-x86_64/wheel/tests
copying build/lib/tests/test_sonic_yang_models.py -> build/bdist.linux-x86_64/wheel/tests
copying build/lib/tests/__init__.py -> build/bdist.linux-x86_64/wheel/tests
running install_data
creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data
creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data
creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models
copying ./yang-models/sonic-head.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models
copying ./yang-models/sonic-extension.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models
copying ./yang-models/sonic-acl.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models
copying ./yang-models/sonic-interface.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models
running install_egg_info
Copying sonic_yang_models.egg-info to build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.dist-info/WHEEL
/sonic
pchaudha@e8879b00ab3e:/sonic$ make -f slave.mk target/python-wheels/sonic_yang_mgmt-1.0-py2-none-any.whl-clean
SONiC Build System


pchaudha@e8879b00ab3e:/sonic$ make -f slave.mk target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl-clean
SONiC Build System

pchaudha@e8879b00ab3e:/sonic$ ls target/python-wheels/
sonic_config_engine-1.0-py2-none-any.whl              sonic_yang_models-1.0-py3-none-any.whl.log
sonic_config_engine-1.0-py2-none-any.whl-install.log  swsssdk-2.0.1-py2-none-any.whl
sonic_config_engine-1.0-py2-none-any.whl.log          swsssdk-2.0.1-py2-none-any.whl-install.log
sonic_yang_mgmt-1.0-py2-none-any.whl.log              swsssdk-2.0.1-py2-none-any.whl.log
sonic_yang_models-1.0-py3-none-any.whl-install.log


pchaudha@e8879b00ab3e:/sonic$ make -f slave.mk target/python-wheels/sonic_yang_mgmt-1.0-py2-none-any.whl
SONiC Build System

Build Configuration
"CONFIGURED_PLATFORM"             : "broadcom"
"CONFIGURED_ARCH"                 : "amd64"
"SONIC_CONFIG_PRINT_DEPENDENCIES" : ""
"SONIC_BUILD_JOBS"                : "1"
"SONIC_CONFIG_MAKE_JOBS"          : "24"
"SONIC_USE_DOCKER_BUILDKIT"       : ""
"PASSWORD"                        : "YourPaSsWoRd"
"ENABLE_DHCP_GRAPH_SERVICE"       : ""
"SHUTDOWN_BGP_ON_START"           : ""
"ENABLE_PFCWD_ON_START"           : ""
"INSTALL_DEBUG_TOOLS"             : ""
"ROUTING_STACK"                   : "frr"
"FRR_USER_UID"                    : "300"
"FRR_USER_GID"                    : "300"
"ENABLE_SYNCD_RPC"                : ""
"ENABLE_ORGANIZATION_EXTENSIONS"  : "y"
"HTTP_PROXY"                      : ""
"HTTPS_PROXY"                     : ""
"ENABLE_SYSTEM_TELEMETRY"         : "y"
"ENABLE_RESTAPI"                  : "n"
"ENABLE_ZTP"                      : ""
"SONIC_DEBUGGING_ON"              : ""
"SONIC_PROFILING_ON"              : ""
"KERNEL_PROCURE_METHOD"           : "build"
"BUILD_TIMESTAMP"                 : ""
"BLDENV"                          : ""
"VS_PREPARE_MEM"                  : "yes"
"ENABLE_SFLOW"                    : "y"

[ 01 ] [ target/python-wheels/sonic_yang_mgmt-1.0-py2-none-any.whl ]
pchaudha@e8879b00ab3e:/sonic$
pchaudha@e8879b00ab3e:/sonic$ ls target/python-wheels/
sonic_config_engine-1.0-py2-none-any.whl              sonic_yang_models-1.0-py3-none-any.whl-install.log
sonic_config_engine-1.0-py2-none-any.whl-install.log  sonic_yang_models-1.0-py3-none-any.whl.log
sonic_config_engine-1.0-py2-none-any.whl.log          swsssdk-2.0.1-py2-none-any.whl
sonic_yang_mgmt-1.0-py2-none-any.whl                  swsssdk-2.0.1-py2-none-any.whl-install.log
sonic_yang_mgmt-1.0-py2-none-any.whl.log              swsssdk-2.0.1-py2-none-any.whl.log
sonic_yang_models-1.0-py3-none-any.whl
pchaudha@e8879b00ab3e:/sonic$

- Description for the changelog

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

@zhenggen-xu
Copy link
Owner

Can you describe the difference from this PR than the old yang models? Are you just moving the location or you have new changes? please include the removing action in the PR if just move location. If you have other changes, I would prefer to have another on top of it.

@praveen-li
Copy link
Collaborator Author

praveen-li commented Feb 26, 2020 via email

@zhenggen-xu
Copy link
Owner

I see commit 2 has same code but different location from old code. Please in this same PR, remove the old code, then add the new code. If any new changes like pip3 support, we should have a separate PR for now so it is easy to review. For upstream, since it is not merged yet, everything can go with one PR if you see fit.

@praveen-li praveen-li changed the title [sonic-yang-models]: First version of yang models for Sonic. [sonic-yang-mgmt]: Move yang models to src/sonic-yang-models and build infra changes. Mar 9, 2020
@zhenggen-xu
Copy link
Owner

@praveen-li Can you build an image with this change and load it on the box and try some of the system level functions?

@zhenggen-xu
Copy link
Owner

please resolve the conflicts and include the test results for the image with this PR.

@praveen-li praveen-li force-pushed the sonicYang branch 4 times, most recently from c78d2f4 to fe3c020 Compare March 20, 2020 18:51
Praveen Chaudhary added 8 commits April 7, 2020 16:23
…d infra changes.

1.) Move yang models to src/sonic-yang-models.
2.) New build infra for src/sonic-yang-models.
3.) Change in build infra for src/sonic-yang-mgmt.
4.) Makefile changes to make sonic-yang-mgmt depend on sonic-yang-models.
5.) Test files changes.
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Changes:
-- Reverting back to PY2.
-- Keeping package environment varible name to SONIC_YANG_MGMT_PY

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
@praveen-li
Copy link
Collaborator Author

praveen-li commented Apr 8, 2020

@zhenggen-xu @li-pingmao

Test results on sonic image [latest DPB code + this PR]: [Please try to approve and merge fast, I want to raise new PRs on this new location, also I want to keep MSFT PRs similar to this.]. Thx.

Testing with sonic image build with sonicYang branch.

Check PKGs are installed on sonic image:

admin@lnos-x1-a-fab01:~$ sudo dpkg -l | grep pip
ii  python-pip-whl                9.0.1-2+deb9u1                    all          Python package installer
ii  python3-pip                   9.0.1-2+deb9u1                    all          Python package installer
admin@lnos-x1-a-fab01:~$ ls /usr/local/yang-models/sonic
sonic-acl.yang                 sonic-portchannel.yang
sonic-extension.yang           sonic-port.yang
sonic-head.yang                sonic-vlan.yang
sonic-interface.yang           sonic_yang_tree
sonic-loopback-interface.yang  
admin@lnos-x1-a-fab01:~$ ls /usr/local/lib/python2.7/dist-packages/sonic_yang
sonic_yang_mgmt-1.0.dist-info/ sonic_yang.pyc
sonic_yang.py                  
xt.py@lnos-x1-a-fab01:~$ ls /usr/local/lib/python2.7/dist-packages/_sonic_yang_ex
_sonic_yang_ext.py 

Run bbreakout

@lnos-x1-a-fab01:~$ sudo config interface breakout Ethernet4 2x50G -v -y >  
admin@lnos-x1-a-fab01:~$ cat out | more

Running Breakout Mode : 1x100G[40G] 
Target Breakout Mode : 2x50G

Ports to be deleted : 
 {
    "Ethernet4": "100000"
}
Ports to be added : 
 {
    "Ethernet6": "50000", 
    "Ethernet4": "50000"
}

After running Logic to limit the impact

Final list of ports to be deleted : 
 {
    "Ethernet4": "100000"
} 
Final list of ports to be added :  
 {
    "Ethernet6": "50000", 
    "Ethernet4": "50000"
}
Loaded below Yang Models
['sonic-acl', 'sonic-extension', 'sonic-head', 'sonic-interface', 'sonic-loopbac
k-interface', 'sonic-port', 'sonic-portchannel', 'sonic-vlan']
Reading data from Redis configDb

Start Port Deletion
Find dependecies for port Ethernet4
Dependecies Exist. No further action will be taken
*** Printing dependecies ***
/sonic-interface:sonic-interface/INTERFACE/INTERFACE_LIST[port_name='Ethernet4']
/port_name
/sonic-interface:sonic-interface/INTERFACE/INTERFACE_IPPREFIX_LIST[port_name='Et
hernet4'][ip-prefix='10.0.0.2/31']/port_name
lnos-x1-a-fab01:~$ sudo config interface breakout Ethernet4 2x50G -v -y -f
Running Breakout Mode : 1x100G[40G] 
Target Breakout Mode : 2x50G

Ports to be deleted : 
 {
    "Ethernet4": "100000"
}
Ports to be added : 
 {
    "Ethernet6": "50000", 
    "Ethernet4": "50000"
}

After running Logic to limit the impact

Final list of ports to be deleted : 
 {
    "Ethernet4": "100000"
} 
Final list of ports to be added :  
 {
    "Ethernet6": "50000",
    "Ethernet4": "50000"
}

Loaded below Yang Models
['sonic-acl', 'sonic-extension', 'sonic-head', 'sonic-interface', 'sonic-loopbac
k-interface', 'sonic-port', 'sonic-portchannel', 'sonic-vlan']
Reading data from Redis configDb

Start Port Deletion
Find dependecies for port Ethernet4
Deleting Port: Ethernet4
Data Validation successful
Generate Final Config to write in DB

Start Port Addition
Data Validation successful
Generate Final Config to write in DB
Writing in Config DB
Verify Port Deletion from Asic DB, Wait...
sudo redis-cli -n 1 hgetall "ASIC_STATE:SAI_OBJECT_TYPE_PORT:oid:0x1000000000013
"
Writing in Config DB
Breakout process got successfully completed.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
@zhenggen-xu zhenggen-xu merged commit 71326e7 into zhenggen-xu:sonic-cfg-mgmt Apr 8, 2020
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
3f43852b8 [sonic_operators.cpp]: Increasing select timeout (zhenggen-xu#55)
a1142e251  [sonic_operators.cpp] Update sonic_db_manager::get_counter (zhenggen-xu#56)
1069d2dd4 [sonic_operators.cpp]: Fixbug wait with false positive to return success (zhenggen-xu#54)

Signed-off-by: Ze Gan <ganze718@gmail.com>
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
[202012][sonic-linkmgrd]Submodule update

8507629 Jing Zhang      Mon Apr 4 10:25:22 2022 -0700   Lower unsolicited MUX state change notification log level to WARNING zhenggen-xu#57
17d217d Longxiang Lyu   Mon Mar 21 12:15:19 2022 +0800  Enhance clang format (zhenggen-xu#46)
c72fa2a Jing Zhang      Fri Apr 1 12:23:29 2022 -0700   Disable the feature that decreases link probe interval for measuring switch overhead zhenggen-xu#49 (zhenggen-xu#54)
256b01b Jing Zhang      Thu Mar 31 16:20:00 2022 -0700  Update link prober metrics posting logics zhenggen-xu#50 zhenggen-xu#53
dfd48d0 Jing Zhang      Wed Mar 23 16:27:45 2022 -0700  Decrease link probing interval after switchover to better determine the overhead of a toggle zhenggen-xu#43 (zhenggen-xu#48)

sign-off: Jing Zhang zhangjing@microsoft.com
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