Repository navigation
Commit 69c92a3
authored
smoke test: support ceph storage pools (#11931)
* smoke test: support ceph storage pools
* test: fix test failures
* test: add volume migration which has been fixed
* test: support Ceph/RBD primary storage in NAS backup smoke test
test_backup_recovery_nas.py only allowed NFS primary storage, since it
reused the primary storage pool's own path as the NAS backup repository
address, and always required incremental-backup semantics that only
qcow2/NFS storage can provide. Neither holds on Ceph/RBD.
- setUpClass now accepts RBD alongside NFS as the primary storage pool
type, picking a pool that's actually Up rather than list()[0] --
environments that added Ceph/RBD after the zone's original NFS
primary storage keep that old pool around in Disabled state, and it
still sorts first, silently exercising its path as if it were the
storage VMs actually deploy on.
- The NAS backup repository's NFS export address is resolved
independently of the primary storage: when the primary pool isn't NFS,
reuse the nfs test data entry (services[nfs][url]) -- the same
temporary NFS mount point test_primary_storage.py uses for its
temporary NFS primary storage pool, and something every marvin
environment already has configured. An explicit
nas_backup_repository_address test data entry or
NAS_BACKUP_REPO_ADDRESS environment variable, if set, takes precedence.
- The external offering imported in setUpClass is matched to the
repository just created by externalid (== the repository's own id
for the nas provider) rather than blindly taking index 0 -- a stray
repository left over from an earlier interrupted run, whose backups
didn't get cleaned up so its own teardown couldn't remove it either,
sorts alongside the new one with no guarantee of which comes first.
- Incremental NAS backups require QEMU dirty bitmaps / libvirt
checkpoints, which only exist on file-based qcow2 storage
(NASBackupProvider.allVolumesOnCheckpointCapableStorage). The six
incremental-chain tests now skip on RBD/Ceph, where the provider
always falls back to full-only backups server-side, rather than
failing on assertions that storage type can never satisfy.
- Added test_restore_volume_and_attach_to_vm, which exercises
restoreVolumeFromBackupAndAttachToVM end-to-end (restoring a backed-up
ROOT and DATADISK volume onto a second, stopped Instance) -- the API
that drives the restore-and-attach code fixed by the previous commit
(#14007). The target Instance is stopped with
forced=True: a graceful ACPI stop was observed to time out (~2
minutes) before falling back to a hard destroy anyway, and once
forced to a hard destroy the domain drops out of libvirt entirely,
so the periodic ping-based PowerState sync the restore call depends
on falls back to a much slower heuristic well past any reasonable
wait. A forced stop destroys the domain immediately and
deterministically.
* test: fix test_10_list_volumes for zone-wide storage pools
A zone-wide storage pool (e.g. RBD configured with scope=ZONE) isn't
bound to a single pod/cluster, so a volume on it has no clustername/
clusterid/podid/podname. test_10_list_volumes asserted these were
always non-None, which fails whenever storage is zone-scoped rather
than cluster-scoped. Now look up the volume's actual storage pool and
only assert pod/cluster attributes when its scope isn't ZONE.
* test_host_tags: fix cleanup to handle None host tags
When a host has no explicit tags initially, cls.host.hosttags is None.
Passing None to the API does not set the hosttags parameter, so tags
are never cleared during cleanup. Convert None to empty string to properly
clear tags that were set during the test.
* test: support zone-wide storage pools in test_list_storage_pools
Zone-wide storage pools (scope=ZONE) are not bound to clusters or pods.
When filtering by clusterid/podid, these pools may be included in results
with clusterid=None and podid=None. Updated tests to:
- test_01: Accept zone-wide pools in clusterid filter results
- test_07: Accept zone-wide pools in podid filter results
- test_12: New test validating zone-wide vs cluster-scoped pools
Both invalid clusterid/podid filters now correctly return zone-wide pools,
and assertions skip None values for zone-wide pools while validating
cluster-scoped pools have their expected scope identifiers.
Validated on two environments:
- Zone-wide only (10.1.112.155): 12/12 tests passed
- Cluster-scoped only (10.0.112.202): 12/12 tests passed
* smoke test: cover RBD/librbd volume encryption in TestVolumeEncryption
TestVolumeEncryption previously skipped entirely on RBD storage pools.
Now that RBD encryption is supported (PR #13556), extend it instead of
skipping:
- setUpClass no longer hard-skips RBD pools; records storage_pool_type
for use by the assertions below.
- check_volume_encryption() branches on pool type: RBD volumes are
encrypted natively by librbd, so the domain XML carries
<encryption format='luks2' engine='librbd'>; other pool types keep
the existing qemu-native <encryption format='luks'> check.
- does_host_with_encryption_support_exists() gained an RBD-specific
path: the API's "encryptionsupported" field only reflects qemu-native
LUKS support, so librbd capability is read from the host_details
table (host.volume.encryption.rbd), joined on the host's uuid.
- get_expected_guest_visible_size() centralizes the existing PowerFlex
size-overhead adjustment and adds the equivalent for RBD: encrypted
RBD volumes reserve a 16 MiB LUKS2 header out of the volume's own
reported size, so the guest sees size - header.
- test_03_root_and_data_volume_encryption now also exercises resize of
the attached encrypted data volume, reusing its VM instead of
spinning up a separate one:
- online (VM stays running): verified via the volume's own API state
and size, since picking up a live virtio-blk capacity change in the
guest depends on the guest OS/kernel (the CentOS 5.5 template used
here predates reliable live-resize notification) and is orthogonal
to whether CloudStack/libvirt/qemu actually grew the volume.
- offline (detach, resize, reattach): verified against the guest's
fdisk output, matched by the expected byte count rather than a
device letter derived from deviceid, since libvirt is not
guaranteed to reuse the same target letter after a detach then
reattach.
* test: run unmanage/import VM lifecycle test on KVM too
* test: merge the direct download deploy tests into one test
Deploy a VM from the direct download template on each type of storage found
(NFS, RBD, SharedMountPoint and local) in a single test, using the storage
pool type as the storage tag.
* test: sync the data to disk before taking the VM snapshot
A disk-only VM snapshot does not contain the guest page cache, so the file
written by the test may be missing after the revert.
* test: address review comments on the Ceph smoke tests
Assert that the encryption format and passphrase secret lists of TestVolumeEncryption are not empty, instead of asserting they are not None, which findall() never returns. Compare the storage pool type case-insensitively, give the direct download test a unique storage tag, skip the live VM migration test for every RBD source pool, and drop an unused variable in test_list_storage_pools.1 parent caf1091 commit 69c92a3
11 files changed
Lines changed: 464 additions & 171 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
48 | 56 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
55 | 96 | | |
56 | 97 | | |
57 | 98 | | |
| |||
72 | 113 | | |
73 | 114 | | |
74 | 115 | | |
75 | | - | |
| 116 | + | |
76 | 117 | | |
77 | | - | |
| 118 | + | |
78 | 119 | | |
79 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
80 | 127 | | |
81 | | - | |
82 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
83 | 132 | | |
84 | 133 | | |
85 | 134 | | |
| |||
303 | 352 | | |
304 | 353 | | |
305 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
306 | 368 | | |
307 | 369 | | |
308 | 370 | | |
309 | 371 | | |
310 | 372 | | |
311 | 373 | | |
| 374 | + | |
312 | 375 | | |
313 | 376 | | |
314 | 377 | | |
| |||
358 | 421 | | |
359 | 422 | | |
360 | 423 | | |
| 424 | + | |
361 | 425 | | |
362 | 426 | | |
363 | 427 | | |
| |||
430 | 494 | | |
431 | 495 | | |
432 | 496 | | |
| 497 | + | |
433 | 498 | | |
434 | 499 | | |
435 | 500 | | |
| |||
479 | 544 | | |
480 | 545 | | |
481 | 546 | | |
| 547 | + | |
482 | 548 | | |
483 | 549 | | |
484 | 550 | | |
| |||
531 | 597 | | |
532 | 598 | | |
533 | 599 | | |
| 600 | + | |
534 | 601 | | |
535 | 602 | | |
536 | 603 | | |
| |||
568 | 635 | | |
569 | 636 | | |
570 | 637 | | |
| 638 | + | |
571 | 639 | | |
572 | 640 | | |
573 | 641 | | |
| |||
594 | 662 | | |
595 | 663 | | |
596 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
0 commit comments