Add missing test coverage for azuremachine_validation.go
/kind cleanup
Describe the solution you'd like Currently, azuremachine_validation.go is missing unit tests in the following areas:
-
ValidateDataDisks and validateManagedDisksUpdate
- Add the following test cases to TestAzureMachine_ValidateDataDisks
- disk.Lun = nil
- disk.Lun < 0 || disk.Lun > 63
- oldDisk.ManagedDisk.DiskEncryptionSet != nil && newDisk.ManagedDisk.DiskEncryptionSet != nil
- (newDiskParams.DiskEncryptionSet != nil && oldDiskParams.DiskEncryptionSet == nil) || (newDiskParams.DiskEncryptionSet == nil && oldDiskParams.DiskEncryptionSet != nil)
- Add the following test cases to TestAzureMachine_ValidateDataDisks
-
ValidateDataDisksUpdate
- Add the following test cases to TestAzureMachine_ValidateDataDisksUpdate
- (newDisk.Lun != nil && oldDisk.Lun != nil) && (*newDisk.Lun != *oldDisk.Lun)
- Both newDisk.Lun and oldDisk.Lun are nil
- Both newDisk.Lun and oldDisk.Lun are non nil but are equal to each other
- Add the following test cases to TestAzureMachine_ValidateDataDisksUpdate
-
ValidateDiagnostics
- Create a new unit test for this function.
Environment:
- cluster-api-provider-azure version:
- Kubernetes version: (use
kubectl version): - OS (e.g. from
/etc/os-release):
/help /kind cleanup /remove-kind feature
@willie-yao: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help /kind cleanup /remove-kind feature
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign
/unassign @khareyash05
/assign