This directory contains the basic VM, Volume life cycle tests for Linstor storage pool (in KVM hypervisor).
To run the basic volume tests, first update the below test data of the CloudStack environment
TestData.zoneId: <id of zone>
TestData.clusterId: <id of cluster>
TestData.domainId: <id of domain>
TestData.url: <management server IP>
TestData.primaryStorage "url": <Linstor storage pool url (see the format below) to use as primary storage>
and to enable and run volume migration tests, update the below test data
TestData.migrationTests: True
TestData.primaryStorageSameInstance "url": <Linstor url (see the format below) of the pool on same storage cluster as TestData.primaryStorage>
TestData.primaryStorageDistinctInstance "url": <Linstor url (see the format below) of the pool not on the same storage cluster as TestData.primaryStorage>
Then run the tests using python unittest runner: nosetests
nosetests --with-marvin --marvin-config=<marvin-cfg-file> <cloudstack-dir>/test/integration/plugins/linstor/test_linstor_volumes.py --zone=<zone> --hypervisor=kvm
You can also run these tests out of the box with PyDev or PyCharm or whatever.
test_linstor_encrypted_snapshots.py covers the encrypted-volume snapshot round trip
(create encrypted root disk -> snapshot -> revert / create-volume-from-snapshot) and that the
backed-up qcow2 on secondary storage is itself LUKS encrypted.
Extra prerequisites:
- At least one KVM host with volume-encryption support (
host.encryptionsupported == true, i.e. cryptsetup/qemu LUKS available). Tests self-skip if none is found. - The Linstor resource group used (
acs-basic) must be able to add a LUKS layer to its volumes. lin.backup.snapshotsmust be enabled (default) so snapshots are backed up to secondary storage; the test sets it. With it disabled the qcow2 path is not exercised.
nosetests --with-marvin --marvin-config=<marvin-cfg-file> <cloudstack-dir>/test/integration/plugins/linstor/test_linstor_encrypted_snapshots.py --zone=<zone> --hypervisor=kvm