Skip to content

opts: add tests for weight/throttle device opts validators#7113

Open
nikolauspschuetz wants to merge 1 commit into
docker:masterfrom
nikolauspschuetz:test-device-opts-validators
Open

opts: add tests for weight/throttle device opts validators#7113
nikolauspschuetz wants to merge 1 commit into
docker:masterfrom
nikolauspschuetz:test-device-opts-validators

Conversation

@nikolauspschuetz

Copy link
Copy Markdown

opts/weightdevice.go and opts/throttledevice.go had no tests, unlike the other opts in the package. This adds table-driven coverage for ValidateWeightDevice, ValidateThrottleBpsDevice, ValidateThrottleIOpsDevice, and the Set/GetList paths — boundaries (weight 0/10/1000, uint16 overflow), rate parsing (units, integer-only iops), and the format/error cases.

Test-only, no behavior change. Part of #201.

opts/weightdevice.go and opts/throttledevice.go had no tests, unlike the
sibling opts. Add table-driven coverage for ValidateWeightDevice,
ValidateThrottleBpsDevice, ValidateThrottleIOpsDevice and the Set/GetList
paths, including boundary (weight 0/10/1000/overflow) and error cases.

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@nikolauspschuetz
nikolauspschuetz force-pushed the test-device-opts-validators branch from ff077f2 to 8f3477f Compare July 20, 2026 20:47
@nikolauspschuetz
nikolauspschuetz marked this pull request as ready for review July 20, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant