Skip to content

Instantly share code, notes, and snippets.

@rootfs
Last active May 12, 2016 01:02
Show Gist options
  • Save rootfs/66e727ffb6836e3d655e6ebba17b58ab to your computer and use it in GitHub Desktop.
Save rootfs/66e727ffb6836e3d655e6ebba17b58ab to your computer and use it in GitHub Desktop.

Existing test cases

This file creates an NFS PV with recycle policy and an PVC to claim the PV. After the PVC is bound, it is deleted and PV is recycled.

This file creates a fake PV with Recycle policy, creates a PVC that binds to fake PV, deletes the PVC and triggers PV recycler, watches for the PV to be released then available. In the second test, the PV is set Delete policy and binds to a PVC. After PVC is deleted, watches the PV to be deleted too. In the third test, 100 PVCs are created, manually puts one of the PVC ref to a PV, watches PV is bound and verify PV is bound to the PVC.

Existing Red Hat Tests proposed for transfer to Kubernetes E2E Test Environment

Test Case PR Status
1
2
3
4

1. Create Pod that uses multiple PVCs. Verify all PVCs are successfully bound and mounted.

  • Setup.
    • In the NFS server pod, creates 3 exports
    • Create 3 PVs, with sizes 1GB, 2GB, and 3GB, these PVs map to the 3 NFS exports
    • Create 3 PVCs, with claim sizes 1GB, 2GB, and 3GB.
    • Create a client Pod that uses the 3 PVCs
  • Expected Result. The client Pod should mount all NFS PVs, each PVCs are bound to the PVs with the matching size.

2. Create one PV and multiple PVCs. Verify exactly one PVC bound while other PVCs are pending.

  • Setup
    • Create 1 PVs with sizes 1GB
    • Create 3 PVCs, with claim sizes 1GB, 2GB, and 3GB.
  • Expected Result. 1GB PVC should be bound to the PV, 2GB and 3GB PVCs are pending.

3. Delete PVC and make sure PV changes to proper state given one of Recycle, Delete, and Retain policies defined in the PV.

Create PV with Delete policy

  • Setup
    • Create 1 PVs with sizes 1GB and Delete reclaim policy
    • Create 1 PVCs with claim sizes 1GB
    • Delete the PVC
  • Expected result. After PVC is deleted, PV is also deleted

4. Create PV with Retain policy

  • Setup
    • Create 1 PVs with sizes 1GB and Delete reclaim policy
    • Create a file on the PV
    • Create 1 PVCs with claim sizes 1GB
    • Delete the PVC
  • Expected result. After PVC is deleted, PV still exists and the file on the PV also exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment