Repository navigation
CSTACKEX-207: Automation for snapshot and revert for VM and CS-volume - #122
sathvikaragi wants to merge 4 commits into
Conversation
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.84% |
| Branch coverage | 19.00% |
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
| 06 Start VM — LUN-map is re-created on ONTAP | ||
| 07 Detach data volume from running VM — LUN-map removed | ||
| 08 Destroy VM (cache LUN still survives), delete data volume, delete pool | ||
| 07 Open an SSH port forward to the VM; write ROOT and DATA files |
There was a problem hiding this comment.
Why is 07 needed?
There was a problem hiding this comment.
That step is now test_09_open_ssh_and_write_root_data_files. It opens SSH and writes a marker on ROOT and on DATA. The revert tests read those files back, which is how we check that the guest data was restored. The resize steps from main moved it from 07 to 09.
| 10 Revert a volume snapshot while the VM is Running — rejected | ||
| 11 ROOT volume revert: write before-snapshot, snapshot, write | ||
| after-snapshot, revert, file is back to before-snapshot | ||
| 12 DATA volume revert: same write, snapshot, write, revert check |
There was a problem hiding this comment.
Snapshot behaviour shouldn't change between ROOT and DATA disk, so, 12 should be enough. Let me know if you feel otherwise.
There was a problem hiding this comment.
Those are now test_13 and test_14. test_13 is the ROOT check: write, snapshot, write, stop, revert, start. test_14 is not the same check on DATA. It keeps the DATA snapshot from test_11, takes a second one, reverts to the older snapshot and then to the newer one, and deletes both while the VM is still running.
I wanted to keep a different one to ensure the revert works perfectly on a disk that has template and that doesnt and is properly able to revert
| 18 Revert VM-A's ROOT; VM-B's file is unchanged | ||
| 19 VM snapshots of both VMs at the same time | ||
| 20 Volume snapshot of VM-A while VM-B's ROOT reverts | ||
| 21 VM snapshot of VM-A while VM-B reverts to its VM snapshot |
There was a problem hiding this comment.
How is this different from 20?
There was a problem hiding this comment.
IN 20 it's a volume snapshot and in 21 it's a VM snapshot.
| fi | ||
|
|
||
| echo "==> Pinning paramiko<4 (CentOS 5.5 guest sshd only offers SHA-1 kex and ssh-rsa)" | ||
| if ! "${PIP}" install "paramiko>=3.4,<4"; then |
There was a problem hiding this comment.
Now that we are importing more dependencies, its time to create a 'requirements.txt' file with proper package versions
There was a problem hiding this comment.
Added test/integration/plugins/ontap/requirements.txt with setuptools>=40.3.0,<81, pyvmomi==8.0.2.0.1, and paramiko>=3.4,<4. setup_env.sh installs Marvin first, then installs that file once. Marvin's own dependencies would otherwise take the newest setuptools, Paramiko, and pyvmomi.
| 06 Start the VM — VM Running; volume still attached; FlexVol online | ||
| 07 Detach the ONTAP data volume from the VM | ||
| 08 Destroy VM (cache still survives); delete ONTAP volume; enter | ||
| 07 Open an SSH port forward to the VM; write ROOT and DATA files |
There was a problem hiding this comment.
Same comments as in the iSCSI test file
There was a problem hiding this comment.
as mentioned did similar changes to both iscsi and NFS
|
|
||
| ONTAP_MIN_VOLUME_SIZE = 1677721600 | ||
| # ROOT + DATA disks of two VMs plus FlexVol snapshot reserve | ||
| DEFAULT_POOL_SIZE = 50 * 1024 ** 3 |
There was a problem hiding this comment.
Before calling this test ideally pool size should be properly set in ontap.cfg, while a default size should exist in case ontap.cfg has pool size empty.
Check if any such configurable variables are being hardcoded in the test files instead of being read from ontap.cfg?
There was a problem hiding this comment.
Both suites call template_cache_capacity_bytes(pool_cfg) in setUpClass. That reads templateCacheCapacitybytes, then capacitybytes. If neither is set, the pool is created at the 50 GiB default. TestData uses that same default only when the value passed in is empty
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
|
||
| Tests must run in order (test_01, test_02, test_03, test_03a, test_03b, | ||
| test_04 ... test_08). Each step builds on the shared state established by the | ||
| test_04 ... test_24). Each step builds on the shared state established by the |
There was a problem hiding this comment.
These tests are missing, plz add
Revert to an older volume snapshot that is not the latest one.
Delete a volume/VM snapshot while the VM still exists
There was a problem hiding this comment.
Case:1- added in step 14 revert and even delete is done after that
case:2 similarly in step 17 delete is also done
| # ------------------------------------------------------------------ | ||
|
|
||
| @attr(tags=[TAG], required_hardware=True) | ||
| def test_23_destroy_vm_with_vm_snapshot(self): |
There was a problem hiding this comment.
VM-A's data and its FlexVol snapshots must still be there. The test only checks that VM-B's own snapshot is gone.
There was a problem hiding this comment.
This is now test_26_destroy_vm_with_vm_snapshot. It expunges VM-B and checks only that VM-B's VM snapshot is no longer listed in CloudStack and that VM-B's FlexVol snapshot is gone from ONTAP.
VM-A does not still have FlexVol snapshots at this step. The DATA snapshots are deleted in test_14 and the VM snapshots in test_17. Snapshots created in test_20 through test_23 are deleted in those tests' tearDown, so there is nothing of VM-A's left on the FlexVol for test_26 to keep.
fcdb970 to
6dd3acb
Compare
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.77% |
| Branch coverage | 20.05% |
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
ec6992f to
1af6ca0
Compare
Description
This PR...
Description
Adds snapshot and revert coverage to the ONTAP VM + volume suites for NFS3 (
nfs3/instance/test_vm_volume_attach.py) and iSCSI (iscsi/instance/test_vm_volume_attach.py). Each suite is 29 tests (test_01throughtest_27, plustest_03aandtest_03b). The same steps run on both protocols.Guest checks use SSH (
guest_ssh.py, Paramiko) to write and read marker files on ROOT and DATA. Each snapshot is also checked as a new FlexVol snapshot on ONTAP.Guest access
Volume snapshots
VM snapshots
Two VMs on one pool
Guest login uses
cloudstack.templateUsernameandcloudstack.templatePassword.Supporting changes:
guest_ssh.py,requirements.txt(setuptools>=40.3.0,<81,pyvmomi==8.0.2.0.1,paramiko>=3.4,<4), andsetup_env.shinstalling that file once after Marvin.README.mdandTEST_CASES.mdlist 151 tests after the pool-lifecycle cases from main.How Has This Been Tested?
Both suites were run on the lab against CloudStack
10.193.56.14and ONTAP10.196.5.248. iSCSI passed 29/29. NFS passed 29/29 on the rerun after the earlier ONTAP management-API timeout intest_03b.Result: Both suites passed 26/26 on the lab.
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?