@@ -16,8 +16,10 @@ package e2e
16
16
17
17
import (
18
18
"context"
19
+
19
20
. "github.com/onsi/ginkgo"
20
21
"github.com/oracle/oci-cloud-controller-manager/test/e2e/framework"
22
+ v1 "k8s.io/api/core/v1"
21
23
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
22
24
)
23
25
@@ -26,7 +28,7 @@ var _ = Describe("Basic Static FSS test", func() {
26
28
Context ("[cloudprovider][storage][csi][fss][static]" , func () {
27
29
It ("Create PVC and POD for CSI-FSS" , func () {
28
30
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 {})
30
32
pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
31
33
f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
32
34
pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , false , []string {})
@@ -50,7 +52,7 @@ var _ = Describe("Mount Options Static FSS test", func() {
50
52
It ("Create PV PVC and POD for CSI-FSS with mount options" , func () {
51
53
pvcJig := framework .NewPVCTestJig (f .ClientSet , "csi-fss-e2e-test" )
52
54
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 )
54
56
pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
55
57
f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
56
58
pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , false , mountOptions )
@@ -69,7 +71,7 @@ var _ = Describe("Mount Options Static FSS test", func() {
69
71
70
72
func TestEncryptionType (f * framework.CloudProviderFramework , mountOptions []string ) {
71
73
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 )
73
75
pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
74
76
f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
75
77
pvcJig .CheckSinglePodReadWrite (f .Namespace .Name , pvc .Name , true , mountOptions )
@@ -80,7 +82,7 @@ var _ = Describe("Multiple Pods Static FSS test", func() {
80
82
Context ("[cloudprovider][storage][csi][fss][static]" , func () {
81
83
It ("Multiple Pods should be able to read write same file" , func () {
82
84
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 {})
84
86
pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
85
87
f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
86
88
pvcJig .CheckMultiplePodReadWrite (f .Namespace .Name , pvc .Name , false )
@@ -89,7 +91,7 @@ var _ = Describe("Multiple Pods Static FSS test", func() {
89
91
It ("Multiple Pods should be able to read write same file with InTransit encryption enabled" , func () {
90
92
checkNodeAvailability (f )
91
93
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 {})
93
95
pvc := pvcJig .CreateAndAwaitPVCOrFailStaticFSS (f .Namespace .Name , pv .Name , "50Gi" , nil )
94
96
f .VolumeIds = append (f .VolumeIds , pvc .Spec .VolumeName )
95
97
pvcJig .CheckMultiplePodReadWrite (f .Namespace .Name , pvc .Name , true )
@@ -114,3 +116,19 @@ func checkNodeAvailability(f *framework.CloudProviderFramework) {
114
116
Skip ("Skipping test due to non-availability of nodes with label \" oke.oraclecloud.com/e2e.oci-fss-util\" " )
115
117
}
116
118
}
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