mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Add extensive endpoints validation (#4019)
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
@@ -35,12 +34,12 @@ func TestMakeS3Peers(t *testing.T) {
|
||||
// test cases
|
||||
testCases := []struct {
|
||||
gMinioAddr string
|
||||
eps []*url.URL
|
||||
eps EndpointList
|
||||
peers []string
|
||||
}{
|
||||
{":9000", []*url.URL{{Path: "/mnt/disk1"}}, []string{":9000"}},
|
||||
{":9000", []*url.URL{{Host: "localhost:9001"}}, []string{":9000", "localhost:9001"}},
|
||||
{"m1:9000", []*url.URL{{Host: "m1:9000"}, {Host: "m2:9000"}, {Host: "m3:9000"}}, []string{"m1:9000", "m2:9000", "m3:9000"}},
|
||||
{"127.0.0.1:9000", mustGetNewEndpointList("/mnt/disk1"), []string{"127.0.0.1:9000"}},
|
||||
{"127.0.0.1:9000", mustGetNewEndpointList("http://localhost:9001/d1"), []string{"127.0.0.1:9000", "localhost:9001"}},
|
||||
{"example.org:9000", mustGetNewEndpointList("http://example.org:9000/d1", "http://example.com:9000/d1", "http://example.net:9000/d1", "http://example.edu:9000/d1"), []string{"example.org:9000", "example.com:9000", "example.edu:9000", "example.net:9000"}},
|
||||
}
|
||||
|
||||
getPeersHelper := func(s3p s3Peers) []string {
|
||||
|
||||
Reference in New Issue
Block a user