Skip to content

Commit

Permalink
test(volgroup_vgpattern_bdd): adding feature file
Browse files Browse the repository at this point in the history
Signed-off-by: Abhilash Shetty <[email protected]>
  • Loading branch information
abhilashshetty04 committed Jun 18, 2024
1 parent a84b4fd commit 43c2975
Showing 1 changed file with 47 additions and 40 deletions.
87 changes: 47 additions & 40 deletions tests/bdd/volgroup_vgpattern_bdd.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Feature: Validate vgpattern and volgroup based scheduling.
Background:
Given Single lvmnode cluster is configured
Expand All @@ -8,7 +7,7 @@ Feature: Validate vgpattern and volgroup based scheduling.
Given a sc is created with volgroup as "lvmvg"
And pvc is created referencing the same sc
Then lvmvolume cr should get created
And cr state should be Ready
And lvmvolume cr state should be Ready

Scenario: test sc with volgroup not present on the node
Given a sc is created with volgroup as "lvmvgn"
Expand All @@ -22,25 +21,33 @@ Feature: Validate vgpattern and volgroup based scheduling.
And lvm vg "lvmvg" and "lvmvg1" is created on a node

Scenario: test sc with vgpattern matching atleast one vg
Given sc is created with vgpattern "lvmvg1.*"
Given a sc is created with vgpattern "lvmvg1.*"
When a pvc is created by referencing the sc
Then pvc should be Bound
And lvmvolume should be in "lvmvg1" vg
And lvmvolume cr should be in "lvmvg1" vg


Scenario: test sc with vgpattern matching no vg
Given sc is created with vgpattern "lvmvgn.*"
Given a sc is created with vgpattern "lvmvgn.*"
When a pvc is created by referencing the sc
Then pvc should not be Bound
And lvmvolume should not be created
And lvmvolume cr should not be created


Scenario: test pvc with higher size then vg free space
Given "lvmvg" has lesser free space then "lvmvg1"
Scenario: test pvc with larger size then vg free space
Given both <vg> are created with their respective <size>
And sc is created with volgroup as "lvmvg"
When a pvc is created with size higher then "lvmvg" and lower then "lvmvg1" free space
When a pvc is created with size "1.3G"
Then pvc should not be bound
And lvmvolume cr should not be created
When "lvmvg" is extended to "1.5G"
Then pvc should be Bound
And lvmvolume cr should have expected vg value

Examples:
| vg | size |
| lvmvg | 1G |
| lvmvg1 | 2G |


Background:
Expand All @@ -54,37 +61,37 @@ Feature: Validate vgpattern and volgroup based scheduling.
And lvmvolume cr should not be created

Scenario: test sc with volgroup present on one node with allowed topology
Given a sc is created with volgroup as "lvmvg1"
Given a sc is created with volgroup parameter as "lvmvg1"
And sc has topology key with "node1" value
When pvc is created referencing the same sc
Then pvc should be bound
And lvmvolume cr should be Ready
And lvmvolume node should be allowed topology node
And lvmvolume cr should have expected owner and vg value

Scenario: test sc with volgroup not present on any node
Given a sc is created with volgroup as "lvmvgn"
Given a sc is created with volgroup parameter as "lvmvgn"
When pvc is created referencing the same sc
Then pvc should be in Pending state
And lvmvolume should not be created
And lvmvolume cr should not be created

Examples:
| node | vg |
| node1 | lvmvg1 |
| node2 | lvmvg2 |
| node3 | lvmvg3 |
Examples:
| node | vg |
| node1 | lvmvg1 |
| node2 | lvmvg2 |
| node3 | lvmvg3 |


Background:
Given a 3 lvmnode cluster is configured
And each node <node> has <vg> created with <size>

Scenario: test sc with volgroup present on 2 nodeswith varying free space and allowed topology
Given an sc is created with volgroup "lvmvg"
Scenario: test sc with volgroup present on 2 nodes with varying free space and allowed topology
Given a sc is created with volgroup parameter as "lvmvg"
And node1 and node2 is in allowed topology
When a pvc is created with "1.3G" size
Then pvc should be Bound
And lvmvolume should in Ready state
And volume owner should be node2
And lvmvolume cr should be in Ready state
And lvmvolume cr should have expected owner and vg value

Examples:
| node | vg | size |
Expand All @@ -94,11 +101,15 @@ Feature: Validate vgpattern and volgroup based scheduling.


Scenario: test sc with volgroup present on 2 nodes with less space and allowed topology
Given an sc is created with volgroup "lvmvg"
Given a sc is created with volgroup parameter as "lvmvg"
And node1 and node2 is in allowed topology
When a pvc is created with "1.3G" size
Then pvc should be Pending
And lvmvolume should not be created
And lvmvolume cr should not be created
When node2 vg is extended to <1.5G>
Then pvc should be Bound
And lvmvolume cr should be created
And lvmvolume cr should have expected owner and vg value

Examples:
| node | vg | size |
Expand All @@ -112,24 +123,20 @@ Feature: Validate vgpattern and volgroup based scheduling.
And each lvm node <node> has <vg> and <vg1> with <size> and <size1> respectively

Scenario: test sc with volgroup present on 2 nodeswith varying free space and allowed topology
Given a sc is created volgroup “lvmvg“ using WaitForFirstConsumer as binding mode
Given a sc is created with volgroup parameter as “lvmvg“
And using WaitForFirstConsumer as binding mode
And pvc is created with size “1.5G“
Then lvmvolume and pv should not be created
When an app is created referring the pvc
Then App should be running
And pvc should Bound
And lvmvolume should be Ready
And lvmvolume should have owner as “node-2“
And lvmvolume should be on vg “lvmvg“
Then lvmvolume cr should not be created
When an app is created referencing the pvc
Then pvc should be created
And App should be running
And lvmvolume cr should be Ready
And lvmvolume cr should have expected owner and vg value

Examples:

| node | vg | size | vg1 | size1 |

| node1 | lvmvg | 1G | lvmvg1 | 2G |

| node2 | lvmvg | 1.6G | lvmvg1 | 2G |

| node3 | lvmvg | 1G | lvmvg1 | 2G |

Background:
Expand All @@ -138,14 +145,14 @@ Feature: Validate vgpattern and volgroup based scheduling.
And each node <node> has <vg> and <vg2> created with same size

Scenario: test sc with vgpattern matching vg present in all node
Given sc1 is created with vgpattern "lvmvg1.*"
And sc2 is created with vgpattern "lvmvg2.*"
And sc3 is created with vgpattern "lvmvg3*."
Given sc1 is created with vgpattern parameter as "lvmvg1.*"
And sc2 is created with vgpattern parameter as "lvmvg2.*"
And sc3 is created with vgpattern parameter as "lvmvg3*."
When pvc1 is created referencing sc1
And pvc2 is created referencing sc2
And pvc3 is created referencing sc3
Then pvc1 and pvc2 should be in Bound state
And pvc1 and pvc2 lvmvolume should be in correct vg and node
And pvc1 and pvc2 lvmvolume cr should be in expected vg and node
And pvc3 should be in Pending state


Expand Down

0 comments on commit 43c2975

Please sign in to comment.