Repository navigation
CSTACKEX-380: Update the automation tests to perform assertions on kvm host and libvirt - #137
Open
sandeeplocharla wants to merge 2 commits into
Open
sandeeplocharla wants to merge 2 commits into
sandeeplocharla wants to merge 2 commits into
Conversation
…iSCSI tests Verify KVM host, libvirt domain/XML and iSCSI device state in the Marvin tests, and make the igroup checks real instead of silently skipped. - Use cs_<hostUuid>_<svm> igroup names, with host IQNs read over SSH (listHosts returns no storageurl for KVM, so the old checks never ran). - Host igroups are created at first volume access and removed by ONTAP (delete_on_unmap) when the last LUN is unmapped: assert pool operations leave them unchanged, and that an igroup exists exactly while a LUN is mapped to it. - test_19: check the volume's own LUN is gone instead of expecting an empty FlexVol (template cache LUN and router ROOT share it). - Pool lifecycle VM deploy uses a compute offering tagged with the ONTAP pool tag so the ROOT disk cannot land on another shared pool; fail early when another enabled pool with the same tag exists.
…precondition - Template-cache negative workflow: the seed-VM host check (_assert_vm_disks_on_host: igroup, LUN devices, iSCSI session) and the cache-LUN mapping check are iSCSI-only. Guard them with the PROTOCOL check so the NFS3 suite no longer asserts an igroup for an NFS pool. - Pool lifecycle test_06_reject_grow_above_max_size (iSCSI and NFS3): use the ONTAP FlexVol size (space.size) as the "at the 300 TiB maximum" precondition instead of CloudStack's reported capacity. NFS reports the host-measured usable space (95% of the FlexVol with the default snapshot reserve) and refreshes it periodically, so the reported value can differ from 300 TiB. The over-max request and the unchanged-size checks are unchanged.
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.83% |
| Branch coverage | 20.12% |
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...
Host-side verification (new)
helpers/kvm_host.py: helpers over SSH for service state,virshdomain state and XML, by-id block devices, iSCSI sessions, and the LUN serial to WWID mapping.ontap_test_base.py:_assert_kvm_hosts_ready(fails the class early if libvirtd, the agent or iscsid is down or the host is notUp),_vm_placement,_assert_vm_disks_on_host,_assert_domain_absent,_assert_devices_gone,_assert_disk_detached_on_host,_assert_iscsi_session_to_svm, and_iscsi_host_specs(reads host IQNs over SSH).igroup semantics (the driver behavior these tests now match)
cs_<hostUuid>_<svm>is created lazily at first volume access (grantAccess), not at pool creation.delete_on_unmap) when its last LUN is unmapped.deleteDataStoredoes not delete it._assert_host_igroups_follow_lun_maps: the igroup must exist exactly while a LUN is mapped to it. NewOntapRestClient.list_lun_maps_for_igroupsupports this. Pool-only steps use the existing_assert_igroup_baseline_unchanged.VM placement
_discover_vm_deploy_resources(storage_tags=...)creates a compute offering tagged with the pool's storage tag, deleted intearDownClass. The previous untagged offering let the root disk land on any shared pool, for examplePrimary1(NFS).test_16also fails early, naming any other enabled pool with the same tag. The placement assertion now says which pool the disk landed on.Test cases changed
iSCSI pool lifecycle (
iscsi/pool/test_pool_lifecycle.py)setUpClasstest_03_create_primary_storage_pooltest_05,test_07,test_09,test_12(grow, shrink, resize while disabled or in maintenance)test_06_reject_grow_above_max_sizespace.size) equal to 300 TiBtest_14_enter_maintenance_and_delete_pooltest_16_create_vm_and_attach_volumetest_18_grow_and_shrink_pool_with_vm_attachedtest_19_delete_volume_and_pooliSCSI VM and volume attach (
iscsi/instance/test_vm_volume_attach.py)test_03_deploy_vm,test_03a_deploy_second_vm_reuses_template_cache,test_03b_expunge_second_vm_template_cache_survives,test_04_attach_volume_to_vm,test_05_stop_vm_lun_unmapped,test_08_start_vm_lun_remapped,test_24_detach_volume_from_vm,test_27_destroy_vm_and_cleanup: add host-side checks after each step. The domain is running with the right XML and by-id devices, the disk capacity matches, and after stop, detach or destroy the domain and devices are gone._start_vmand_stop_vmnow do the same checks.iSCSI volume lifecycle (
iscsi/volume/test_volume_lifecycle.py)test_05_delete_volume_and_force_delete_pool: the igroup check now uses the driver's real name,cs_<hostUuid>_<svm>, so it can fail.Template-cache negative workflow (
helpers/template_cache_negative_workflow.py, shared by iSCSI and NFS3)step_03_deleted_cache_blocks_reuse: the seed-VM host checks and the cache-LUN mapping check are iSCSI-only, so they are now guarded by the protocol check. Previously the NFS3 run asserted an igroup for an NFS pool.NFS3 pool lifecycle (
nfs3/pool/test_pool_lifecycle.py)test_06_reject_grow_above_max_size: same precondition change as iSCSI. NFS pools report host-measured usable space, which is 95% of the FlexVol with the default snapshot reserve (285 TiB for 300 TiB), refreshed periodically. The over-max request (MAX + 1 GiB) and the "unchanged" checks are unchanged.Docs:
README.mdlists the new helpers.Verification (single-host lab, KVM + ONTAP)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?