RFC: Adding test cases to e2e/persistent_volumes.go
e2e/persistent_volumes.go 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.
- 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.
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
- Setup
- Expected Result
And vice-versa where the claim has more modes than the PV. Test the that least permissive accessmode is matched.
- Setup
- Expected Result
Create a PVC that defines a specifiv PV (via volumeName) and make sure that PV is bound to the claim. Additionally, create PV1 with a claimRef -> claim1. Create claim1 with a volumeName -> PV2 (PV2 may or may not be created). Test that PV1 does not bind to claim1. Test that claim1 does not bind to PV1. @jeffvance please break down into sub tests
- Setup.
- create pv1 with reclaimPolicy=Retain
- create claim1
- test both are Bound
- delete claim1
- test pv1.status.Phase is Released.
- re-create claim1
- test pv1.status.Phase remains Released and claim1.status is Pending
- delete claim1 and pv1
- re-create pv1 and claim1
- test both are Bound
- create pv2 with claimRef -> claim2 and reclaimPolicy = Retain
- create claim2
- create claim2
- test both are Bound
- delete claim2
- test pv2 status is Released
- re-create claim2
- test pv2 status remains Released and claim2 status is Pending
- delete pv2 and claim2
- re-create pv2 and claim2
- test pv2 status remains Released and claim2 status is Pending.
- Expected Result