Skip to content

CP-12230 DVP Record size validation changes for setting ZFS record size #556

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

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

rakshandabhat
Copy link
Contributor

@rakshandabhat rakshandabhat commented Apr 1, 2025

Problem

DVP Record size schema validation changes for setting ZFS record size
CP-12230

Solution

Added schema validation in plugin_schema.json to check if the field "recordSizeInKB" is of type "integer".

Explanation of the change:

Here in this case the normal validation like below won't work :
"recordSizeInKB": { "type" : "integer" }

In this case, we need to retrieve the properties of recordSizeInKB to get the type and then validate it.

  • In order to validate if the field "recordSizeInKB" is of type "integer", we have to first retrieve the "properties" field of "linkedSourceDefinition" and "virtualSourceDefinition". This is because the "recordSizeInKB" field needs to be listed within the "properties" field of "linkedSourceDefinition" and "virtualSourceDefinition".
  • Once the "properties" field is retrieved, then we need to get the properties of the "recordSizeInKB" to get the "type".
  • We have checked the string value of "type" field has to be "integer".

Testing Done

Manual:
Executed dvp --verbose build --dev for correct schema for both linkedSourceDefinition and virtualSourceDefinition.
image
image

Executed dvp --verbose build --dev for inavlid schema for both linkedSourceDefinition and virtualSourceDefinition.
image
image

Executed dvp --verbose build --dev for schema without "recordSizeInKB" field in schema.
image

Unit test:
Screenshot 2025-04-01 at 9 52 01 AM
Unit test execution after adding new test cases :
image

Blackbox tests:
virtualization_sdk APPDATA_SDK_UBUNTU20_DIRECT_RHEL79
virtualization_sdk APPDATA_SDK_WIN10_STAGED_WIN2019

@rakshandabhat rakshandabhat requested a review from a team as a code owner April 1, 2025 04:17
Copy link
Contributor

@SumoSourabh SumoSourabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me. I would suggest adding unit test cases for the validations.

Copy link
Contributor

@SumoSourabh SumoSourabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@vimleshmishra vimleshmishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rakshandabhat rakshandabhat merged commit ac6d662 into delphix:develop Apr 2, 2025
16 checks passed
rakshandabhat added a commit that referenced this pull request Apr 9, 2025
* Configure Mend for GitHub.com (#543)

* Add .whitesource configuration file

* Configure Mend for GitHub.com

---------

Co-authored-by: mend-for-github-com[bot] <50673670+mend-for-github-com[bot]@users.noreply.github.com>
Co-authored-by: Shibasish Nandi <[email protected]>

* CP-12279 Documentation for ZFS record size change (#554)

* CP-12230 DVP Record size validation changes for setting ZFS record size (#556)

* CP-12230 DVP Record size validation changes for setting ZFS record size

* CP-12367 Record size validation - Bump DVP version (#558)

* CP-12377  Record size validation - DVP version documentation (#560)

Record size validation - DVP version documentation

---------

Co-authored-by: mend-for-github-com[bot] <50673670+mend-for-github-com[bot]@users.noreply.github.com>
Co-authored-by: Shibasish Nandi <[email protected]>
vimleshmishra pushed a commit to vimleshmishra/virtualization-sdk that referenced this pull request Jun 26, 2025
…ze (delphix#556)

* CP-12230 DVP Record size validation changes for setting ZFS record size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants