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
fix(dp): add max_ibw_mhz validation #13293
fix(dp): add max_ibw_mhz validation #13293
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
3595957
to
766d021
Compare
@@ -21,6 +21,9 @@ definitions: | |||
description: this is the maximum allowed difference in MHz between leftmost end of leftmost channel and rightmost end of rightmost channel used by a Base Station (eNB) | |||
type: integer | |||
x-nullable: false | |||
maximum: 150 | |||
minimum: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change it to 20, so that is it always greater than bandwidth of a single channel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed minimum: 5
from swagger validation, but modified MutableCbsd
's ValidateModel
func to ensure that max_ibw_mhz
is not less than bandwidth_mhz
.
766d021
to
4398d00
Compare
}, { | ||
name: "Should validate max ibw mhz not multiple of 5", | ||
data: b.NewMutableCbsdModelPayloadBuilder().WithMaxIbwMhz(7).Payload, | ||
expectedError: "max_ibw_mhz in body should be a multiple of 5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a test for if m.Capabilities.MaxIbwMhz < m.FrequencyPreferences.BandwidthMhz
and also for this !*m.GrantRedundancy && *m.CarrierAggregationEnabled
, since I've noticed that it is missing for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added them in a separate test, since original TestMutableCbsd_Validate
covers only swagger generated Validate
func and would not cover ValidateModel
func.
bf6d418
to
24a766d
Compare
Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com>
Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com>
Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com>
Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com>
24a766d
to
167efa3
Compare
* fix(dp): add max_ibw_mhz validation Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com> * validate that max_ibw_mhz is not less than bandwidth_mhz Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com> * add MutableCbsd.ValidateModel tests Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com> * reorganize validation_test.go imports Signed-off-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com> Co-authored-by: Jarosław Jaszczuk <jaroslaw.jaszczuk@freedomfi.com>
Signed-off-by: Jarosław Jaszczuk jaroslaw.jaszczuk@freedomfi.com
Summary
Added validation for
max_ibw_mhz
field, that ensures the value is:>= 5
<= 150
Test Plan
Added test cases.
Additional Information