Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/integration/plugins/ontap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CI wiring:
test/integration/plugins/ontap/
├── ontap.cfg # Environment config (IPs, credentials, zone info)
├── ontap_test_base.py # Shared base class and ONTAP REST client
├── TEST_CASES.md # Full test case reference table (62 tests)
├── TEST_CASES.md # Full test case reference table (70 tests)
├── README.md # This file
│
├── nfs3/
Expand All @@ -43,7 +43,7 @@ test/integration/plugins/ontap/
│ ├── volume/
│ │ └── test_volume_lifecycle.py # Volume create/delete/negative-delete
│ └── instance/
│ └── test_vm_volume_attach.py # Pool + volume + VM + attach/detach
│ └── test_vm_volume_attach.py # Pool + volume + VM + attach/resize/detach
│
└── iscsi/
├── pool/
Expand All @@ -53,7 +53,7 @@ test/integration/plugins/ontap/
├── volume/
│ └── test_volume_lifecycle.py # LUN create/delete/negative-delete
└── instance/
└── test_vm_volume_attach.py # Pool + LUN + VM + attach/LUN-map lifecycle
└── test_vm_volume_attach.py # Pool + LUN + VM + attach/resize lifecycle
```

---
Expand Down Expand Up @@ -308,12 +308,12 @@ self.assertEqual(result.state, "Maintenance")
| NFS3 Pool with Volumes | `nfs3/pool/test_pool_with_volumes.py` | 7 | Same + live volume present; negative delete guard |
| NFS3 Zone-Scoped Pool | `nfs3/pool/test_zone_scoped_pool.py` | 4 | Zone scope — all hosts connected via `attachZone` |
| NFS3 Volume Lifecycle | `nfs3/volume/test_volume_lifecycle.py` | 5 | Volume is metadata-only; FlexVol unchanged on delete |
| NFS3 VM + Volume Attach | `nfs3/instance/test_vm_volume_attach.py` | 8 | Full VM lifecycle with hot-plug/detach |
| NFS3 VM + Volume Attach | `nfs3/instance/test_vm_volume_attach.py` | 12 | Full VM lifecycle with stopped-VM qcow2 grow |
| iSCSI Pool Lifecycle | `iscsi/pool/test_pool_lifecycle.py` | 8 | Create, disable, enable, maintenance, delete + igroups |
| iSCSI Pool with Volumes | `iscsi/pool/test_pool_with_volumes.py` | 7 | Same + live LUN present; negative delete guard |
| iSCSI Zone-Scoped Pool | `iscsi/pool/test_zone_scoped_pool.py` | 4 | Zone scope |
| iSCSI Volume Lifecycle | `iscsi/volume/test_volume_lifecycle.py` | 5 | LUN created per CS volume; LUN removed on delete |
| iSCSI VM + Volume Attach | `iscsi/instance/test_vm_volume_attach.py` | 8 | Full VM lifecycle; LUN-maps on VM start/stop/detach |
| iSCSI VM + Volume Attach | `iscsi/instance/test_vm_volume_attach.py` | 12 | Full VM lifecycle; stopped-VM LUN grow and LUN-map checks |

For the goal, dependencies, and exact success criteria of every individual test, see [TEST_CASES.md](TEST_CASES.md).

Expand All @@ -328,7 +328,7 @@ For the goal, dependencies, and exact success criteria of every individual test,
| `Lost connection to MySQL` | MySQL not accepting remote connections | Enable remote MySQL access (see Prerequisites §3) |
| `sh: python: command not found` (repeated) | Marvin internal call — harmless on macOS | Ignore; Marvin Init still succeeds |
| Pool state never reaches `Maintenance` | KVM agent not responding | Check `cloudstack-agent` on KVM host; verify host is connected in CloudStack UI |
| iSCSI `test_07` error 530 | KVM guest does not ACK SCSI hot-unplug | Known environment limitation — see TEST_CASES.md Suite 10 note |
| iSCSI `test_10` error 530 | KVM guest does not ACK SCSI hot-unplug | Known environment limitation — see TEST_CASES.md Suite 10 note |
| ONTAP REST `401 Unauthorized` | Wrong credentials in `ontap.cfg` | Verify `username`/`password` under `ontap` section |
| `No ready KVM user template available` | Template still downloading | Re-run `setup_zone` (step 12 waits for template readiness); or wait in CloudStack UI |
| `setup_zone` steps 11–12 slow on first run | System VMs and template download after zone enable | Normal — first run may take up to ~60 min; re-runs pass quickly when already ready |
Expand Down
44 changes: 26 additions & 18 deletions test/integration/plugins/ontap/TEST_CASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# ONTAP Integration Test Cases

Complete reference for all 62 test cases across 10 test suites.
Complete reference for all 70 test cases across 10 test suites.
Each suite is sequential — tests must run in numbered order; each step builds on state created by the previous step.

---
Expand Down Expand Up @@ -114,18 +114,22 @@ Each suite is sequential — tests must run in numbered order; each step builds
**File:** `nfs3/instance/test_vm_volume_attach.py`
**Class:** `TestOntapVMVolumeAttach`
**Tag:** `vm_volume_workflow`
**Total:** 8 tests | **Scope:** end-to-end — NFS3 pool, data volume, running VM, attach/detach lifecycle
**Total:** 12 tests | **Scope:** end-to-end — NFS3 pool, data volume resize, VM attach/detach lifecycle

| # | Test method | Goal | Depends on | CloudStack success criteria | ONTAP success criteria | Type |
|---|-------------|------|------------|-----------------------------|------------------------|------|
| 01 | `test_01_create_nfs3_pool` | Create NFS3 ONTAP primary storage pool | setUpClass (zone, cluster, template) | `pool.state == "Up"` | FlexVol `online`; export policy present | positive |
| 02 | `test_02_create_ontap_data_volume` | Allocate a CloudStack data volume on the ONTAP pool | test_01 (`pool`) | Volume non-None and listed in `listVolumes` | FlexVol still `online` | positive |
| 03 | `test_03_deploy_vm` | Deploy a VM using the first available ready KVM template | test_02 (`pool`, `volume`) | `vm.state == "Running"`; template auto-selected from `listTemplates` | n/a | positive |
| 03 | `test_03_deploy_vm` | Deploy a VM using the template and service offering discovered at setup time | test_02 (`pool`, `volume`) | VM boots and reaches `Running` | FlexVol still `online` | positive |
| 04 | `test_04_attach_volume_to_vm` | Attach the ONTAP data volume to the running VM (hot-plug) | test_03 (`vm`, `volume`) | `volume.virtualmachineid == vm.id`; `attachVolume` job succeeds | FlexVol `online`; after attach, a data file matching volume UUID present in FlexVol (`list_files_in_volume`) | positive |
| 05 | `test_05_stop_vm_export_retained` | Stop the running VM with volume attached | test_04 | `vm.state == "Stopped"` | FlexVol still `online`; NFS export policy still present | positive |
| 06 | `test_06_start_vm_volume_accessible` | Start the stopped VM | test_05 | `vm.state == "Running"` | FlexVol still `online` | positive |
| 07 | `test_07_detach_volume_from_vm` | Hot-detach the ONTAP volume from the running VM (TDS Detach NFS3) | test_06 (`vm`, `volume`) | `volume.virtualmachineid` cleared; `volume.state == "Ready"` | FlexVol still `online`; data file **still present** (NFS3: file persists until `deleteVolume`, not on detach) | positive |
| 08 | `test_08_destroy_vm_and_cleanup` | Destroy VM (expunge), delete volume, enter maintenance, delete pool | test_07 | VM no longer listed; volume no longer listed; pool no longer listed | FlexVol deleted; export policy deleted | cleanup |
| 05 | `test_05_resize_running_vm_rejected` | Attempt to grow an attached managed volume while its VM is running | test_04 | `resizeVolume` is rejected; volume size remains unchanged | qcow2 virtual size remains unchanged | negative |
| 06 | `test_06_stop_vm_export_retained` | Stop the running VM with volume attached | test_05 | `vm.state == "Stopped"` | FlexVol still `online`; NFS export policy still present | positive |
| 07 | `test_07_grow_stopped_vm_volume` | Grow the attached volume while the VM is stopped | test_06 | Volume is `Ready` at the requested byte size | `qemu-img info` reports the requested virtual size; ONTAP file remains present | positive |
| 08 | `test_08_shrink_rejected` | Attempt to shrink the grown qcow2 volume with `shrinkok=true` | test_07 | Resize is rejected; grown size remains unchanged | qcow2 virtual size remains unchanged | negative |
| 09 | `test_09_start_vm_volume_accessible` | Start the stopped VM | test_08 | `vm.state == "Running"`; KVM data-disk capacity equals target | FlexVol still `online` | positive |
| 10 | `test_10_detach_volume_from_vm` | Hot-detach the ONTAP volume from the running VM (TDS Detach NFS3) | test_09 (`vm`, `volume`) | `volume.virtualmachineid` cleared; `volume.state == "Ready"` | FlexVol still `online`; data file **still present** (NFS3: file persists until `deleteVolume`, not on detach) | positive |
| 11 | `test_11_grow_detached_volume` | Grow the detached, materialized data volume | test_10 | API and DB size equal target | qcow2 virtual size equals target | positive |
| 12 | `test_12_destroy_vm_and_cleanup` | Destroy VM (expunge), delete volume, enter maintenance, delete pool | test_11 | VM no longer listed; volume no longer listed; pool no longer listed | FlexVol deleted; export policy deleted | cleanup |

---

Expand Down Expand Up @@ -206,20 +210,24 @@ Each suite is sequential — tests must run in numbered order; each step builds
**File:** `iscsi/instance/test_vm_volume_attach.py`
**Class:** `TestOntapVMVolumeAttachISCSI`
**Tag:** `iscsi_vm_workflow`
**Total:** 8 tests | **Scope:** end-to-end — iSCSI pool, data volume (LUN), running VM, attach/stop/start/detach lifecycle
**Total:** 12 tests | **Scope:** end-to-end — iSCSI pool, data volume resize, VM attach/detach lifecycle

| # | Test method | Goal | Depends on | CloudStack success criteria | ONTAP success criteria | Type |
|---|-------------|------|------------|-----------------------------|------------------------|------|
| 01 | `test_01_create_iscsi_pool` | Create iSCSI ONTAP primary storage pool | setUpClass | `pool.state == "Up"`, `pool.type == "OntapiSCSI"` | FlexVol `online`; igroup per cluster host with host IQN | positive |
| 02 | `test_02_create_ontap_data_volume` | Allocate a CloudStack data volume (creates a LUN in the FlexVol) | test_01 (`pool`) | Volume non-None | ≥1 LUN in FlexVol | positive |
| 03 | `test_03_deploy_vm` | Deploy VM using first ready KVM template; verify 0 LUN-maps exist before attach | test_02 (`volume`) | `vm.state == "Running"`; 0 LUN-maps on ONTAP | 0 LUN-maps (`list_lun_maps_for_volume` returns empty) | positive |
| 02 | `test_02_create_ontap_data_volume` | Allocate and grow a detached data volume | test_01 (`pool`) | API and DB size equal target | LUN exists and `space.size` equals target | positive |
| 03 | `test_03_deploy_vm` | Deploy a VM using the template and service offering discovered at setup time | test_02 (`volume`) | VM boots and reaches `Running` | data LUN is not yet mapped (no attach performed) | positive |
| 04 | `test_04_attach_volume_to_vm` | Hot-attach the ONTAP iSCSI volume to the running VM — a LUN-map is created (TDS SN 27) | test_03 (`vm`, `volume`) | `volume.virtualmachineid == vm.id` | ≥1 LUN-map linking the LUN to the host's igroup | positive |
| 05 | `test_05_stop_vm_lun_unmapped` | Stop VM — LUN-maps must be removed (TDS VM Stop iSCSI) | test_04 | `vm.state == "Stopped"` | 0 LUN-maps; LUN itself **still present** in FlexVol | positive |
| 06 | `test_06_start_vm_lun_remapped` | Start VM — LUN-maps must be re-created (TDS VM Start iSCSI) | test_05 | `vm.state == "Running"` | ≥1 LUN-map re-created | positive |
| 07 | `test_07_detach_volume_from_vm` | Hot-detach the iSCSI volume from the running VM (TDS Detach iSCSI) | test_06 (`vm`, `volume`) | `volume.virtualmachineid` cleared | 0 LUN-maps; LUN still in FlexVol | positive ⚠️ |
| 08 | `test_08_destroy_vm_and_cleanup` | Destroy VM (expunge), delete volume, enter maintenance, delete pool | test_07 | VM gone; volume gone; pool gone | FlexVol deleted; all LUNs and igroups deleted | cleanup |
| 05 | `test_05_resize_running_vm_rejected` | Attempt to grow the attached managed LUN while its VM is running | test_04 | `resizeVolume` is rejected; volume size remains unchanged | LUN `space.size` remains unchanged | negative |
| 06 | `test_06_stop_vm_lun_unmapped` | Stop VM — LUN-maps must be removed (TDS VM Stop iSCSI) | test_05 | `vm.state == "Stopped"` | 0 LUN-maps; LUN itself **still present** in FlexVol | positive |
| 07 | `test_07_grow_stopped_vm_volume` | Grow the attached volume while the VM is stopped | test_06 | Volume is `Ready` at the requested byte size | LUN `space.size` equals the requested size; LUN remains unmapped | positive |
| 08 | `test_08_shrink_rejected` | Attempt to shrink the grown LUN with `shrinkok=true` | test_07 | Resize is rejected; grown size remains unchanged | LUN `space.size` remains unchanged | negative |
| 09 | `test_09_start_vm_lun_remapped` | Start VM — LUN-maps must be re-created (TDS VM Start iSCSI) | test_08 | `vm.state == "Running"`; KVM data-disk capacity equals target | ≥1 LUN-map re-created | positive |
| 10 | `test_10_detach_volume_from_vm` | Hot-detach the iSCSI volume from the running VM (TDS Detach iSCSI) | test_09 (`vm`, `volume`) | `volume.virtualmachineid` cleared | 0 LUN-maps; LUN still in FlexVol | positive ⚠️ |
| 11 | `test_11_grow_detached_volume` | Grow the detached, materialized data volume | test_10 | API and DB size equal target | LUN `space.size` equals target | positive |
| 12 | `test_12_destroy_vm_and_cleanup` | Destroy VM (expunge), delete volume, enter maintenance, delete pool | test_11 | VM gone; volume gone; pool gone | FlexVol deleted; all LUNs and igroups deleted | cleanup |

> ⚠️ **test_07 known status:** iSCSI hot-detach from a running VM relies on the KVM guest acknowledging the SCSI device removal. On this environment the guest does not acknowledge in time, causing CloudStack error 530. This is a KVM-host-level or guest-template limitation, not a test code defect. All other 61 tests pass.
> ⚠️ **test_10 known status:** iSCSI hot-detach from a running VM relies on the KVM guest acknowledging the SCSI device removal. On this environment the guest does not acknowledge in time, causing CloudStack error 530. This is a KVM-host-level or guest-template limitation, not a test code defect.

---

Expand All @@ -231,10 +239,10 @@ Each suite is sequential — tests must run in numbered order; each step builds
| NFS3 Pool with Volumes | NFS3 | Cluster | 7 | ✅ |
| NFS3 Zone-Scoped Pool | NFS3 | Zone | 4 | ✅ |
| NFS3 Volume Lifecycle | NFS3 | Cluster | 5 | ✅ |
| NFS3 VM + Volume Attach | NFS3 | Cluster | 8 | ✅ |
| NFS3 VM + Volume Attach | NFS3 | Cluster | 12 | ⏳ resize cases pending lab validation |
| iSCSI Pool Lifecycle | iSCSI | Cluster | 8 | ✅ |
| iSCSI Pool with Volumes | iSCSI | Cluster | 7 | ✅ |
| iSCSI Zone-Scoped Pool | iSCSI | Zone | 4 | ✅ |
| iSCSI Volume Lifecycle | iSCSI | Cluster | 5 | ✅ |
| iSCSI VM + Volume Attach | iSCSI | Cluster | 8 | ⚠️ 7/8 |
| **Total** | | | **62** | **61 passing** |
| iSCSI VM + Volume Attach | iSCSI | Cluster | 12 | ⏳ resize cases pending lab validation; detach limitation |
| **Total** | | | **70** | **New resize cases pending lab validation** |
Loading
Loading