dm-vdo / vdo-devel

Primary VDO mainline development repository
GNU General Public License v2.0
7 stars 11 forks source link

[VDO-5749] Add tests for Thin Pools using VDO as data devices. #182

Open bjohnsto opened 3 months ago

bjohnsto commented 3 months ago

In order to support multiple devices on top on a VDO, LVM has designed a setup where it will use VDO as a data device underneath a Thin Pool device. This will allow the user to create multiple thin devices on top of the thin pool, thus allowing for sharing of a dedupe pool.

To support this in our test environment, we have split apart our former Thin.pm test device (which was a combination of a thin pool and single thin device on top) into two devices; a normal ThinPool test device (BlockDevice/LVM/ThinPool) and a thin volume (BlockDevice/LVM/Thin). We then created a VDO backed thin pool test device that provides VDO and LVM support, similar to what LVMManaged (BlockDevice/VDO/LVMManged) does now.

To make things cleaner, we have created an LVMVDO (BlockDevice/VDO/LVMVDO) base test device that inherits from VDO (BlockDevice/VDO) and LVM (BlockDevice/LVM). The old LVMManaged (now renamed to Managed) and the new thin vdo device (also named ThinPool) have been moved to a new directory called LVMVDO (BlockDevice/VDO/LVMVDO/Managed and BlockDevice/VDO/LVMVDO/ThinPool). BlockDevice/VDO/LVMVDO/ThinPool inherits from BlockDevice/LVM/ThinPool)

Changes were made to VolumeGroup.pm to match the new devices and modified old Thin device. We now have two new functions in VolumeGeroup.pm; createThinVolume and createThinPoolVolume, which cleans up some of the code but also makes it a bit more complicated since we have to add it some additional assertions in createThinVolume to make sure it can only be called when the storage device is a ThinPool device.

We have modified StorageStack to handle the new test devices and updated any old tests that used thin to now create a thinpool and then a thin device on top. This will make all old tests continue to work. Finally we have added one new test called ThinVDO.pm to test Thin with VDO. This currently requires RAWHIDE devices since it has the LVM version we need. There are two subtests in it; one basic test and one with multiple thin volumes on top of a single vdo backed thin pool. Both test writing data and verifying dedupe.