@@ -16,8 +16,10 @@ package e2e
1616
1717import (
1818 "context"
19+
1920 . "github.com/onsi/ginkgo"
2021 "github.com/oracle/oci-cloud-controller-manager/test/e2e/framework"
22+ v1 "k8s.io/api/core/v1"
2123 v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
2224)
2325
@@ -26,7 +28,7 @@ var _ = Describe("Basic Static FSS test", func() {
2628 Context ("[cloudprovider][storage][csi][fss][static]" , func () {
2729 It ("Create PVC and POD for CSI-FSS" , func () {
2830 pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test" )
29- pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , []string {})
31+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , "ReadWriteMany" , "" , []string {})
3032 pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
3133 f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
3234 pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , false , []string {})
@@ -50,7 +52,7 @@ var _ = Describe("Mount Options Static FSS test", func() {
5052 It ("Create PV PVC and POD for CSI-FSS with mount options" , func () {
5153 pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test" )
5254 mountOptions := []string {"sync" , "hard" , "noac" , "nolock" }
53- pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , mountOptions )
55+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , "ReadWriteMany" , "" , mountOptions )
5456 pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
5557 f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
5658 pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , false , mountOptions )
@@ -69,7 +71,7 @@ var _ = Describe("Mount Options Static FSS test", func() {
6971
7072func TestEncryptionType (f * framework.CloudProviderFramework , mountOptions []string ) {
7173 pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test-intransit" )
72- pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "true" , mountOptions )
74+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "true" , "ReadWriteMany" , "" , mountOptions )
7375 pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
7476 f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
7577 pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , true , mountOptions )
@@ -80,7 +82,7 @@ var _ = Describe("Multiple Pods Static FSS test", func() {
8082 Context ("[cloudprovider][storage][csi][fss][static]" , func () {
8183 It ("Multiple Pods should be able to read write same file" , func () {
8284 pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test" )
83- pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , []string {})
85+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , "ReadWriteMany" , "" , []string {})
8486 pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
8587 f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
8688 pvcJig .CheckMultiplePodReadWrite (f .Namespace .Name , pvc .Name , false )
@@ -89,7 +91,7 @@ var _ = Describe("Multiple Pods Static FSS test", func() {
8991 It ("Multiple Pods should be able to read write same file with InTransit encryption enabled" , func () {
9092 checkNodeAvailability (f )
9193 pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test" )
92- pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "true" , []string {})
94+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "true" , "ReadWriteMany" , "" , []string {})
9395 pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
9496 f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
9597 pvcJig .CheckMultiplePodReadWrite (f .Namespace .Name , pvc .Name , true )
@@ -114,3 +116,19 @@ func checkNodeAvailability(f *framework.CloudProviderFramework) {
114116 Skip ("Skipping test due to non-availability of nodes with label \" oke.oraclecloud.com/e2e.oci-fss-util\" " )
115117 }
116118}
119+
120+ var _ = Describe ("Static FSS RWO Tests" , func () {
121+ f := framework .NewDefaultFramework ("fss-rwo" )
122+ Context ("[cloudprovider][storage][csi][fss][static][rwo]" , func () {
123+ It ("Verify volume group ownership change for RWO volume when fsType and fsGroup are defined" , func () {
124+ pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-rwo-fss-e2e-test" )
125+ pv := pvcJig .CreatePVorFailFSS (f .Namespace .Name , setupF .VolumeHandle , "false" , "ReadWriteOnce" , "nfs" , []string {})
126+ pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , func (pvc * v1.PersistentVolumeClaim ) {
127+ pvc .Spec .AccessModes = []v1.PersistentVolumeAccessMode {"ReadWriteOnce" }
128+ })
129+ f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
130+ pod := pvcJig .CreateAndAwaitNginxPodOrFail (f .Namespace .Name , pvc , WriteCommand )
131+ pvcJig .CheckVolumeOwnership (f .Namespace .Name , pod , "/usr/share/nginx/html/" , "1000" )
132+ })
133+ })
134+ })
0 commit comments