From 05ebed50c24393ecb4b66c7a2df41c7945fb87a6 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 24 Nov 2026 13:49:22 -0800 Subject: [PATCH] test: keep the status endpoint on loopback when the harness listens off loopback blockvolume refuses a non-loopback status bind; sw-block ops reach it with --status-addr from the same host, so it uses headSzLoopbackAddr like the NVMe listener. Co-Authored-By: Claude Opus 5.5 --- .../cmd/blockvolume/head_size_integration_test.go | 9 +++++---- .../known_zero_acceptance_integration_test.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/head_size_integration_test.go b/seaweed-block/cmd/blockvolume/head_size_integration_test.go index bd1328fb71..f1c2a99108 100644 --- a/seaweed-block/cmd/blockvolume/head_size_integration_test.go +++ b/seaweed-block/cmd/blockvolume/head_size_integration_test.go @@ -218,7 +218,7 @@ func headSzStartCluster(t *testing.T, prefix string, vols []headSzVol) (*handoff server, replica = v.server, "r1" } b := bvHost{id: v.id, server: server, replica: replica, volume: v.id, root: filepath.Join(h.dir, "vol-"+v.id), - data: handoffAddress(t), ctrl: handoffAddress(t), status: handoffAddress(t), nvme: headSzLoopbackAddr(t)} + data: handoffAddress(t), ctrl: handoffAddress(t), status: headSzLoopbackAddr(t), nvme: headSzLoopbackAddr(t)} if v.host != "" { b.data, b.ctrl = headSzRemoteAddr(t, v.host), headSzRemoteAddr(t, v.host) } @@ -246,9 +246,10 @@ func headSzStartCluster(t *testing.T, prefix string, vols []headSzVol) (*handoff } // headSzLoopbackAddr picks a free 127.0.0.1 port from the harness's range: -// blockvolume's NVMe/TCP target refuses any non-loopback bind, and the test -// (user-space client or kernel nvme connect) always runs on the same host as -// that blockvolume, also when SWBLOCK_TEST_LISTEN_HOST names a host address. +// blockvolume's NVMe/TCP target and status endpoint refuse any non-loopback +// bind, and the test (user-space client, kernel nvme connect, sw-block ops +// --status-addr) always reaches them from the same host as that blockvolume, +// also when SWBLOCK_TEST_LISTEN_HOST names a host address. func headSzLoopbackAddr(t *testing.T) string { t.Helper() handoffPorts.Lock() diff --git a/seaweed-block/cmd/blockvolume/known_zero_acceptance_integration_test.go b/seaweed-block/cmd/blockvolume/known_zero_acceptance_integration_test.go index adbf21c21b..45b90c016d 100644 --- a/seaweed-block/cmd/blockvolume/known_zero_acceptance_integration_test.go +++ b/seaweed-block/cmd/blockvolume/known_zero_acceptance_integration_test.go @@ -244,7 +244,7 @@ func kzTargetRole(t *testing.T, rep *kzReport, bytes uint64, device bool, run st rep.ChunkPath = ho.ChunkPath for _, ht := range ho.Targets { tb := bvHost{id: ht.Volume, server: ht.Server, replica: "r1", volume: ht.Volume, root: filepath.Join(h.dir, "vol-"+ht.Volume), - data: ht.Data, ctrl: ht.Ctrl, status: handoffAddress(t), nvme: headSzLoopbackAddr(t)} + data: ht.Data, ctrl: ht.Ctrl, status: headSzLoopbackAddr(t), nvme: headSzLoopbackAddr(t)} env.hosts[ht.Volume] = tb src := kzVolume{Volume: ht.Source, S1Name: ht.S1, Dirty1: ht.Dirty1, Files: ht.Files, Blocks: map[uint64][]byte{}} for k, v := range ht.Blocks {