# Packages

No description provided by the author
No description provided by the author

# README

Integration Test

Volume-event-exporter makes use of ginkgo & gomega libraries to implement its integration tests.

To run the integrations test:

  1. Copy kubeconfig file into path ~/.kube/config or set the KUBECONFIG env.
  2. Run make sanity-test

Note:

  • Integration test will spin up RPC server and will tear down server at end of the test. By default server will run on 9090 port and it can configured with option --port.
  • To run a specific test following command can be used:
    ginkgo -v -focus="TEST NFS PVC CREATE & DELETE EVENTS" -- -address=172.18.0.1 -port=9091
    
    In above -focus can have test name

Following parameters can be configured as a arguments to test:

  • kubeconfig: Path to kubeconfig to interact with Kubernetes APIServer.
  • address: Address on which server will start(Defaults to system IPAddress).
  • port: Server port on which requests are served
  • type: Defines the type of the RPC server, as of now only RESTfull server is supported.

Available Integration Tests:

Test NameExpected behaviorTest Link
Create NFS PVC with reclaim policy Delete
  • Verify whether volume_event_controller sent volume_provisioned JSON data to configured server
    • nfs_pvc
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creationTimestamp on nfs_pv
nfs_sanity_test.go
Delete NFS PVC with reclaim policy Delete
  • Verify whether volume_event_controller sent volume_deprovisioned JSON data to configured server
    • nfs_pv
    • backend_pvc
    • backend_pvc
    • along with creation and deletion timestamp on nfs_pv
nfs_sanity_test.go
Create NFS PVC with ReclaimPolicy Retain
  • Verify whether volume_event_controller sent volume_provisioned JSON data to configured server
    • nfs_pvc
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creationTimestamp on nfs_pv
nfs_pvc_retain_test.go
Delete NFS PVC with ReclaimPolicy Retain
  • Verify that volume_event_controller shouldn't send event when nfs_pvc is deleted
nfs_pvc_retain_test.go
Delete released NFS PV
  • Verify whether volume_event_controller sent volume_deprovisioned JSON data to configured server
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creation and deletion timestamp on nfs_pv
nfs_pvc_retain_test.go
Create NFS PVC with invalid backend SC
  • Verify that volume_event_controller SHOULD NOT send any create event data to configured server
nfs_pvc_invalid_backend_sc_test.go
Delete NFS PVC with invalid backend SC
  • Verify that volume_event_controller SHOULD NOT send any delete event data to configured server
nfs_pvc_invalid_backend_sc_test.go
Disable sidecar and create PVC with reclaim policy Delete. Once the NFS PVC is bounded start sidecar
  • Verify whether volume_event_controller sent following volume_provisioned JSON data to configured server after enabiling volume_event_exporter
    • nfs_pvc
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creationTimestamp on nfs_pv
nfs_pvc_creation_scaling_down_sidecar_test.go
Stop the volume-event-exporter sidecar and Create NFS PVC with ReclaimPolicy Retain. Once NFS PVC is bound, start the volume-event-exporter sidecar
    Verify whether volume_event_controller sent volume_provisioned JSON data to configured server
  • nfs_pvc
  • nfs_pv
  • backend_pvc
  • backend_pvc
  • along with creation timestamp on nfs_pv
nfs_create_retain_pv_disable_exporter_test.go
Disable sidecar then provision & de-provision NFS PVC with reclaim policy Delete. Once the NFS PVC is deleted start sidecar
  • Verify whether volume_event_controller sent following volume_provisioned JSON data to configured server after enabling volume_event_exporter
    • nfs_pvc
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creationTimestamp on nfs_pv
  • verify whether volume_event_controller sent following volume_deprovisioned JSON data to configured server after enabling volume_event_exporter
    • nfs_pv
    • backend_pvc
    • backend_pv
    • along with creation and deletion timestamp on nfs_pv
nfs_pvc_create_delete_disabling_sidecar_test.go
Stop the volume-event-exporter sidecar and Create NFS PVC with ReclaimPolicy Retain. Delete NFS PVC. Start the volume-event-exporter sidecar
    Verify whether volume_event_controller send volume_provisioned JSON data to configured server
  • nfs_pvc
  • nfs_pv
  • backend_pvc
  • backend_pvc
  • along with creation timestamp on nfs_pv
    Verify provisioner doesn’t send volume_deleted json.
nfs_delete_retain_pv_disable_exporter_test.go
Stop the volume-events-exporter sidecar and delete the released NFS PV. Start the volume-events-exporter sidecar
    Verify provisioner send volume_deleted json having information of
  • nfs_pv
  • backend_pvc
  • backend_pvc
  • along with creation and deletion timestamp on nfs_pv
nfs_delete_released_pv_disable_exporter_test.go