Skip to content

Commit

Permalink
Merge pull request #278 from project-arlo/cvl_sonic_yang_changes_rel_1.0
Browse files Browse the repository at this point in the history
Address PR review comments - phase2
  • Loading branch information
dutta-partha authored Nov 15, 2019
2 parents a9e5a85 + d97e540 commit 20869c8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion models/yang/sonic/common/sonic-common.yang
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

module sonic-common {
namespace "http://github.com/Azure/sonic-common";
prefix scommon;
prefix cmn;

organization
"SONiC";
Expand Down
20 changes: 4 additions & 16 deletions models/yang/sonic/sonic-acl.yang
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sonic-acl {
namespace "http://github.com/Azure/sonic-acl";
prefix sacl;
prefix acl;
yang-version 1.1;

import ietf-inet-types {
Expand Down Expand Up @@ -117,14 +117,6 @@ module sonic-acl {
}
}

leaf MIRROR_ACTION {
type string {
pattern '[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{1,63})' {
error-app-tag mirror-action-invalid;
}
}
}

leaf IP_TYPE {
mandatory true;
type enumeration {
Expand Down Expand Up @@ -181,7 +173,7 @@ module sonic-acl {
choice src_port {
case l4_src_port {
leaf L4_SRC_PORT {
type uint16;
type inet:port-number;
}
}
case l4_src_port_range {
Expand All @@ -198,7 +190,7 @@ module sonic-acl {
choice dst_port {
case l4_dst_port {
leaf L4_DST_PORT {
type uint16;
type inet:port-number;
}
}
case l4_dst_port_range {
Expand All @@ -221,11 +213,7 @@ module sonic-acl {
}

leaf DSCP {
type uint8 {
range "0..63" {
error-app-tag dscp-invalid;
}
}
type inet:dscp;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions models/yang/sonic/sonic-interface.yang
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ module sonic-interface {
}
}

/* Add a leafref, once VRF YANG is supported
leaf vrf-name {
type string {
pattern 'Vrf([-a-zA-Z0-9_]{1,60})' {
error-app-tag vrf-name-invalid;
}
}
}
*/

}

Expand Down
4 changes: 2 additions & 2 deletions models/yang/sonic/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module sonic-port {
prefix prt;

import sonic-common {
prefix scommon;
prefix cmn;
}

organization
Expand Down Expand Up @@ -75,7 +75,7 @@ module sonic-port {
}

leaf admin_status {
type scommon:admin-status;
type cmn:admin-status;
default "down";
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/cvl/cvl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1812,12 +1812,14 @@ func TestValidateEditConfig_Update_Syntax_DependentData_Redis_Positive(t *testin
loadConfigDB(rclient, mpi_acl_table_rule)

depDataMap := map[string]interface{}{
/* Use MIRROR session once supported ---
"MIRROR_SESSION": map[string]interface{}{
"everflow2": map[string]interface{}{
"src_ip": "10.1.0.32",
"dst_ip": "2.2.2.2",
},
},
*/
}

loadConfigDB(rclient, depDataMap)
Expand All @@ -1829,7 +1831,10 @@ func TestValidateEditConfig_Update_Syntax_DependentData_Redis_Positive(t *testin
cvl.OP_UPDATE,
"ACL_RULE|TestACL13|Rule1",
map[string]string{
/* Use Mirror session when supported
"MIRROR_ACTION": "everflow2",
*/
"PACKET_ACTION" : "FORWARD",
},
},
}
Expand Down Expand Up @@ -3403,7 +3408,7 @@ func TestValidateEditConfig_Create_Syntax_Interface_OptionalKey_Positive(t *test
cvl.OP_CREATE,
"INTERFACE|Ethernet24",
map[string]string{
"vrf-name": "Vrf1",
/*"vrf-name": "Vrf1", -- Enable once VRF YANG implemented */
},
},
}
Expand Down

0 comments on commit 20869c8

Please sign in to comment.