From 9bd0254b7265f8733ecdc5cd583031cf7ca91035 Mon Sep 17 00:00:00 2001 From: Ivan Okhotnikov Date: Mon, 15 Jun 2026 20:09:08 +0300 Subject: [PATCH] test(e2e): bind bucket.bats S3 client to 127.0.0.1 instead of localhost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `kubectl port-forward service/seaweedfs-s3 -n tenant-root 8333:8333` binds the listener to 127.0.0.1 only — it has no IPv6 listener. The runner's getaddrinfo resolves `localhost` to `::1` first, and `mc` keeps a single connection target across the whole alias, so the initial `mc alias set` (which only sets credentials, no network I/O) silently succeeds while the subsequent `mc cp` upload tries `https://[::1]:8333` and gets immediate `connection refused`. The test then exits with the misleading bucket-test failure even though the S3 backend, credentials, and bucket all reconciled correctly. Use a literal IPv4 address (`127.0.0.1`) for the mc aliases and the `nc -z` readiness probe so the test no longer depends on the runner's IPv4/IPv6 resolution policy. Signed-off-by: Ivan Okhotnikov --- hack/e2e-apps/bucket.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/e2e-apps/bucket.bats b/hack/e2e-apps/bucket.bats index 9fd127ee9..0e70d84b9 100644 --- a/hack/e2e-apps/bucket.bats +++ b/hack/e2e-apps/bucket.bats @@ -45,7 +45,7 @@ EOF timeout 30 sh -ec 'until nc -z localhost 8333; do sleep 1; done' # --- Test readwrite user (admin) --- - mc alias set rw-user https://localhost:8333 $ADMIN_ACCESS_KEY $ADMIN_SECRET_KEY --insecure + mc alias set rw-user https://127.0.0.1:8333 $ADMIN_ACCESS_KEY $ADMIN_SECRET_KEY --insecure # Admin can upload echo "readwrite test" > /tmp/rw-test.txt @@ -58,7 +58,7 @@ EOF mc cp --insecure rw-user/$BUCKET_NAME/rw-test.txt /tmp/rw-test-download.txt # --- Test readonly user (viewer) --- - mc alias set ro-user https://localhost:8333 $VIEWER_ACCESS_KEY $VIEWER_SECRET_KEY --insecure + mc alias set ro-user https://127.0.0.1:8333 $VIEWER_ACCESS_KEY $VIEWER_SECRET_KEY --insecure # Viewer can list mc ls --insecure ro-user/$BUCKET_NAME/rw-test.txt