Skip to content

Commit

Permalink
test: limit nfs snapshot test on a few regions
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
andyzhangx committed Oct 9, 2023
1 parent fefec28 commit fa91eeb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 4 additions & 3 deletions test/e2e/dynamic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
Cmd: "echo 'hello world' > /mnt/test-1/data",
Volumes: []testsuites.VolumeDetails{
{
FSType: "ext4",
ClaimSize: "10Gi",
VolumeMount: testsuites.VolumeMountDetails{
NameGenerate: "test-volume-",
Expand All @@ -724,13 +723,15 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
ginkgo.It("should create a pod, write and read to it, take a nfs volume snapshot, and validate whether it is ready to use [file.csi.azure.com]", func(ctx ginkgo.SpecContext) {
skipIfTestingInWindowsCluster()
skipIfUsingInTreeVolumePlugin()
if !supportSnapshotwithNFS {
ginkgo.Skip("take snapshot on nfs file share is not supported on current region")
}

pod := testsuites.PodDetails{
Cmd: "echo 'hello world' > /mnt/test-1/data",
Volumes: []testsuites.VolumeDetails{
{
FSType: "ext4",
ClaimSize: "10Gi",
ClaimSize: "100Gi",
VolumeMount: testsuites.VolumeMountDetails{
NameGenerate: "test-volume-",
MountPathGenerate: "/mnt/test-",
Expand Down
11 changes: 10 additions & 1 deletion test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ var (
"csi.storage.k8s.io/provisioner-secret-namespace": "default",
"csi.storage.k8s.io/node-stage-secret-namespace": "default",
}
supportZRSwithNFS bool
supportZRSwithNFS bool
supportSnapshotwithNFS bool
)

type testCmd struct {
Expand Down Expand Up @@ -105,6 +106,14 @@ var _ = ginkgo.BeforeSuite(func(ctx ginkgo.SpecContext) {
}
}

// check whether current region supports snapshot with NFS protocol
supportedRegions = []string{"canadacentral", "uksouth", "francesouth", "francecentral", "germanywestcentral"}
for _, region := range supportedRegions {
if creds.Location == region {
supportSnapshotwithNFS = true
}
}

// Install Azure File CSI Driver on cluster from project root
e2eBootstrap := testCmd{
command: "make",
Expand Down

0 comments on commit fa91eeb

Please sign in to comment.