Skip to content

[sonic-yang-models] fix ip_type value in test cases#6968

Merged
lguohan merged 1 commit intosonic-net:masterfrom
dzhangalibaba:yang_fix
Mar 28, 2021
Merged

[sonic-yang-models] fix ip_type value in test cases#6968
lguohan merged 1 commit intosonic-net:masterfrom
dzhangalibaba:yang_fix

Conversation

@dzhangalibaba
Copy link
Copy Markdown
Collaborator

  • IPV4ANY is not valid value, fix to IPv4ANY
  • without this change, test case failed sometimes when the validation on IP_TYPE happens first and then PACKET_ACTION.
INFO:YANG-TEST:
------------------- Test 10: Configure undefined packet_action in ACL_RULE table.---------------------
INFO:YANG-TEST:{"sonic-port:sonic-port": {"sonic-port:PORT": {"PORT_LIST": [{"admin_status": "up", "description": "Ethernet0", "mtu": 9000, "alias": "eth0", "speed": 25000, "port_name": "Ethernet0"}, {"admin_status": "up", "description": "Ethernet1", "mtu": 9000, "alias": "eth1", "speed": 25000, "port_name": "Ethernet1"}]}}, "sonic-acl:sonic-acl": {"sonic-acl:ACL_TABLE": {"ACL_TABLE_LIST": [{"stage": "EGRESS", "type": "L3", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "ports": ["Ethernet0", "Ethernet1"], "policy_desc": "Filter IPv4"}]}, "sonic-acl:ACL_RULE": {"ACL_RULE_LIST": [{"RULE_NAME": "Rule_20", "IP_TYPE": "IPV4ANY", "PRIORITY": 999980, "SRC_IP": "10.176.0.0/15", "ACL_TABLE_NAME": "NO-NSW-PACL-V4", "DST_IP": "10.186.72.0/26", "PACKET_ACTION": "SEND"}]}}}
libyang[0]: Invalid value "IPV4ANY" in "IP_TYPE" element. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[RULE_NAME='Rule_20']/IP_TYPE)
INFO:YANG-TEST:eStr: ['Invalid value', 'PACKET_ACTION']
ERROR:YANG-TEST: Exception >Unknown Error< in /sonic/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py:301
INFO:YANG-TEST:Configure undefined packet_action in ACL_RULE table. Failed 

Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com

@dzhangalibaba dzhangalibaba requested a review from lguohan as a code owner March 4, 2021 21:53
@dzhangalibaba
Copy link
Copy Markdown
Collaborator Author

@praveen-li

@dzhangalibaba dzhangalibaba changed the title [sonic-yang-model] fix ip_type value in test cases [sonic-yang-models] fix ip_type value in test cases Mar 4, 2021
Copy link
Copy Markdown
Member

@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.

LGTM, test Fix.

"SRC_IP": "10.176.0.0/15",
"PRIORITY": 999980,
"IP_TYPE": "IPV4ANY"
"IP_TYPE": "IPv4ANY"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As per

  typedef ip_type {
        type enumeration {
            enum ANY;
            enum IP;
            enum NON_IP;
            enum IPV4;
            enum IPV6;
            enum IPv4ANY;
            enum NON_IP4;
            enum IPv6ANY;
            enum NON_IPv6;
            enum ARP;
        }
    }

This looks Good to me. Though I'm thinking, should yang models support both lowercase and uppercase.

@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Mar 27, 2021

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@lguohan lguohan added the YANG YANG model related changes label Mar 28, 2021
@lguohan lguohan merged commit 6d23a78 into sonic-net:master Mar 28, 2021
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this pull request May 23, 2021
IPV4ANY is not valid value, fix to IPv4ANY

without this change, test case failed sometimes when the validation on IP_TYPE happens first and then PACKET_ACTION.
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
IPV4ANY is not valid value, fix to IPv4ANY

without this change, test case failed sometimes when the validation on IP_TYPE happens first and then PACKET_ACTION.
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.

3 participants