-
Notifications
You must be signed in to change notification settings - Fork 138
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
Inactive NFS export validation #2924
Comments
This issue is a spin-off from development already enacted for:
And as such the cause has already been identified in that work, a failure to run model.clean_fields() prior to model.save(). This issue, having now been identified, was thus spun-out to more clearly detail development endeavours. |
Further to the recent merge of #2925:
We have our proof of inactive validation via the recent test improvements:
|
Enable intended NFS model field validations during POST & PUT by calling NFSExportGroup.clean_fields() prior to model.save(). N.B. There exists a build-in `choices=` field validator that takes precedence for the fields: 'editable', and 'syncable'. So only the 'host_str' field actively exercises the custom validators. I.e. we have redundant validators for 'editable', and 'syncable'. This redundancy is not the focus of this fix: only re-enabling model field validation. ## Includes - Above fix regarding model field validation. - Incidental fix for newer Django warning surfaced by recent NFS test updates: "Pagination may yield inconsistent results with an unordered object_list ...". Adds a default ordering on `id` in NFSExportGroup model. - Remove outdated model comment regarding editable default: NFSExportGroup model - nfs_export_group.py model definition file black re-formatted.
…dation Inactive NFS export validation #2924
Closing as: |
Via Web-UI and API it is possible to enter, for example, considered invalid
NFS Clients
(Web-UI reference) /host_string
(model/API reference) data, resulting in, in this case:With the consequent export of:
We have in-place a number of validation mechanism intended to filter out, in the above example, what is considered valid host_string contents via the following model field validators:
https://github.com/rockstor/rockstor-core/blob/master/src/rockstor/storageadmin/models/validators.py
representing:
With the 2nd & 3rd validators there is also model
choice
precedence, i.e. the model only accepts ro|rw for modify_str, and async|sync for sync_choice and so we have, in place, redundant validation for those fields. But in the example case of the nfs_host_str (host_str field) used to define the core of this issue, we have at least an inactive validation. And consequently also insufficient API test coverage for this failure.This issue is dependant on NFS test improvements proposed in the following issue:
The text was updated successfully, but these errors were encountered: