Advertise a non-loopback ip in tests

This commit is contained in:
Michael Schurter
2016-11-14 14:42:59 -08:00
parent a2db91fc45
commit 0c5bfec2c7

View File

@@ -36,6 +36,7 @@ type TestServerConfig struct {
Region string `json:"region,omitempty"`
DisableCheckpoint bool `json:"disable_update_check"`
LogLevel string `json:"log_level,omitempty"`
AdvertiseAddrs *Advertise `json:"advertise,omitempty"`
Ports *PortsConfig `json:"ports,omitempty"`
Server *ServerConfig `json:"server,omitempty"`
Client *ClientConfig `json:"client,omitempty"`
@@ -44,6 +45,13 @@ type TestServerConfig struct {
Stdout, Stderr io.Writer `json:"-"`
}
// Advertise is used to configure the addresses to advertise
type Advertise struct {
HTTP string `json:"http,omitempty"`
RPC string `json:"rpc,omitempty"`
Serf string `json:"serf,omitempty"`
}
// PortsConfig is used to configure the network ports we use.
type PortsConfig struct {
HTTP int `json:"http,omitempty"`
@@ -80,6 +88,12 @@ func defaultServerConfig() *TestServerConfig {
NodeName: fmt.Sprintf("node%d", idx),
DisableCheckpoint: true,
LogLevel: "DEBUG",
// Advertise can't be localhost
AdvertiseAddrs: &Advertise{
HTTP: "169.254.42.42",
RPC: "169.254.42.42",
Serf: "169.254.42.42",
},
Ports: &PortsConfig{
HTTP: 20000 + idx,
RPC: 21000 + idx,