Conversation
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.74% |
| Branch coverage | 18.87% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR...
Negative test cases added for ONTAP storage pool create, delete, and maintenance (NFS3 and iSCSI).
nfs3/pool/test_pool_lifecycle.py (+4)
test_01_reject_create_when_flexvol_name_exists — create is rejected when a FlexVol with that name already exists on ONTAP
test_02_reject_create_when_no_aggregate_space — create is rejected when requested capacity exceeds every online SVM aggregate
test_11_delete_pool_with_flexvol_predeleted — empty pool can still be deleted after its FlexVol was removed on ONTAP
test_12_delete_pool_with_export_policy_predeleted — empty pool can still be deleted after its NFS export policy was removed on ONTAP
nfs3/pool/test_pool_with_volumes.py (+3)
test_08_delete_pool_with_volume_flexvol_missing — force-delete a pool that still has a CS volume after the FlexVol was removed on ONTAP
test_09_delete_pool_with_volume_export_policy_missing — force-delete a pool that still has a CS volume after the export policy was removed on ONTAP
test_10_cancel_maintenance_after_volume_deleted — cancel maintenance after the CS volume on the pool has already been deleted
nfs3/pool/test_zone_scoped_pool.py (+4):
test_01_create_zone_pool_rejected_when_flexvol_exists — zone-scoped create is rejected when a same-name FlexVol already exists
test_02_create_zone_pool_rejected_when_no_aggregate_space — zone-scoped create is rejected when no aggregate has enough free space
test_07_delete_zone_pool_with_flexvol_predeleted — empty zone pool can still be deleted after its FlexVol was removed on ONTAP
test_08_delete_zone_pool_with_export_policy_predeleted — empty zone pool can still be deleted after its export policy was removed on ONTAP
iscsi/pool/test_pool_lifecycle.py (+4):
test_01_reject_create_when_flexvol_name_exists — create is rejected when a FlexVol with that name already exists on ONTAP
test_02_reject_create_when_no_aggregate_space — create is rejected when requested capacity exceeds every online SVM aggregate
test_11_delete_pool_with_flexvol_predeleted — empty pool can still be deleted after its FlexVol was removed on ONTAP
test_12_delete_pool_with_igroups_predeleted — empty pool can still be deleted after host igroups were removed on ONTAP
iscsi/pool/test_pool_with_volumes.py (+4):
test_08_delete_pool_with_volume_flexvol_missing — force-delete a pool that still has a CS volume after the FlexVol was removed on ONTAP
test_09_delete_pool_with_volume_igroups_missing — force-delete a pool that still has a CS volume after host igroups were removed on ONTAP
test_10_enter_maintenance_lun_maps_predeleted — enter maintenance after LUN maps for the volume were removed on ONTAP
test_11_cancel_maintenance_after_volume_deleted — cancel maintenance after the CS volume on the pool has already been deleted
iscsi/pool/test_zone_scoped_pool.py (+4):
test_01_create_zone_pool_rejected_when_flexvol_exists — zone-scoped create is rejected when a same-name FlexVol already exists
test_02_create_zone_pool_rejected_when_no_aggregate_space — zone-scoped create is rejected when no aggregate has enough free space
test_07_delete_zone_pool_with_flexvol_predeleted — empty zone pool can still be deleted after its FlexVol was removed on ONTAP
test_08_delete_zone_pool_with_igroups_predeleted — empty zone pool can still be deleted after host igroups were removed on ONTAP
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
nfs3/pool/test_pool_lifecycle.py:
test_01_reject_create_when_flexvol_name_exists — Creates a FlexVol on ONTAP first, then calls createStoragePool with the same name. Create must raise CloudstackAPIException, CloudStack must not keep a pool of that name, and the original FlexVol must still be there (plugin must not adopt or delete it).
test_02_reject_create_when_no_aggregate_space — Reads live free space from the SVM’s online aggregates, requests 1 GiB more than the largest one, and expects No suitable aggregates. No CloudStack pool and no FlexVol may be left behind.
test_11_delete_pool_with_flexvol_predeleted — Creates an empty pool, unmounts NFS on the KVM hosts, deletes the FlexVol directly on ONTAP, then deletes the pool in CloudStack. Delete must succeed; the pool record and the NFS export policy must both be gone.
test_12_delete_pool_with_export_policy_predeleted — Same empty-pool path, but the NFS export policy is removed on ONTAP first. CloudStack delete must still succeed and must remove the FlexVol.
nfs3/pool/test_pool_with_volumes.py:
test_08_delete_pool_with_volume_flexvol_missing — Isolated pool + CS volume. After the FlexVol is deleted on ONTAP, deleteStoragePool(forced=True) is still rejected while the CS volume exists. After the volume is removed, forced delete must succeed and the leftover CS volume record must be cleanable.
test_09_delete_pool_with_volume_export_policy_missing — Isolated pool + CS volume. Export policy is deleted on ONTAP while the FlexVol remains. Forced delete (after the CS volume is gone) must tolerate the missing policy and still delete the FlexVol.
test_10_cancel_maintenance_after_volume_deleted — Isolated pool + volume. Volume is deleted while the pool is Up (NFS3 cannot delete a volume in Maintenance), then the pool is put in Maintenance and cancelled. Pool must return to Up; FlexVol stays online and the export policy stays intact.
nfs3/pool/test_zone_scoped_pool.py:
test_01_create_zone_pool_rejected_when_flexvol_exists — Same duplicate-FlexVol reject as cluster scope, but createStoragePool is zone-scoped (attachZone). No CS pool; pre-created FlexVol unchanged.
test_02_create_zone_pool_rejected_when_no_aggregate_space — Same over-capacity reject as cluster scope, for a zone-scoped pool. Error must contain No suitable aggregates; no pool and no FlexVol.
test_07_delete_zone_pool_with_flexvol_predeleted — Empty zone pool: FlexVol removed on ONTAP, then CloudStack delete. Pool gone; export policy cleaned up.
test_08_delete_zone_pool_with_export_policy_predeleted — Empty zone pool: export policy removed on ONTAP, then CloudStack delete. Pool gone; FlexVol deleted.
iscsi/pool/test_pool_lifecycle.py:
test_01_reject_create_when_flexvol_name_exists — Same duplicate-name create reject as NFS3, for an iSCSI pool.
test_02_reject_create_when_no_aggregate_space — Same aggregate-space create reject as NFS3, for an iSCSI pool.
test_11_delete_pool_with_flexvol_predeleted — Empty iSCSI pool: FlexVol deleted on ONTAP first, then CloudStack delete. Pool must disappear; FlexVol must not come back.
test_12_delete_pool_with_igroups_predeleted — Empty iSCSI pool. Host igroups (named from host UUID + SVM, shared on the SVM) are seeded then deleted on ONTAP. CloudStack delete must succeed and still remove the FlexVol. Skips if another ONTAP pool is using the same SVM.
iscsi/pool/test_pool_with_volumes.py:
test_08_delete_pool_with_volume_flexvol_missing — Isolated iSCSI pool + LUN-backed CS volume. FlexVol gone on ONTAP; forced delete after the CS volume is removed must succeed.
test_09_delete_pool_with_volume_igroups_missing — Isolated pool + volume. Host igroups deleted on ONTAP first. Forced delete after the CS volume is removed must succeed and still delete the FlexVol. Skips if the SVM is shared with another ONTAP pool.
test_10_enter_maintenance_lun_maps_predeleted — Isolated pool + volume. A LUN map is created then deleted on ONTAP. enableStorageMaintenance must still put the pool in Maintenance, the CS volume must remain, the LUN stays online, and maps must not reappear.
test_11_cancel_maintenance_after_volume_deleted — Isolated pool + volume. CS volume deleted, then cancel maintenance. Pool returns to Up; FlexVol/LUN remain; shared host igroups are unchanged from the suite baseline.
iscsi/pool/test_zone_scoped_pool.py:
test_01_create_zone_pool_rejected_when_flexvol_exists — Zone-scoped iSCSI create reject when the FlexVol name already exists.
test_02_create_zone_pool_rejected_when_no_aggregate_space — Zone-scoped iSCSI create reject when no aggregate has enough free space.
test_07_delete_zone_pool_with_flexvol_predeleted — Empty zone iSCSI pool deleted after the FlexVol was removed on ONTAP.
test_08_delete_zone_pool_with_igroups_predeleted — Empty zone iSCSI pool deleted after host igroups were removed on ONTAP; FlexVol must still be deleted.
How did you try to break this feature and the system with this change?