bdd(volume-event-controller): add sanity test to verify volume-event-exporter exported data#2
Merged
mynktl merged 6 commits intomayadata-io:developfrom Aug 31, 2021
Conversation
mittachaitu
commented
Aug 24, 2021
36192cc to
2bad78d
Compare
added 5 commits
August 25, 2021 12:33
…exporter exported data This PR add sanity test to verify volume-event-exporter behaviour during NFS PVC create and delete events. When volume-event-exporter sends events to server, event server will add annotation of NFS PVC namespace & name, NFS PV, backend PVC namespace & name, backend PV name on backend PVC during create & delete event. Later those annotations will be verified by integration test. Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
…ctions 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>
2bad78d to
5b7b443
Compare
Codecov Report
@@ Coverage Diff @@
## develop #2 +/- ##
========================================
Coverage 26.64% 26.64%
========================================
Files 5 5
Lines 334 334
========================================
Hits 89 89
Misses 235 235
Partials 10 10 Continue to review full report at Codecov.
|
mynktl
reviewed
Aug 26, 2021
| } | ||
|
|
||
| // isAuthorized is a token based authentication check that client should pass the token in request Header | ||
| func (s *service) isAuthorized(endpointHandler func(http.ResponseWriter, *http.Request)) http.Handler { |
Member
There was a problem hiding this comment.
here comment is confusing. isAuthorized is returning a function handler instead of processing it.
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Author
|
Update: ginkgo -v
Running Suite: Test application deployment
==========================================
Random Seed: 1630325593
Will run 7 of 7 specs
STEP: waiting for openebs-nfs-provisioner pod to come into running state
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 out of 1 new replicas have been updated
Waiting for deployment rollout to finish: 0 of 1 updated replicas are available
STEP: building a namespace
TEST NFS PVC CREATE & DELTE EVENTS when pvc with storageclass openebs-rwx is created
should create a pvc
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:50
STEP: creating above pvc
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
waiting for PVC {sanity-event-nfs-pvc} in namespace {event-exporter-tests-ns} to get into bound state
I0830 17:44:33.289934 157571 service.go:84] Received event handler event to process data
I0830 17:44:33.331928 157571 nfs_data.go:132] Addedd annotations map[it.nfs.openebs.io/vc-backend-pv:pvc-1c91b283-dcc6-4e16-9d30-e2da944c697a it.nfs.openebs.io/vc-backend-pvc:openebs-nfs-pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f it.nfs.openebs.io/vc-nfspv:pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f it.nfs.openebs.io/vc-nfspvc:event-exporter-tests-ns-sanity-event-nfs-pvc] on backend pvc openebs/nfs-pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f for create event
• [SLOW TEST:41.439 seconds]
TEST NFS PVC CREATE & DELTE EVENTS
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:32
when pvc with storageclass openebs-rwx is created
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:49
should create a pvc
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:50
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when pvc gets into bounded state
should have NFS server in running state
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:80
• [SLOW TEST:10.076 seconds]
TEST NFS PVC CREATE & DELTE EVENTS
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:32
when pvc gets into bounded state
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:79
should have NFS server in running state
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:80
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when pvc gets into bounded state
should have sent details to server... verify annotation of backing PVC
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:92
•
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when pvc is deleted
should delete pvc
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:122
•
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when pvc is deleted
should send events to server
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:127
I0830 17:44:46.904095 157571 service.go:84] Received event handler event to process data
I0830 17:44:46.931790 157571 nfs_data.go:183] Addedd annotations map[it.nfs.openebs.io/vd-backend-pv:pvc-1c91b283-dcc6-4e16-9d30-e2da944c697a it.nfs.openebs.io/vd-backend-pvc:openebs-nfs-pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f it.nfs.openebs.io/vd-nfspv:pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f] on backend pvc openebs/nfs-pvc-755e8db0-626e-4e7e-a77d-8b148b8e8c8f for create event
• [SLOW TEST:10.277 seconds]
TEST NFS PVC CREATE & DELTE EVENTS
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:32
when pvc is deleted
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:121
should send events to server
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:127
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when test event finalizers are removed on resource
should get removed
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:152
•
------------------------------
TEST NFS PVC CREATE & DELTE EVENTS when test event finalizers are removed on resource
should get deleted from cluster
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:162
• [SLOW TEST:20.503 seconds]
TEST NFS PVC CREATE & DELTE EVENTS
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:32
when test event finalizers are removed on resource
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:151
should get deleted from cluster
/home/sai/gocode/src/github.com/mayadata-io/volume-events-exporter/tests/nfs_sanity_test.go:162
------------------------------
STEP: deleting namespace
W0830 17:45:15.837848 157571 rest_server.go:94] error: http: Server closed
Ran 7 of 7 Specs in 120.505 seconds
SUCCESS! -- 7 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
Ginkgo ran 1 suite in 2m2.690527352s
Test Suite Passed
sai@sai-ThinkPad-L470:~/gocode/src/github.com/mayadata-io/volume-events-exporter/tests$ git diff
diff --git a/tests/nfs_sanity_test.go b/tests/nfs_sanity_test.go
index f154117..18fc73d 100644
--- a/tests/nfs_sanity_test.go
+++ b/tests/nfs_sanity_test.go
@@ -71,8 +71,8 @@ var _ = Describe("TEST NFS PVC CREATE & DELTE EVENTS", func() {
Expect(pvcPhase).To(Equal(corev1.ClaimBound), "pvc %s/%s should be in bound phase", applicationNamespace, pvcName)
// TODO: Remove below lines after merging https://github.com/openebs/dynamic-nfs-provisioner/pull/97 PR
- err = markNFSResources(applicationNamespace, pvcName)
- Expect(err).To(BeNil(), "while makrking for events")
+ // err = markNFSResources(applicationNamespace, pvcName)
+ // Expect(err).To(BeNil(), "while makrking for events")
})
})
sai@sai-ThinkPad-L470:~/gocode/src/github.com/mayadata-io/volume-events-exporter/tests$
|
mynktl
approved these changes
Aug 31, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR does?
This PR adds a sanity test to verify volume-event-exporter behavior
during NFS PVC creates and deletes events. When volume-event-exporter
sends events to the server, event server will add annotation of NFS PVC
namespace & name, NFS PV, backend PVC namespace & name, backend PV name
on backend PVC during create & delete event. Later those annotations
will be verified by an integration test.
Note:
make sanity-test.Note to reviewers: