RFC: Adding test cases to e2e/persistent_volumes.go and integration/persistent_volumes_test.go
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.
Test Case | PR | Status |
---|---|---|
1 | ||
2 | ||
3 | ||
4 |
- 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.
- 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.
- 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
- 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