Delete volume first before deleting snapshot
In test_volume_from_snapshot, the test steps are:
1) create a volume (named src_vol)
2) create a snapshot based on src_vol
3) create a volume based on snapshot (named dst_vol)
Because in volume.base.resource_cleanup, the deleting
sequence is:
cls.clear_snapshots()
cls.clear_volumes()
So it will delete snapshots first and then delete volumes,
but dst_vol is created based on snapshot, so deleting
snapshot will end with status 'error-deleting' because
the volume created based on it(dst_vol) is not deleted yet.
Whether "snapshot can be deleted if there exists volume that
is created based on the snapshot" depends on the implementation
mechanism of vendors, and generally speaking, some verdors will
use "virtual disk clone" which will promote disk clone speed, and
in "virtual disk clone" situation, volume should be deleted
before deleting snapshot because the "disk clone" is just a
relationship between volume and snapshot.
So we should add immediate cleanup of volume dst_vol to
avoid deleting snapshot failure for some vendors. And for
those vendors that don't use "virtual clone", to delete volume
in testcase teardown will do no harm.
Change-Id: I0d9ad9556748dafddefe3680417290f9b798488d
1 file changed