mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
Close the current protocol-readiness plan and move active work to V2 parity and hardening. The release gate now covers iSCSI ALUA/failover, NVMe ANA/multipath/failover, CSI protocol selection, and the iSCSI compatibility soak. Test layering is documented so default Go tests stay unit/component scoped, local subprocess tests are opt-in, and Linux lab coverage remains in runner-native TestOps suites.
32 lines
925 B
Go
32 lines
925 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestNVMeControllerIDFromReplicaID_DenseReplicaSuffixes(t *testing.T) {
|
|
tests := map[string]uint16{
|
|
"r1": 1,
|
|
"r2": 2,
|
|
"replica3": 3,
|
|
"r0": 1,
|
|
"r65519": uint16(maxNVMeControllerID),
|
|
"r65520": uint16(maxNVMeControllerID),
|
|
"r999999999999": uint16(maxNVMeControllerID),
|
|
}
|
|
for replicaID, want := range tests {
|
|
if got := nvmeControllerIDFromReplicaID(replicaID); got != want {
|
|
t.Fatalf("nvmeControllerIDFromReplicaID(%q)=%d want %d", replicaID, got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestNVMeControllerIDFromReplicaID_HashFallbackIsStableAndNonReserved(t *testing.T) {
|
|
a := nvmeControllerIDFromReplicaID("east-primary")
|
|
b := nvmeControllerIDFromReplicaID("east-primary")
|
|
if a != b {
|
|
t.Fatalf("hash fallback unstable: %d vs %d", a, b)
|
|
}
|
|
if a == 0 || a == 0xffff {
|
|
t.Fatalf("hash fallback returned reserved CNTLID %d", a)
|
|
}
|
|
}
|