From db3b08b612d420043d4b190f18126c4eea0db0b3 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Mon, 20 Jul 2026 10:37:37 +0800 Subject: [PATCH] fix(e2e): use non-default credentials in cluster test constructor (#5039) Commit aec2ee9ec (#5005) enforced that RPC secrets cannot be derived from the public default credentials. This broke all multi-node cluster E2E tests that relied on the constructor's DEFAULT_ACCESS_KEY / DEFAULT_SECRET_KEY defaults. Move the non-default credential and RUSTFS_RPC_SECRET blanking into the RustFSTestClusterEnvironment constructor so every cluster test starts with a valid RPC secret derivation base. Remove the per-test overrides in cluster_multidrive_pool_test that were added as a partial fix in #5005. --- crates/e2e_test/src/cluster_multidrive_pool_test.rs | 6 ------ crates/e2e_test/src/common.rs | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/e2e_test/src/cluster_multidrive_pool_test.rs b/crates/e2e_test/src/cluster_multidrive_pool_test.rs index dbdc11c44..3f9193984 100644 --- a/crates/e2e_test/src/cluster_multidrive_pool_test.rs +++ b/crates/e2e_test/src/cluster_multidrive_pool_test.rs @@ -87,12 +87,6 @@ async fn cluster_two_pool_smoke() -> TestResult { let mut cluster = RustFSTestClusterEnvironment::with_topology(ClusterTopology::per_node_pools(2, vec![vec![0], vec![1]])).await?; - cluster.access_key = "custom-two-pool-access".to_string(); - cluster.secret_key = "custom-two-pool-secret".to_string(); - // Override any inherited test-runner value with an explicit blank. The - // credentials getter treats blank as absent and must derive one stable RPC - // secret from the shared non-default credential pair on every node. - cluster.set_env("RUSTFS_RPC_SECRET", ""); // The two-pool layout must emit one ellipses argument per pool. let volumes = cluster.rustfs_volumes_arg(); diff --git a/crates/e2e_test/src/common.rs b/crates/e2e_test/src/common.rs index c602227b1..b95af36c3 100644 --- a/crates/e2e_test/src/common.rs +++ b/crates/e2e_test/src/common.rs @@ -979,6 +979,7 @@ impl RustFSTestClusterEnvironment { } let mut extra_env = Vec::new(); + extra_env.push(("RUSTFS_RPC_SECRET".to_string(), String::new())); if multidrive { extra_env.push(("RUSTFS_UNSAFE_BYPASS_DISK_CHECK".to_string(), "true".to_string())); } @@ -986,8 +987,8 @@ impl RustFSTestClusterEnvironment { Ok(Self { nodes, temp_dir, - access_key: DEFAULT_ACCESS_KEY.to_string(), - secret_key: DEFAULT_SECRET_KEY.to_string(), + access_key: "rustfs-cluster-test-access".to_string(), + secret_key: "rustfs-cluster-test-secret".to_string(), extra_env, topology, })