From c389127af2fad59418a86fea1b9c62e61532f197 Mon Sep 17 00:00:00 2001 From: sinhaashish Date: Fri, 12 Jul 2024 05:27:37 +0000 Subject: [PATCH] test(features): add missing bdd Signed-off-by: sinhaashish --- tests/bdd/zfs.feature | 145 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 129 insertions(+), 16 deletions(-) diff --git a/tests/bdd/zfs.feature b/tests/bdd/zfs.feature index 02cb889a2..f7dcf53b4 100644 --- a/tests/bdd/zfs.feature +++ b/tests/bdd/zfs.feature @@ -32,7 +32,7 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs Scenario Outline: Volume property change Given a storage class is created with fsType as - And pvc is created referencing this storage class with a deployment using the same pvc + And pvc is created referencing this storage class and a deployment using the same pvc When the zfsvolume properties like are updated Then the zfsvolume properties must reflect the updated value Examples: @@ -49,7 +49,7 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs Scenario Outline: Volume data size change Given a storage class is created with fsType as - And pvc is created referencing this storage class with a deployment using the same pvc + And pvc is created referencing this storage class and a deployment using the same pvc When the zfsvolume volume type is and record size is updated to and volume block size to size is updated Then the volume type is must have the record sise as and volume block size as size Examples: @@ -65,7 +65,7 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs Scenario Outline: Create a snapshot from a pvc Given a storage class is created with fsType as - And pvc is created referencing this storage class with a deployment using the same pvc + And pvc is created referencing this storage class and a deployment using the same pvc And a zfsvolume is created and used by the application When the snapshot create command for the given pvc is run in the same namespace Then the snapshot must be created for the corresponding pvc with status as ready to use @@ -78,7 +78,7 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs Scenario Outline: Create a clone from a Given a storage class is created with fsType as - And pvc is created referencing this storage class with a deployment using the same pvc + And pvc is created referencing this storage class and a deployment using the same pvc And a zfsvolume is created and used by the application And a snapshot is be created for the corresponding pvc When the clone create command is run for this snapshot and a deployment is created to use this clone @@ -96,7 +96,7 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs Scenario Outline: Resize of pvc Given a storage class is created with fsType as - And pvc is created referencing the this storage class with a deployment using the same pvc + And pvc is created referencing the this storage class and a deployment using the same pvc When the size of pvc is update to a Then the pvc must be of size Examples: @@ -112,16 +112,6 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs When a deployment is created using the same pvc Then zfsvolume must be created and used by the application - Scenario Outline: Volume property change for a raw block volume - Given a storage class is created without any fstype - And a pvc with volumeMode as Bolck is created referencing this storage class - When a deployment is created using the same pvc - When the zfsvolume properties are updated - Then the zfsvolume properties must reflect the changed value for the - Examples: - | properties | - | compression | - | dedup | Scenario Outline: Volume data size change for a raw block volume Given a storage class is created without any fstype @@ -139,4 +129,127 @@ Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs | ZVOL | 8192 | 16384 | | ZVOL | 8192 | 16384 | - \ No newline at end of file + Scenario Outline: Online volume resize + Given a storage class is created with fsType as + And pvc is created referencing this storage class + And a deployment is created using the same pvc which is in running state + When resize volume requested is by updating the PVC resource + Then corresponding pvc must be resized + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + + Scenario Outline: Thin provisioning + Given a storage class is created with fsType as and thinprovision as true + And pvc is created referencing this storage class and a deployment using the same pvc + And a zfsvolume is created and used by the application + When the ZPOOL size is 1GB and the requested storage in PVC is 10 GB + Then the volume must be provisioned even if the ZPOOL does not have the enough capacity + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + | btrfs | + + Scenario Outline: Supported compression algorithm + Given a storage class is created with fsType as zfs, ext4, xfs, btrfs and compression as + And pvc is created referencing this storage class and a deployment using the same pvc + When the zfsvolume compression is present + Then the volume ust be provisioned and the compression type of volume must be + Examples: + | compression_type| + | lzjb | + | zstd | + | zstd-1 | + | zstd-2 | + | zstd-3 | + | zstd-4 | + | zstd-5 | + | zstd-7 | + | zstd-8 | + | zstd-9 | + | zstd-10 | + | zstd-11 | + | zstd-12 | + | zstd-13 | + | zstd-14 | + | zstd-15 | + | zstd-16 | + | zstd-17 | + | zstd-18 | + | zstd-19 | + | gzip | + | gzip-1 | + | gzip-2 | + | gzip-3 | + | gzip-4 | + | gzip-5 | + | gzip-6 | + | gzip-7 | + | gzip-8 | + | gzip-9 | + | zle | + | lz4 | + +############################################################################################################ +################## The below bdd need to be implemented in ci tests ######################################## +############################################################################################################ + + Scenario Outline: Create a clone from a + Given a storage class is created without any fstype as Raw block volume does not have any fstype + And a pvc with volumeMode as Bolck is created referencing this storage class + And a deployment is created using the same pvc + And a snapshot is be created for the corresponding + When the clone create command is run for this snapshot and a deployment is created to use this clone + Then the clone must be created from the snapshot and the created deployment must use the cloned volume + Examples: + | source | + | snapshot | + | volume | + + Scenario Outline: Shared volume + Given a storage class is created with fsType as and shared is set to yes + And pvc is created referencing this storage class and a deployment using the same pvc + And a zfsvolume is created and used by the application + When two pods were deployed on same node and they both are running + Then the LocalPV-ZFS Driver will allow the volumes to be mounted by more than one pods + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + | btrfs | + + +############################################################################################################ +################## The below bdd need to be implemented in e2e tests ######################################## +############################################################################################################ + + Scenario Outline: Allowed topologies + Given a storage class with allowedTopologies is created with fsType as + And pvc is created referencing this storage class and a deployment using the same pvc + When the topology for specific zpool is defined in the storage class + Then the volumes must be provisioned on the nodes which has the required zpool + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + | btrfs | + + Scenario Outline: Import Existing Volumes to LocalPV-ZFS + Given a storage class is created with fsType as + And pvc is created referencing this storage class and a deployment using the same pvc + When a node fails and the disks is attached to a different node + Then the zfs pool should be imported on that pool + And the zfsvolume resource should reflect that upon creation of a volume referencing the pool on that node + And the application should keep running + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + | btrfs |