mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: update to use IANA-assigned ports
This commit is contained in:
@@ -93,23 +93,23 @@ func TestSetBindAddrFromAddr(t *testing.T) {
|
||||
},
|
||||
// addr flag set
|
||||
{
|
||||
args: []string{"-addr=192.0.3.17:4001"},
|
||||
waddr: &IPAddressPort{IP: "::", Port: 4001},
|
||||
args: []string{"-addr=192.0.3.17:2379"},
|
||||
waddr: &IPAddressPort{IP: "::", Port: 2379},
|
||||
},
|
||||
// bindAddr flag set
|
||||
{
|
||||
args: []string{"-bind-addr=127.0.0.1:4001"},
|
||||
waddr: &IPAddressPort{IP: "127.0.0.1", Port: 4001},
|
||||
args: []string{"-bind-addr=127.0.0.1:2379"},
|
||||
waddr: &IPAddressPort{IP: "127.0.0.1", Port: 2379},
|
||||
},
|
||||
// both addr flags set
|
||||
{
|
||||
args: []string{"-bind-addr=127.0.0.1:4001", "-addr=192.0.3.17:4001"},
|
||||
waddr: &IPAddressPort{IP: "127.0.0.1", Port: 4001},
|
||||
args: []string{"-bind-addr=127.0.0.1:2379", "-addr=192.0.3.17:2379"},
|
||||
waddr: &IPAddressPort{IP: "127.0.0.1", Port: 2379},
|
||||
},
|
||||
// both addr flags set, IPv6
|
||||
{
|
||||
args: []string{"-bind-addr=[2001:db8::4:9]:4001", "-addr=[2001:db8::4:f0]:4001"},
|
||||
waddr: &IPAddressPort{IP: "2001:db8::4:9", Port: 4001},
|
||||
args: []string{"-bind-addr=[2001:db8::4:9]:2379", "-addr=[2001:db8::4:f0]:2379"},
|
||||
waddr: &IPAddressPort{IP: "2001:db8::4:9", Port: 2379},
|
||||
},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestIPAddressPortSet(t *testing.T) {
|
||||
|
||||
fail := []string{
|
||||
// bad IP specification
|
||||
":4001",
|
||||
":2379",
|
||||
"127.0:8080",
|
||||
"123:456",
|
||||
// bad port specification
|
||||
@@ -62,8 +62,8 @@ func TestIPAddressPortSet(t *testing.T) {
|
||||
|
||||
func TestIPAddressPortString(t *testing.T) {
|
||||
addresses := []string{
|
||||
"[2001:db8::1:1234]:4001",
|
||||
"127.0.0.1:4001",
|
||||
"[2001:db8::1:1234]:2379",
|
||||
"127.0.0.1:2379",
|
||||
}
|
||||
for i, tt := range addresses {
|
||||
f := &IPAddressPort{}
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
type URLsValue types.URLs
|
||||
|
||||
// Set parses a command line set of URLs formatted like:
|
||||
// http://127.0.0.1:7001,http://10.1.1.2:80
|
||||
// http://127.0.0.1:2380,http://10.1.1.2:80
|
||||
func (us *URLsValue) Set(s string) error {
|
||||
strs := strings.Split(s, ",")
|
||||
nus, err := types.NewURLs(strs)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
func TestValidateURLsValueBad(t *testing.T) {
|
||||
tests := []string{
|
||||
// bad IP specification
|
||||
":4001",
|
||||
":2379",
|
||||
"127.0:8080",
|
||||
"123:456",
|
||||
// bad port specification
|
||||
|
||||
Reference in New Issue
Block a user