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-models]: YANG model changes for INTERFACE, VLAN_INTERFACE, LOOP… #36

Merged
merged 2 commits into from
Feb 9, 2020

Conversation

praveen-li
Copy link
Collaborator

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

…BACK_INTERFACE.

Note: Do not Merge till PLY change to process multilist are done.

Changes:
1.) YANG model changes to accommodate VRF feature.
2.) Test case addition for new must condition.
3.) Test case changes for old config for INTERFACE and VLAN_INTERFACE.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

- What I did
1.) YANG model changes to accommodate VRF feature.
2.) Test case addition for new must condition.
3.) Test case changes for old config for INTERFACE and VLAN_INTERFACE.

- How I did it
Modified YANG Models.

- How to verify it
By YANG Model Testing:

pchaudha@e8879b00ab3e:/sonic/src/sonic-yang-mgmt/tests/yang-model-tests$ python yangModelTesting.py -f yangTest.json -y ../../yang-models/ -v > result
DEBUG:YANG-TEST:['sonic-vlan', 'sonic-head', 'sonic-portchannel', 'sonic-acl', 'sonic-loopback-interface', 'sonic-port', 'sonic-interface']
DEBUG:YANG-TEST:sonic-vlan
INFO:YANG-TEST:module: sonic-vlan is loaded successfully
DEBUG:YANG-TEST:sonic-head
ERROR:YANG-TEST:Could not get module: sonic-head
DEBUG:YANG-TEST:sonic-portchannel
INFO:YANG-TEST:module: sonic-portchannel is loaded successfully
DEBUG:YANG-TEST:sonic-acl
INFO:YANG-TEST:module: sonic-acl is loaded successfully
DEBUG:YANG-TEST:sonic-loopback-interface
libyang[1]: Schema node "ip-prefix" not found ((contains(../ip-prefix) with context node "/sonic-loopback-interface:sonic-loopback-interface/LOOPBACK_INTERFACE/LOOPBACK_INTERFACE_IPPREFIX_LIST/family".
libyang[1]: Schema node "ip-prefix" not found ((contains(../ip-prefix, ':') and current()='IPv6') or
(contains(../ip-prefix) with context node "/sonic-loopback-interface:sonic-loopback-interface/LOOPBACK_INTERFACE/LOOPBACK_INTERFACE_IPPREFIX_LIST/family".
INFO:YANG-TEST:module: sonic-loopback-interface is loaded successfully
DEBUG:YANG-TEST:sonic-port
ERROR:YANG-TEST:Could not get module: sonic-port
DEBUG:YANG-TEST:sonic-interface
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: VLAN_WITH_NON_EXIST_PORT
DEBUG:YANG-TEST:{"sonic-vlan:sonic-vlan": {"sonic-vlan:VLAN": {"VLAN_LIST": [{"description": "server_vlan", "vlan_name": "Vlan100"}]}, "sonic-vlan:VLAN_MEMBER": {"VLAN_MEMBER_LIST": [{"tagging_mode": "tagged", "port": "Ethernet156", "vlan_name": "Vlan100"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlan_name='Vlan100'][port='Ethernet156']/port)
DEBUG:YANG-TEST: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.
DEBUG:YANG-TEST:['Leafref', 'non-existing']
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_WITH_NON_EXIST_ACL_TABLE
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"PRIORITY": 999980, "PACKET_ACTION": "FORWARD", "SRC_IP": "10.176.0.0/15", "RULE_NAME": "Rule_20", "ACL_TABLE_NAME": "NOT-EXIST", "IP_TYPE": "IPv4ANY", "DST_IP": "10.186.72.0/26"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "type": "L3", "policy_desc": "Filter IPv6", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NOT-EXIST'][RULE_NAME='Rule_20']/ACL_TABLE_NAME)
DEBUG:YANG-TEST: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.
DEBUG:YANG-TEST:['Leafref', 'non-existing']
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_ARP_TYPE_ICMPV6_CODE_MISMATCH
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"PRIORITY": 999960, "PACKET_ACTION": "FORWARD", "SRC_IP": "10.176.0.0/15", "RULE_NAME": "Rule_40", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "INNER_ETHER_TYPE": "0x88CC", "IP_TYPE": "ARP", "DST_IP": "10.186.72.64/26", "ICMPV6_CODE": 5}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "type": "L3", "policy_desc": "Filter IPv4", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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-PACL-V4'][RULE_NAME='Rule_40']/ICMPV6_CODE)
DEBUG:YANG-TEST:When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied.
DEBUG:YANG-TEST:['When condition', 'not satisfied', 'IP_TYPE']
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"SRC_IPV6": "2001::1/64", "PACKET_ACTION": "FORWARD", "PRIORITY": 999980, "RULE_NAME": "Rule_20", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "IP_TYPE": "IPv4ANY"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "type": "L3", "policy_desc": "Filter IPv4", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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-PACL-V4'][RULE_NAME='Rule_20']/SRC_IPV6)
DEBUG:YANG-TEST:When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied.
DEBUG:YANG-TEST:['When condition', 'not satisfied', 'IP_TYPE']
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: DHCP_SERVER_INCORRECT_FORMAT
DEBUG:YANG-TEST:{"sonic-vlan:sonic-vlan": {"sonic-vlan:VLAN": {"VLAN_LIST": [{"admin_status": "up", "dhcp_servers": ["10.186.72.566"], "description": "server_vlan", "vlan_name": "Vlan100", "mtu": "9216"}]}}}
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'])
DEBUG:YANG-TEST:Invalid value "10.186.72.566" in "dhcp_servers" element.
DEBUG:YANG-TEST:['Invalid value', 'dhcp_servers']
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.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_TABLE_UNDEFINED_TABLE_TYPE
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V6", "type": "LAYER3V4", "policy_desc": "Filter IPv6", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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)
DEBUG:YANG-TEST:Invalid value "LAYER3V4" in "type" element.
DEBUG:YANG-TEST:['Invalid value', '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.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_WRONG_INNER_ETHER_TYPE
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"PRIORITY": 999960, "PACKET_ACTION": "FORWARD", "SRC_IP": "10.176.0.0/15", "RULE_NAME": "Rule_40", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "INNER_ETHER_TYPE": "0x080C", "IP_TYPE": "ARP", "DST_IP": "10.186.72.64/26"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "type": "L3", "policy_desc": "Filter IPv4", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4'][RULE_NAME='Rule_40']/INNER_ETHER_TYPE)
DEBUG:YANG-TEST:Value "0x080C" does not satisfy the constraint "(0x88CC|0x8100|0x8915|0x0806|0x0800|0x86DD|0x8847)" (range, length, or pattern).
DEBUG:YANG-TEST:['pattern', 'does not satisfy']
INFO:YANG-TEST:Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE. Passed

INFO:YANG-TEST:
------------------- Test 8: Configure l4_src_port_range as 99999-99999 in ACL_RULE---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_WRONG_L4_SRC_PORT_RANGE
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"SRC_IPV6": "2a04:f547:41::/48", "PACKET_ACTION": "FORWARD", "PRIORITY": 999980, "RULE_NAME": "Rule_20", "ACL_TABLE_NAME": "NO-NSW-PACL-V6", "L4_SRC_PORT_RANGE": "99999-99999", "IP_TYPE": "IP", "DST_IPV6": "2a04:f547:43:320::/64"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V6", "type": "L3V6", "policy_desc": "Filter IPv6", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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)
DEBUG:YANG-TEST: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).
DEBUG:YANG-TEST:['pattern', 'does not satisfy']
INFO:YANG-TEST:Configure l4_src_port_range as 99999-99999 in ACL_RULE Passed

INFO:YANG-TEST:
------------------- Test 9: Configure undefined packet_action in ACL_RULE table.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_UNDEFINED_PACKET_ACTION
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"PRIORITY": 999980, "PACKET_ACTION": "SEND", "SRC_IP": "10.176.0.0/15", "RULE_NAME": "Rule_20", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "IP_TYPE": "IPV4ANY", "DST_IP": "10.186.72.0/26"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "type": "L3", "policy_desc": "Filter IPv4", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
libyang[0]: Invalid value "SEND" in "PACKET_ACTION" element. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST/PACKET_ACTION)
DEBUG:YANG-TEST:Invalid value "SEND" in "PACKET_ACTION" element.
DEBUG:YANG-TEST:['Invalid value', 'PACKET_ACTION']
INFO:YANG-TEST:Configure undefined packet_action in ACL_RULE table. Passed

INFO:YANG-TEST:
------------------- Test 10: Configure wrong value for tagging_mode.---------------------
DEBUG:YANG-TEST: Read JSON Section: TAGGING_MODE_WRONG_VALUE
DEBUG:YANG-TEST:{"sonic-vlan:sonic-vlan": {"sonic-vlan:VLAN": {"VLAN_LIST": [{"description": "server_vlan", "vlan_name": "Vlan100"}]}, "sonic-vlan:VLAN_MEMBER": {"VLAN_MEMBER_LIST": [{"tagging_mode": "non-tagged", "port": "Ethernet0", "vlan_name": 100}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}]}}}
libyang[0]: Invalid value "non-tagged" in "tagging_mode" element. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST/tagging_mode)
DEBUG:YANG-TEST:Invalid value "non-tagged" in "tagging_mode" element.
DEBUG:YANG-TEST:['Invalid value', 'tagging_mode']
INFO:YANG-TEST:Configure wrong value for tagging_mode. Passed

INFO:YANG-TEST:
------------------- Test 11: Interface Ip-prefix port-name must condition failure.---------------------
DEBUG:YANG-TEST: Read JSON Section: INTERFACE_IPPREFIX_PORT_MUST_CONDITION_FALSE
DEBUG:YANG-TEST:{"sonic-interface:sonic-interface": {"sonic-interface:INTERFACE": {"INTERFACE_LIST": [{"port_name": "Ethernet9"}], "INTERFACE_IPPREFIX_LIST": [{"ip-prefix": "10.0.0.1/30", "port_name": "Ethernet8", "family": "IPv4", "scope": "global"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet8", "mtu": 9000, "alias": "eth8", "admin_status": "up", "port_name": "Ethernet8", "speed": 25000}, {"description": "Ethernet9", "mtu": 9000, "alias": "eth9", "admin_status": "up", "port_name": "Ethernet9", "speed": 25000}]}}}
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)
DEBUG:YANG-TEST:Must condition not satisfied, Try adding PORT: {}, Example: 'Ethernet0': {}
DEBUG:YANG-TEST:['Must condition', 'not satisfied']
INFO:YANG-TEST:Interface Ip-prefix port-name must condition failure. Passed

INFO:YANG-TEST:
------------------- Test 12: Interface Ip-prefix port-name must condition pass.---------------------
DEBUG:YANG-TEST: Read JSON Section: INTERFACE_IPPREFIX_PORT_MUST_CONDITION_TRUE
DEBUG:YANG-TEST:{"sonic-interface:sonic-interface": {"sonic-interface:INTERFACE": {"INTERFACE_LIST": [{"port_name": "Ethernet8"}], "INTERFACE_IPPREFIX_LIST": [{"ip-prefix": "10.0.0.1/30", "port_name": "Ethernet8", "family": "IPv4", "scope": "global"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet8", "mtu": 9000, "alias": "eth8", "admin_status": "up", "port_name": "Ethernet8", "speed": 25000}]}}}
DEBUG:YANG-TEST:['']
INFO:YANG-TEST:Interface Ip-prefix port-name must condition pass. Passed

INFO:YANG-TEST:
------------------- Test 13: Configure empty string as ip-prefix in INTERFACE table.---------------------
DEBUG:YANG-TEST: Read JSON Section: INTERFACE_IP_PREFIX_EMPTY_STRING
DEBUG:YANG-TEST:{"sonic-interface:sonic-interface": {"sonic-interface:INTERFACE": {"INTERFACE_LIST": [{"port_name": "Ethernet8"}], "INTERFACE_IPPREFIX_LIST": [{"ip-prefix": "", "port_name": "Ethernet8", "family": "IPv4", "scope": "global"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet8", "mtu": 9000, "alias": "eth8", "admin_status": "up", "port_name": "Ethernet8", "speed": 25000}]}}}
libyang[0]: Invalid value "" in "ip-prefix" element. (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_IPPREFIX_LIST[ip-prefix='']/ip-prefix)
DEBUG:YANG-TEST:Invalid value "" in "ip-prefix" element.
DEBUG:YANG-TEST:['Invalid value', 'ip-prefix']
INFO:YANG-TEST:Configure empty string as ip-prefix in INTERFACE table. Passed

INFO:YANG-TEST:
------------------- Test 14: Configure Wrong family with ip-prefix for VLAN_Interface Table---------------------
DEBUG:YANG-TEST: Read JSON Section: WRONG_FAMILY_WITH_IP_PREFIX
DEBUG:YANG-TEST:{"sonic-vlan:sonic-vlan": {"sonic-vlan:VLAN": {"VLAN_LIST": [{"description": "server_vlan", "vlan_name": "Vlan100"}]}, "sonic-vlan:VLAN_INTERFACE": {"VLAN_INTERFACE_IPPREFIX_LIST": [{"ip-prefix": "2a04:5555:66:7777::1/64", "family": "IPv4", "vlan_name": "Vlan100", "scope": "global"}], "VLAN_INTERFACE_LIST": [{"vlan_name": "Vlan100"}]}}}
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)
DEBUG:YANG-TEST:Must condition "(contains(../ip-prefix, ':') and current()='IPv6') or                                   (contains(../ip-prefix, '.') and current()='IPv4')" not satisfied.
DEBUG:YANG-TEST:['Must condition', 'not satisfied']
INFO:YANG-TEST:Configure Wrong family with ip-prefix for VLAN_Interface Table Passed

INFO:YANG-TEST:
------------------- Test 15: Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN  table.---------------------
DEBUG:YANG-TEST: Read JSON Section: VLAN_MEMEBER_WITH_NON_EXIST_VLAN
DEBUG:YANG-TEST:{"sonic-vlan:sonic-vlan": {"sonic-vlan:VLAN": {"VLAN_LIST": [{"description": "server_vlan", "vlan_name": "Vlan100"}, {"description": "ipmi_vlan", "vlan_name": "Vlan300"}]}, "sonic-vlan:VLAN_MEMBER": {"VLAN_MEMBER_LIST": [{"tagging_mode": "tagged", "port": "Ethernet0", "vlan_name": "Vlan200"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}]}}}
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)
DEBUG:YANG-TEST: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.
DEBUG:YANG-TEST:['Leafref', 'non-existing']
INFO:YANG-TEST:Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN  table. Passed

INFO:YANG-TEST:
------------------- Test 16: Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.---------------------
DEBUG:YANG-TEST: Read JSON Section: ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH
DEBUG:YANG-TEST:{"sonic-acl:sonic-acl": {"sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"PACKET_ACTION": "FORWARD", "PRIORITY": 999980, "RULE_NAME": "Rule_20", "ACL_TABLE_NAME": "NO-NSW-PACL-V6", "IP_TYPE": "ARP", "DST_IPV6": "2001::2/64"}]}, "sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"ports": ["Ethernet0", "Ethernet1"], "ACL_TABLE_NAME": "NO-NSW-PACL-V6", "type": "L3V6", "policy_desc": "Filter IPv6", "stage": "EGRESS"}]}}, "sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"description": "Ethernet0", "mtu": 9000, "alias": "eth0", "admin_status": "up", "port_name": "Ethernet0", "speed": 25000}, {"description": "Ethernet1", "mtu": 9000, "alias": "eth1", "admin_status": "up", "port_name": "Ethernet1", "speed": 25000}]}}}
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-PACL-V6'][RULE_NAME='Rule_20']/DST_IPV6)
DEBUG:YANG-TEST:When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied.
DEBUG:YANG-TEST:['When condition', 'not satisfied', 'IP_TYPE']
INFO:YANG-TEST:Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE. Passed

INFO:YANG-TEST:All Test Passed

- Description for the changelog

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

…BACK_INTERFACE.

Changes:
1.) YANG model changes to accomodate VRF feature.
2.) Test case addition for new must condition.
3.) Test case changes for old config for INTERFACE and VLAN_INTERFACE.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
zhenggen-xu pushed a commit that referenced this pull request Feb 8, 2020
00410e5 (HEAD, origin/master, origin/HEAD) [mgmt-framework] Update Swagger URL to repo1.maven.org (#37)
7562028 Merge pull request #36 from Azure/Arlo
cd22b4d (origin/Arlo) Added the certificate check to quiet
7fbcd46 Changed the swagger website to https
5d1041f Added sonic-mgmt-framework deb install to install the contents of sonic-mgmt-framework deb package (#30)
229fe69 Added sonic-mgmt-framework deb install to install the contents of sonic-mgmt-framework deb package

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
@zhenggen-xu zhenggen-xu merged commit 537199c into zhenggen-xu:sonic-cfg-mgmt Feb 9, 2020
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
f00efef Longxiang Lyu Wed Mar 16 09:12:46 2022 +0800 Add a command line option to store logs into a separate file (zhenggen-xu#41)
ff2e67d Longxiang Lyu Tue Mar 15 09:10:59 2022 +0800 Add default port cable type (zhenggen-xu#39)
ebbb4d8 Jing Zhang Mon Mar 14 15:41:11 2022 -0700 Prevent switching MUX to "Unknown" (zhenggen-xu#36)
c779b8f Longxiang Lyu Thu Mar 10 21:35:11 2022 +0800 [nonfunctional] Use LinkProberStateMachineBase (zhenggen-xu#38)
b9fedd0 Longxiang Lyu Wed Mar 9 13:03:58 2022 +0800 [NONFUNCTIONAL] Add LinkProberStateMachineBase (zhenggen-xu#37)
bedd42b Longxiang Lyu Wed Mar 9 10:03:00 2022 +0800 Add .clang-format file to format code (zhenggen-xu#28)
9fe4fc6 Guohan Lu Thu Mar 3 17:51:43 2022 -0800 [doc]: add lgtm badge in README.md
c1249d9 Longxiang Lyu Wed Mar 2 18:05:18 2022 +0800 Enable lgtm (zhenggen-xu#33)
b8514c6 Longxiang Lyu Wed Mar 2 13:34:39 2022 +0800 Collect port cable type to use corresponding state machine (zhenggen-xu#31)
9b59ef9 Longxiang Lyu Wed Mar 2 07:19:33 2022 +0800 Improve make clean (zhenggen-xu#32)
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
ca4b9a1 Guohan Lu Thu Mar 3 17:51:43 2022 -0800 [doc]: add lgtm badge in README.md
00c9b21 Longxiang Lyu Wed Mar 2 18:05:18 2022 +0800 Enable lgtm (zhenggen-xu#33)
3ae9be4 Longxiang Lyu Wed Mar 2 07:19:33 2022 +0800 Improve make clean (zhenggen-xu#32)
6997a1f Longxiang Lyu Wed Mar 9 10:03:00 2022 +0800 Add .clang-format file to format code (zhenggen-xu#28)
3368182 Jing Zhang Mon Mar 14 15:41:11 2022 -0700 Prevent switching MUX to "Unknown" (zhenggen-xu#36)
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