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

Bug Fixes from Broadcom as of 12th Sep #118

Merged
merged 18 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4ed37a0
[JIRA SONIC-9201] Updated the help string for Acl Rule with max limit of
maheshwari-mayank Sep 10, 2019
237b8b4
Merge pull request #103 from project-arlo/master
PrabhuSreenivasan Sep 10, 2019
d6e732e
[JIRA SONIC-9259] Device is crashing when configuring max MTU value f…
Sep 10, 2019
eea3376
[JIRA SONIC-8726] Fix log level .
asha-behera Sep 10, 2019
5d35a8d
[JIRA SONIC-9259] Add range limit to mtu in sonic-port.
asha-behera Sep 11, 2019
00e479a
Merge pull request #105 from project-arlo/master
PrabhuSreenivasan Sep 11, 2019
5fdc27d
[JIRA SONIC-9203] Added IP_TYPE field with value ANY in DEFAULT_RULE.
maheshwari-mayank Sep 11, 2019
5611f15
Merge "[JIRA SONIC-9259] Device is crashing when configuring max MTU …
Sep 12, 2019
f8e9e47
Merge "[JIRA SONIC-9203] Added IP_TYPE field with value ANY in DEFAUL…
Sep 12, 2019
26bc7a9
Merge pull request #111 from project-arlo/master
PrabhuSreenivasan Sep 12, 2019
fe6e760
[JIRA SONIC-9466] merge mgmt-framework bug fixes from Dell - 12th Sept
Sep 12, 2019
a1ce1c8
[JIRA SONIC-9426] CVL throws error when trying to configure IP address.
asha-behera Sep 11, 2019
2960edd
Merge "[JIRA SONIC-9426] CVL throws error when trying to configure I…
Sep 12, 2019
eefb649
[JIRA SONIC-9494] CVL Error seen when performing no description on …
asha-behera Sep 12, 2019
c554914
Merge "[JIRA SONIC-9259] Add range limit to mtu in sonic-port." into …
Sep 12, 2019
4e21516
Merge "[JIRA SONIC-9494] CVL Error seen when performing no descripti…
Sep 12, 2019
49773f3
Merge remote-tracking branch 'project-arlo_sonic-mgmt-framework/brcm_…
Sep 12, 2019
c3d18d7
Merge pull request #119 from project-arlo/master
PrabhuSreenivasan Sep 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/CLI/clitree/cli-xml/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<PARAM
name="seq-no"
help="Sequence number"
ptype="RANGE_1_4294967295"
ptype="RANGE_1_65535"
/>
<ACTION>python $SONIC_CLI_ROOT/sonic-cli.py delete_openconfig_acl_acl_acl_sets_acl_set_acl_entries_acl_entry ${name} ACL_IPV4 ${seq-no}</ACTION>
</COMMAND>
Expand All @@ -153,7 +153,7 @@
<PARAM
name="seq-no"
help="Sequence number"
ptype="RANGE_1_4294967295"
ptype="RANGE_1_65535"
>
<PARAM
name="seq-options"
Expand Down
7 changes: 7 additions & 0 deletions src/CLI/clitree/cli-xml/sonic_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@
help=""
/>
<!--=======================================================-->
<PTYPE
name="RANGE_1_65535"
method="integer"
pattern="1..65535"
help=""
/>
<!--=======================================================-->
<PTYPE
name="RANGE_1_4294967295"
method="unsignedInteger"
Expand Down
4 changes: 2 additions & 2 deletions src/cvl/conf/cvl_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"__comment1__": "Set LOGTOSTDER to 'true' to log on standard error",
"LOGTOSTDERR": "false",
"__comment2__": "Display log upto INFO level",
"STDERRTHRESHOLD": "INFO",
"STDERRTHRESHOLD": "ERROR",
"__comment3__": "Display log upto INFO level 8",
"VERBOSITY": "8",
"VERBOSITY": "0",
"SKIP_VALIDATION": "false",
"SKIP_SEMANTIC_VALIDATION": "false"
}
13 changes: 12 additions & 1 deletion src/cvl/cvl.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,12 @@ func getRedisToYangKeys(tableName string, redisKey string)[]keyValuePairStruct{
keyPatterns := strings.Split(modelInfo.tableInfo[tableName].redisKeyPattern,
modelInfo.tableInfo[tableName].redisKeyDelim) //split by DB separator

if (len(keyNames) != len(keyVals)) {
/* TBD. Workaround for optional keys in INTERFACE Table.
Code will be removed once model is finalized. */
if ((tableName == "INTERFACE") && (len(keyNames) != len(keyVals))) {
keyVals = append(keyVals, "0.0.0.0/0")

} else if (len(keyNames) != len(keyVals)) {
return nil //number key names and values does not match
}

Expand Down Expand Up @@ -998,6 +1003,12 @@ func (c *CVL) addLeafRef(config bool, tableName string, name string, value strin


func (c *CVL) addChildLeaf(config bool, tableName string, parent *yparser.YParserNode, name string, value string) {

/* If there is no value then assign default space string. */
if len(value) == 0 {
value = " "
}

//Batch leaf creation
c.batchLeaf = c.batchLeaf + name + "#" + value + "#"
//Check if this leaf has leafref,
Expand Down
106 changes: 104 additions & 2 deletions src/cvl/cvl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ func TestValidateEditConfig_DepData_Through_Cache(t *testing.T) {
depDataMap = map[string]interface{} {
"PORT" : map[string]interface{} {
"Ethernet3" : map[string]interface{} {
"mtu": "9500",
"mtu": "9200",
},
},
}
Expand Down Expand Up @@ -3104,7 +3104,6 @@ func TestValidateEditConfig_Two_Updates_Positive(t *testing.T) {
unloadConfigDB(rclient, depDataMap)

}

func TestValidateEditConfig_Create_Syntax_DependentData_PositivePortChannel(t *testing.T) {

cfgData := []cvl.CVLEditConfigData{
Expand Down Expand Up @@ -3321,3 +3320,106 @@ func TestValidateEditConfig_Use_Updated_Data_As_Create_DependentData_Single_Call
t.Errorf("Config Validation failed -- error details %v", cvlErrInfo)
}
}

func TestValidateEditConfig_Create_Syntax_Interface_AllKeys_Positive(t *testing.T) {

cfgData := []cvl.CVLEditConfigData{
cvl.CVLEditConfigData{
cvl.VALIDATE_ALL,
cvl.OP_CREATE,
"INTERFACE|Ethernet24|10.0.0.0/31",
map[string]string{
},
},
}

cvSess, _ := cvl.ValidationSessOpen()

cvlErrInfo, _ := cvSess.ValidateEditConfig(cfgData)

cvl.ValidationSessClose(cvSess)

WriteToFile(fmt.Sprintf("\nCVL Error Info is %v\n", cvlErrInfo))

if cvlErrInfo.ErrCode != cvl.CVL_SUCCESS {
t.Errorf("Config Validation failed -- error details %v", cvlErrInfo)
}
}

func TestValidateEditConfig_Create_Syntax_Interface_OptionalKey_Positive(t *testing.T) {

cfgData := []cvl.CVLEditConfigData{
cvl.CVLEditConfigData{
cvl.VALIDATE_ALL,
cvl.OP_CREATE,
"INTERFACE|Ethernet24",
map[string]string{
},
},
}

cvSess, _ := cvl.ValidationSessOpen()

cvlErrInfo, _ := cvSess.ValidateEditConfig(cfgData)

cvl.ValidationSessClose(cvSess)

WriteToFile(fmt.Sprintf("\nCVL Error Info is %v\n", cvlErrInfo))

if cvlErrInfo.ErrCode != cvl.CVL_SUCCESS {
t.Errorf("Config Validation failed -- error details %v", cvlErrInfo)
}
}

func TestValidateEditConfig_Create_Syntax_Interface_IncorrectKey_Negative(t *testing.T) {

cfgData := []cvl.CVLEditConfigData{
cvl.CVLEditConfigData{
cvl.VALIDATE_ALL,
cvl.OP_CREATE,
"INTERFACE|10.0.0.0/31",
map[string]string{
},
},
}

cvSess, _ := cvl.ValidationSessOpen()

cvlErrInfo, _ := cvSess.ValidateEditConfig(cfgData)

cvl.ValidationSessClose(cvSess)

WriteToFile(fmt.Sprintf("\nCVL Error Info is %v\n", cvlErrInfo))

if cvlErrInfo.ErrCode == cvl.CVL_SUCCESS {
t.Errorf("Config Validation failed -- error details %v", cvlErrInfo)
}
}

func TestValidateEditConfig_EmptyNode_Positive(t *testing.T) {
cvSess, _ := cvl.ValidationSessOpen()


cfgData := []cvl.CVLEditConfigData{
cvl.CVLEditConfigData{
cvl.VALIDATE_ALL,
cvl.OP_UPDATE,
"PORT|Ethernet0",
map[string]string{
"description": "",
"index": "3",
},
},
}

cvlErrInfo, _ := cvSess.ValidateEditConfig(cfgData)

cvl.ValidationSessClose(cvSess)

WriteToFile(fmt.Sprintf("\nCVL Error Info is %v\n", cvlErrInfo))

if cvlErrInfo.ErrCode != cvl.CVL_SUCCESS {
t.Errorf("Config Validation failed -- error details %v", cvlErrInfo)
}

}
7 changes: 6 additions & 1 deletion src/cvl/schema/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ module sonic-port {
}

leaf mtu{
type uint32;
type uint32 {
range "1312..9216" {
error-message "Invalid MTU value";
error-app-tag mtu-invalid;
}
}
}

leaf lanes {
Expand Down
1 change: 1 addition & 0 deletions src/translib/acl_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ func (app *AclApp) createDefaultDenyAclRule(d *db.DB, aclName string, rulesInfo
rulesInfo["DEFAULT_RULE"] = db.Value{Field: m}
rulesInfo["DEFAULT_RULE"].Field["PRIORITY"] = strconv.FormatInt(int64(MIN_PRIORITY), 10)
rulesInfo["DEFAULT_RULE"].Field["PACKET_ACTION"] = "DROP"
rulesInfo["DEFAULT_RULE"].Field["IP_TYPE"] = "ANY"
}

func convertOCAclRuleToInternalAclRule(ruleData db.Value, seqId uint32, aclName string, aclType ocbinds.E_OpenconfigAcl_ACL_TYPE, rule *ocbinds.OpenconfigAcl_Acl_AclSets_AclSet_AclEntries_AclEntry) {
Expand Down