Total priority buffer overflow check
This commit is contained in:
@@ -51,6 +51,13 @@ func TestValidatePriorityWithNegativeWeight(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidatePriorityWithOverFlowWeight(t *testing.T) {
|
||||
policy := api.Policy{Priorities: []api.PriorityPolicy{{Name: "WeightPriority", Weight: api.MaxWeight}}}
|
||||
if ValidatePolicy(policy) == nil {
|
||||
t.Errorf("Expected error about priority weight not being overflown.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateExtenderWithNonNegativeWeight(t *testing.T) {
|
||||
extenderPolicy := api.Policy{ExtenderConfigs: []api.ExtenderConfig{{URLPrefix: "http://127.0.0.1:8081/extender", FilterVerb: "filter", Weight: 2}}}
|
||||
errs := ValidatePolicy(extenderPolicy)
|
||||
|
||||
Reference in New Issue
Block a user