Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(BDD): add positive and negative BDD for verifying PDB creation #1606

Closed
wants to merge 4 commits into from

Conversation

mittachaitu
Copy link

@mittachaitu mittachaitu commented Feb 5, 2020

Signed-off-by: mittachaitu sai.chaithanya@mayadata.io

What this PR does / why we need it:
This PR adds positive and negative BDD for PDB creations verifications. Test cases for PR: ##1573

Cmd To Run Negative Test:
Note: This must be run with openebs/cvc-operator:inject-ci
Step1: cd tests/csi/cstor/volume/poddisruptionbudget
Step2: ginkgo -v -focus="\[csi\]\ \[cstor-negative\]" -- -kubeconfig=/home/sai/.kube/config -cstor-maxpools=3 -cstor-replicas=3 -cstor-pool-type=stripe

Running Suite: Test PodDisruptionBudget For CStor Volume
========================================================
Random Seed: 1580882569
Will run 1 of 2 specs

STEP: waiting for maya-apiserver pod to come into running state
STEP: waiting for openebs-provisioner pod to come into running state
STEP: Verifying 'admission-server' pod status as running
STEP: building a namespace
STEP: creating above namespace
S
------------------------------
[csi] [cstor-negative] TEST VOLUME PROVISIONING BY INJECTING ERRORS IN PODDISRUPTIONBUDGET OPERATIONS When HA volume is created by injecting errors in PodDisruptionBudget operations 
  CStorVolumeConfig should be claimed after removing errors
  /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:65
STEP: Creating and verifying cstorpoolcluster
STEP: creating above cstorpoolcluster
STEP: verifying healthy cstorpool count
STEP: Creating storage class
STEP: building a storageclass
STEP: creating above storageclass
STEP: Create service for CVC Operator
STEP: Inject errors in PDB Operations
STEP: creating PVC
STEP: Fetch latest PVC
STEP: Verify CStorVolumeClaim Pending Status
STEP: Eject errors in PDB Operations
STEP: Verify PVC bound state after ejecting the errors
STEP: verifying pvc status as bound
STEP: Verifying the presence of components related to volume
STEP: Verify CStorVolume target pod status
STEP: verifying target pod count as 1 once the app has been deployed
STEP: Verify CStorVolumeReplica count
STEP: Verify CStorVolumeClaim Status
STEP: Verifying the poddisruption budget of volume
STEP: Deleteing service
STEP: Deleting pvc
STEP: verifying deleted pvc
STEP: Verifying deletion of components related to volume
STEP: verifying target pod count as 0
STEP: verifying if cstorvolume is deleted
STEP: Verifying cstorvolume replica count
STEP: Deleting cstorpoolcluster
STEP: deleting cstorpoolcluster
STEP: verifying deleted cspc
STEP: Deleting storage class
STEP: deleting storageclass

• [SLOW TEST:148.815 seconds]
[csi] [cstor-negative] TEST VOLUME PROVISIONING BY INJECTING ERRORS IN PODDISRUPTIONBUDGET OPERATIONS
/home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:54
  When HA volume is created by injecting errors in PodDisruptionBudget operations
  /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:64
    CStorVolumeConfig should be claimed after removing errors
    /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:65
------------------------------
STEP: deleting namespace

Ran 1 of 2 Specs in 152.261 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 1 Skipped
PASS

Ginkgo ran 1 suite in 2m36.497971306s
Test Suite Passed

Cmd To Run Positive Test:
Step1: cd tests/csi/cstor/volume/poddisruptionbudget
Step2: ginkgo -v -focus="\[csi\]\ \[cstor\]" -- -kubeconfig=/home/sai/.kube/config -cstor-maxpools=3 -cstor-replicas=3 -cstor-pool-type=stripe

Running Suite: Test PodDisruptionBudget For CStor Volume
========================================================
Random Seed: 1580883142
Will run 1 of 2 specs

STEP: waiting for maya-apiserver pod to come into running state
STEP: waiting for openebs-provisioner pod to come into running state
STEP: Verifying 'admission-server' pod status as running
STEP: building a namespace
STEP: creating above namespace
S
------------------------------
[csi] [cstor] TEST VOLUME PROVISIONING WITH POD DISRUPTION BUDGET When HA volume is created PodDisruptionBudget should be created 
  Volume Should be in Running and PDB should be Created
  /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:45
STEP: Creating and verifying cstorpoolcluster
STEP: creating above cstorpoolcluster
STEP: verifying healthy cstorpool count
STEP: Creating storage class
STEP: building a storageclass
STEP: creating above storageclass
STEP: creating and verifying PVC bound status
STEP: verifying pvc status as bound
STEP: Verifying the presence of components related to volume
STEP: Verify CStorVolume target pod status
STEP: verifying target pod count as 1 once the app has been deployed
STEP: Verify CStorVolumeReplica count
STEP: Verify CStorVolumeClaim Status
STEP: Verifying the poddisruption budget of volume
STEP: Deleting pvc
STEP: verifying deleted pvc
STEP: Verifying deletion of components related to volume
STEP: verifying target pod count as 0
STEP: verifying if cstorvolume is deleted
STEP: Verifying cstorvolume replica count
STEP: Deleting cstorpoolcluster
STEP: deleting cstorpoolcluster
STEP: verifying deleted cspc
STEP: Deleting storage class
STEP: deleting storageclass

• [SLOW TEST:145.891 seconds]
[csi] [cstor] TEST VOLUME PROVISIONING WITH POD DISRUPTION BUDGET
/home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:34
  When HA volume is created PodDisruptionBudget should be created
  /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:44
    Volume Should be in Running and PDB should be Created
    /home/sai/gocode/src/github.com/openebs/maya/tests/csi/cstor/volume/poddisruptionbudget/poddisruption_budget_test.go:45
------------------------------
STEP: deleting namespace

Ran 1 of 2 Specs in 149.447 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 1 Skipped
PASS

Ginkgo ran 1 suite in 2m33.799305308s
Test Suite Passed

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:
Test cases covered in this PR:

  1. For HA volume(HA volumes means replicaCount >= 3) test will verify whether PDB was created among volume replica pools.
  2. For NonHA volumes verifies whether PDB was created or not(Usually PDB shouldn't be created).
  3. Inject errors in PDB creation to verify whether reconciliation is happening or not for PDB creation.
    Checklist:
  • Fixes #
  • Labelled this PR & related issue with documentation tag
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests

mittachaitu added 3 commits February 5, 2020 00:57
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
limitations under the License.
*/

package volume
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package name should be updated

limitations under the License.
*/

package volume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package name should be updated

Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mittachaitu
Copy link
Author

I was not actively working on this PR. I will re-open when it is required

@mittachaitu mittachaitu closed this Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants