From 53e7e76d8fae37c3033e5a5e4ac368c6ec863d2c Mon Sep 17 00:00:00 2001 From: sinhaashish Date: Wed, 3 Jul 2024 08:12:33 +0000 Subject: [PATCH] test(features): add bdd for existing ci-tests Signed-off-by: sinhaashish --- tests/bdd/zfs.feature | 142 ++++++++++++++++++++++++++++++++++++++++++ tests/utils.go | 2 +- 2 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 tests/bdd/zfs.feature diff --git a/tests/bdd/zfs.feature b/tests/bdd/zfs.feature new file mode 100644 index 000000000..02cb889a2 --- /dev/null +++ b/tests/bdd/zfs.feature @@ -0,0 +1,142 @@ +Feature: Validate volume provisioning for fsType zfs, ext4, xfs, btrfs + Validate snapshot creation and clone + Validate volume resize + + Background: + Given a single zfs cluster is configured + And zfs pool pool created on the node + + Scenario Outline: Volume provision for file system + Given a storage class is created with fsType as + When pvc is created referencing this same storage class + Then pvc should be in bound state + And zfsvolume must be created and should be in Ready state to use by any application + Examples: + | fsType | + | zfs | + | ext4 | + | xfs | + | btrfs | + + Scenario Outline: Volume provision for file system + Given a storage class is created with fsType as + And pvc is created referencing this same storage class with zfsvolume in Ready state to use by any application + When a deployment is created using the same pvc + Then deployment pod should be in Running state + Examples: + | 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 + When the zfsvolume properties like are updated + Then the zfsvolume properties must reflect the updated value + Examples: + | fsType | properties | + | zfs | compression | + | ext4 | compression | + | xfs | compression | + | btrfs | compression | + | zfs | dedup | + | ext4 | dedup | + | xfs | dedup | + | btrfs | dedup | + + + 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 + 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: + | fsType | volume_type | record_size | block_size | + | zfs | DATASET | 4096 | 8192 | + | ext4 | DATASET | 4096 | 8192 | + | xfs | DATASET | 4096 | 8192 | + | btrfs | DATASET | 4096 | 8192 | + | zfs | ZVOL | 8192 | 16384 | + | ext4 | ZVOL | 8192 | 16384 | + | xfs | ZVOL | 8192 | 16384 | + | btrfs | ZVOL | 8192 | 16384 | + + 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 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 + Examples: + | 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 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 + Then the clone must be created from the and the created deployment must use the cloned volume + Examples: + | fsType | source | + | zfs | snapshot | + | ext4 | snapshot | + | xfs | snapshot | + | btrfs | snapshot | + | zfs | volume | + | ext4 | volume | + | xfs | volume | + | btrfs | volume | + + 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 + When the size of pvc is update to a + Then the pvc must be of size + Examples: + | fsType | new_capacity | + | zfs | 8Gi | + | ext4 | 8Gi | + | xfs | 8Gi | + + + Scenario: Volume provision 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 + 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 + And a pvc with volumeMode as Bolck is created referencing this storage class + When the volume type is and record size is updated to and volume block size to size + Then the volume type is must have the record sise as and volume block size as size + Examples: + | volume_type | record_size | block_size | + | DATASET | 4096 | 8192 | + | DATASET | 4096 | 8192 | + | DATASET | 4096 | 8192 | + | DATASET | 4096 | 8192 | + | ZVOL | 8192 | 16384 | + | ZVOL | 8192 | 16384 | + | ZVOL | 8192 | 16384 | + | ZVOL | 8192 | 16384 | + + \ No newline at end of file diff --git a/tests/utils.go b/tests/utils.go index a3b57beb9..e598b23ad 100644 --- a/tests/utils.go +++ b/tests/utils.go @@ -176,7 +176,7 @@ func VerifyZFSVolume() { gomega.Expect(vol.Finalizers[0]).To(gomega.Equal(zfs.ZFSFinalizer), "while checking finializer to be set {%s}", pvcObj.Spec.VolumeName) } -// VerifyZFSVolumePropEdit verigies the volume properties +// VerifyZFSVolumePropEdit verifies the volume properties func VerifyZFSVolumePropEdit() { ginkgo.By("verifying compression property update")