Skip to content

Commit 20869c8

Browse files
authored
Merge pull request #278 from project-arlo/cvl_sonic_yang_changes_rel_1.0
Address PR review comments - phase2
2 parents a9e5a85 + d97e540 commit 20869c8

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

models/yang/sonic/common/sonic-common.yang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
module sonic-common {
33
namespace "http://github.com/Azure/sonic-common";
4-
prefix scommon;
4+
prefix cmn;
55

66
organization
77
"SONiC";

models/yang/sonic/sonic-acl.yang

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module sonic-acl {
22
namespace "http://github.com/Azure/sonic-acl";
3-
prefix sacl;
3+
prefix acl;
44
yang-version 1.1;
55

66
import ietf-inet-types {
@@ -117,14 +117,6 @@ module sonic-acl {
117117
}
118118
}
119119

120-
leaf MIRROR_ACTION {
121-
type string {
122-
pattern '[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{1,63})' {
123-
error-app-tag mirror-action-invalid;
124-
}
125-
}
126-
}
127-
128120
leaf IP_TYPE {
129121
mandatory true;
130122
type enumeration {
@@ -181,7 +173,7 @@ module sonic-acl {
181173
choice src_port {
182174
case l4_src_port {
183175
leaf L4_SRC_PORT {
184-
type uint16;
176+
type inet:port-number;
185177
}
186178
}
187179
case l4_src_port_range {
@@ -198,7 +190,7 @@ module sonic-acl {
198190
choice dst_port {
199191
case l4_dst_port {
200192
leaf L4_DST_PORT {
201-
type uint16;
193+
type inet:port-number;
202194
}
203195
}
204196
case l4_dst_port_range {
@@ -221,11 +213,7 @@ module sonic-acl {
221213
}
222214

223215
leaf DSCP {
224-
type uint8 {
225-
range "0..63" {
226-
error-app-tag dscp-invalid;
227-
}
228-
}
216+
type inet:dscp;
229217
}
230218
}
231219
}

models/yang/sonic/sonic-interface.yang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ module sonic-interface {
3737
}
3838
}
3939

40+
/* Add a leafref, once VRF YANG is supported
4041
leaf vrf-name {
4142
type string {
4243
pattern 'Vrf([-a-zA-Z0-9_]{1,60})' {
4344
error-app-tag vrf-name-invalid;
4445
}
4546
}
4647
}
48+
*/
4749

4850
}
4951

models/yang/sonic/sonic-port.yang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module sonic-port {
33
prefix prt;
44

55
import sonic-common {
6-
prefix scommon;
6+
prefix cmn;
77
}
88

99
organization
@@ -75,7 +75,7 @@ module sonic-port {
7575
}
7676

7777
leaf admin_status {
78-
type scommon:admin-status;
78+
type cmn:admin-status;
7979
default "down";
8080
}
8181
}

src/cvl/cvl_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,12 +1812,14 @@ func TestValidateEditConfig_Update_Syntax_DependentData_Redis_Positive(t *testin
18121812
loadConfigDB(rclient, mpi_acl_table_rule)
18131813

18141814
depDataMap := map[string]interface{}{
1815+
/* Use MIRROR session once supported ---
18151816
"MIRROR_SESSION": map[string]interface{}{
18161817
"everflow2": map[string]interface{}{
18171818
"src_ip": "10.1.0.32",
18181819
"dst_ip": "2.2.2.2",
18191820
},
18201821
},
1822+
*/
18211823
}
18221824

18231825
loadConfigDB(rclient, depDataMap)
@@ -1829,7 +1831,10 @@ func TestValidateEditConfig_Update_Syntax_DependentData_Redis_Positive(t *testin
18291831
cvl.OP_UPDATE,
18301832
"ACL_RULE|TestACL13|Rule1",
18311833
map[string]string{
1834+
/* Use Mirror session when supported
18321835
"MIRROR_ACTION": "everflow2",
1836+
*/
1837+
"PACKET_ACTION" : "FORWARD",
18331838
},
18341839
},
18351840
}
@@ -3403,7 +3408,7 @@ func TestValidateEditConfig_Create_Syntax_Interface_OptionalKey_Positive(t *test
34033408
cvl.OP_CREATE,
34043409
"INTERFACE|Ethernet24",
34053410
map[string]string{
3406-
"vrf-name": "Vrf1",
3411+
/*"vrf-name": "Vrf1", -- Enable once VRF YANG implemented */
34073412
},
34083413
},
34093414
}

0 commit comments

Comments
 (0)