From add2858de7dddb6c00dc7abe322e3db6610638dc Mon Sep 17 00:00:00 2001 From: hime Date: Tue, 10 Dec 2024 16:42:00 +0000 Subject: [PATCH] GRPC e2e tests. --- test/e2e/e2e_test.go | 22 +++++++++++++++++-- test/e2e/main.go | 2 +- test/e2e/run-e2e-ci.sh | 2 +- test/e2e/run-e2e-local.sh | 2 +- test/e2e/specs/specs.go | 2 +- test/e2e/specs/testdriver.go | 8 ++++++- test/e2e/testsuites/gcsfuse_integration.go | 12 ++++++++++ .../gcsfuse_integration_file_cache.go | 5 +++++ ...tegration_file_cache_parallel_downloads.go | 5 +++++ 9 files changed, 53 insertions(+), 7 deletions(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 349ca14bb..e7617555b 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -114,7 +114,7 @@ var _ = ginkgo.Describe("E2E Test Suite", func() { testsuites.InitGcsFuseCSIMetadataPrefetchTestSuite, } - testDriver := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, false) + testDriver := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, false, false) ginkgo.Context(fmt.Sprintf("[Driver: %s]", testDriver.GetDriverInfo().Name), func() { storageframework.DefineTestSuites(testDriver, GCSFuseCSITestSuites) @@ -126,9 +126,27 @@ var _ = ginkgo.Describe("E2E Test Suite", func() { testsuites.InitGcsFuseCSIGCSFuseIntegrationFileCacheParallelDownloadsTestSuite, } - testDriverHNS := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, true) + testDriverHNS := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, true, false) ginkgo.Context(fmt.Sprintf("[Driver: %s HNS]", testDriverHNS.GetDriverInfo().Name), func() { storageframework.DefineTestSuites(testDriverHNS, GCSFuseCSITestSuitesHNS) }) + + testDriverHNSAndGrpc := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, true, true) + + ginkgo.Context(fmt.Sprintf("[Driver: %s HNS + GRPC]", testDriverHNSAndGrpc.GetDriverInfo().Name), func() { + storageframework.DefineTestSuites(testDriverHNSAndGrpc, GCSFuseCSITestSuitesHNS) + }) + + GCSFuseCSITestSuitesGRPC := []func() storageframework.TestSuite{ + testsuites.InitGcsFuseCSIGCSFuseIntegrationTestSuite, + testsuites.InitGcsFuseCSIGCSFuseIntegrationFileCacheTestSuite, + testsuites.InitGcsFuseCSIGCSFuseIntegrationFileCacheParallelDownloadsTestSuite, + } + + testDriverGRPC := specs.InitGCSFuseCSITestDriver(c, m, *bucketLocation, *skipGcpSaTest, false, true) + + ginkgo.Context(fmt.Sprintf("[Driver: %s GRPC]", testDriverGRPC.GetDriverInfo().Name), func() { + storageframework.DefineTestSuites(testDriverGRPC, GCSFuseCSITestSuitesGRPC) + }) }) diff --git a/test/e2e/main.go b/test/e2e/main.go index 4c8ec2ce9..6b58c649c 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -56,7 +56,7 @@ var ( ginkgoFocus = flag.String("ginkgo-focus", "", "pass to ginkgo run --focus flag") ginkgoSkip = flag.String("ginkgo-skip", "", "pass to ginkgo run --skip flag") ginkgoProcs = flag.String("ginkgo-procs", "10", "pass to ginkgo run --procs flag") - ginkgoTimeout = flag.String("ginkgo-timeout", "4h", "pass to ginkgo run --timeout flag") + ginkgoTimeout = flag.String("ginkgo-timeout", "8h", "pass to ginkgo run --timeout flag") ginkgoFlakeAttempts = flag.String("ginkgo-flake-attempts", "2", "pass to ginkgo run --flake-attempts flag") ginkgoSkipGcpSaTest = flag.Bool("ginkgo-skip-gcp-sa-test", true, "skip GCP SA test") ) diff --git a/test/e2e/run-e2e-ci.sh b/test/e2e/run-e2e-ci.sh index be69958be..ec7b847b0 100755 --- a/test/e2e/run-e2e-ci.sh +++ b/test/e2e/run-e2e-ci.sh @@ -29,7 +29,7 @@ readonly cloudsdk_api_endpoint_overrides_container=${CLOUDSDK_API_ENDPOINT_OVERR readonly use_gke_managed_driver="${USE_GKE_MANAGED_DRIVER:-true}" readonly ginkgo_focus="${TEST_FOCUS:-}" readonly ginkgo_skip="${TEST_SKIP:-}" -readonly ginkgo_timeout="${E2E_TEST_GINKGO_TIMEOUT:-4h}" +readonly ginkgo_timeout="${E2E_TEST_GINKGO_TIMEOUT:-8h}" readonly ginkgo_procs="${E2E_TEST_GINKGO_PROCS:-20}" readonly boskos_resource_type="${GCE_PD_BOSKOS_RESOURCE_TYPE:-gke-internal-project}" readonly gke_cluster_version=${GKE_CLUSTER_VERSION:-latest} diff --git a/test/e2e/run-e2e-local.sh b/test/e2e/run-e2e-local.sh index 432e9ab7a..00cd39409 100755 --- a/test/e2e/run-e2e-local.sh +++ b/test/e2e/run-e2e-local.sh @@ -31,7 +31,7 @@ readonly build_gcs_fuse_csi_driver="${E2E_TEST_BUILD_DRIVER:-false}" readonly ginkgo_focus="${E2E_TEST_FOCUS:-}" readonly ginkgo_skip="${E2E_TEST_SKIP:-should.succeed.in.performance.test}" readonly ginkgo_procs="${E2E_TEST_GINKGO_PROCS:-10}" -readonly ginkgo_timeout="${E2E_TEST_GINKGO_TIMEOUT:-4h}" +readonly ginkgo_timeout="${E2E_TEST_GINKGO_TIMEOUT:-8h}" readonly ginkgo_flake_attempts="${E2E_TEST_GINKGO_FLAKE_ATTEMPTS:-2}" # Initialize ginkgo. diff --git a/test/e2e/specs/specs.go b/test/e2e/specs/specs.go index 4dfd76f61..d43ab92cc 100644 --- a/test/e2e/specs/specs.go +++ b/test/e2e/specs/specs.go @@ -89,7 +89,7 @@ const ( pollInterval = 1 * time.Second pollTimeout = 1 * time.Minute pollIntervalSlow = 10 * time.Second - pollTimeoutSlow = 20 * time.Minute + pollTimeoutSlow = 30 * time.Minute ) type TestPod struct { diff --git a/test/e2e/specs/testdriver.go b/test/e2e/specs/testdriver.go index d389a773e..208079263 100644 --- a/test/e2e/specs/testdriver.go +++ b/test/e2e/specs/testdriver.go @@ -47,6 +47,7 @@ type GCSFuseCSITestDriver struct { bucketLocation string skipGcpSaTest bool EnableHierarchicalNamespace bool + EnableGrpc bool } type gcsVolume struct { @@ -62,7 +63,7 @@ type gcsVolume struct { } // InitGCSFuseCSITestDriver returns GCSFuseCSITestDriver that implements TestDriver interface. -func InitGCSFuseCSITestDriver(c clientset.Interface, m metadata.Service, bl string, skipGcpSaTest, enableHierarchicalNamespace bool) storageframework.TestDriver { +func InitGCSFuseCSITestDriver(c clientset.Interface, m metadata.Service, bl string, skipGcpSaTest, enableHierarchicalNamespace, enableGrpc bool) storageframework.TestDriver { ssm, err := storage.NewGCSServiceManager() if err != nil { e2eframework.Failf("Failed to set up storage service manager: %v", err) @@ -87,6 +88,7 @@ func InitGCSFuseCSITestDriver(c clientset.Interface, m metadata.Service, bl stri bucketLocation: bl, skipGcpSaTest: skipGcpSaTest, EnableHierarchicalNamespace: enableHierarchicalNamespace, + EnableGrpc: enableGrpc, } } @@ -194,6 +196,10 @@ func (n *GCSFuseCSITestDriver) CreateVolume(ctx context.Context, config *storage } mountOptions := "logging:severity:info" + if n.EnableGrpc { + mountOptions += ",client-protocol=grpc" + } + switch config.Prefix { case NonRootVolumePrefix: mountOptions += ",uid=1001" diff --git a/test/e2e/testsuites/gcsfuse_integration.go b/test/e2e/testsuites/gcsfuse_integration.go index c2769c78c..1e1bc44fb 100644 --- a/test/e2e/testsuites/gcsfuse_integration.go +++ b/test/e2e/testsuites/gcsfuse_integration.go @@ -65,6 +65,13 @@ func hnsEnabled(driver storageframework.TestDriver) bool { return gcsfuseCSITestDriver.EnableHierarchicalNamespace } +func grpcEnabled(driver storageframework.TestDriver) bool { + gcsfuseCSITestDriver, ok := driver.(*specs.GCSFuseCSITestDriver) + gomega.Expect(ok).To(gomega.BeTrue(), "failed to cast storageframework.TestDriver to *specs.GCSFuseCSITestDriver") + + return gcsfuseCSITestDriver.EnableGrpc +} + type gcsFuseCSIGCSFuseIntegrationTestSuite struct { tsInfo storageframework.TestSuiteInfo } @@ -133,6 +140,11 @@ func (t *gcsFuseCSIGCSFuseIntegrationTestSuite) DefineTests(driver storageframew } } + // GRPC is supported after v2.5.1 + if !v.AtLeast(version.MustParseSemantic("v2.5.1-gke.0")) && grpcEnabled(driver) { + e2eskipper.Skipf("skip gcsfuse integration GRPC tests on gcsfuse version %v", v.String()) + } + // HNS is supported after v2.5.0 if !v.AtLeast(version.MustParseSemantic("v2.5.0-gke.0")) && hnsEnabled(driver) { e2eskipper.Skipf("skip gcsfuse integration HNS tests on gcsfuse version %v", v.String()) diff --git a/test/e2e/testsuites/gcsfuse_integration_file_cache.go b/test/e2e/testsuites/gcsfuse_integration_file_cache.go index d4dd222f8..1b8d3ad65 100644 --- a/test/e2e/testsuites/gcsfuse_integration_file_cache.go +++ b/test/e2e/testsuites/gcsfuse_integration_file_cache.go @@ -99,6 +99,11 @@ func (t *gcsFuseCSIGCSFuseIntegrationFileCacheTestSuite) DefineTests(driver stor e2eskipper.Skipf("skip gcsfuse integration test %v for gcsfuse version %v", testName, v.String()) } + // GRPC is supported after v2.5.1 + if !v.AtLeast(version.MustParseSemantic("v2.5.1-gke.0")) && grpcEnabled(driver) { + e2eskipper.Skipf("skip gcsfuse integration GRPC tests on gcsfuse version %v", v.String()) + } + // HNS is supported after v2.5.0 if !v.AtLeast(version.MustParseSemantic("v2.5.0-gke.0")) && hnsEnabled(driver) { e2eskipper.Skipf("skip gcsfuse integration HNS tests on gcsfuse version %v", v.String()) diff --git a/test/e2e/testsuites/gcsfuse_integration_file_cache_parallel_downloads.go b/test/e2e/testsuites/gcsfuse_integration_file_cache_parallel_downloads.go index ba6d01568..ec000a659 100644 --- a/test/e2e/testsuites/gcsfuse_integration_file_cache_parallel_downloads.go +++ b/test/e2e/testsuites/gcsfuse_integration_file_cache_parallel_downloads.go @@ -99,6 +99,11 @@ func (t *gcsFuseCSIGCSFuseIntegrationFileCacheParallelDownloadsTestSuite) Define e2eskipper.Skipf("skip gcsfuse integration test %v for gcsfuse version %v", testName, v.String()) } + // GRPC is supported after v2.5.1 + if !v.AtLeast(version.MustParseSemantic("v2.5.1-gke.0")) && grpcEnabled(driver) { + e2eskipper.Skipf("skip gcsfuse integration GRPC tests on gcsfuse version %v", v.String()) + } + // HNS is supported after v2.5.0 if !v.AtLeast(version.MustParseSemantic("v2.5.0-gke.0")) && hnsEnabled(driver) { e2eskipper.Skipf("skip gcsfuse integration HNS tests on gcsfuse version %v", v.String())