Skip to content

Commit

Permalink
api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkysow committed Jul 29, 2022
1 parent 6120d26 commit 1759481
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sdk/testutil/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type TestServerConfig struct {
Connect map[string]interface{} `json:"connect,omitempty"`
EnableDebug bool `json:"enable_debug,omitempty"`
SkipLeaveOnInt bool `json:"skip_leave_on_interrupt"`
Peering *TestPeeringConfig `json:"peering,omitempty"`
ReadyTimeout time.Duration `json:"-"`
StopTimeout time.Duration `json:"-"`
Stdout io.Writer `json:"-"`
Expand Down Expand Up @@ -139,6 +140,10 @@ type TestTokens struct {
AgentRecovery string `json:"agent_master,omitempty"`
}

type TestPeeringConfig struct {
Enabled bool `json:"enabled,omitempty"`
}

// ServerConfigCallback is a function interface which can be
// passed to NewTestServerConfig to modify the server config.
type ServerConfigCallback func(c *TestServerConfig)
Expand Down Expand Up @@ -192,8 +197,9 @@ func defaultServerConfig(t TestingTB) *TestServerConfig {
ReturnPorts: func() {
freeport.Return(ports)
},
Stdout: logBuffer,
Stderr: logBuffer,
Stdout: logBuffer,
Stderr: logBuffer,
Peering: &TestPeeringConfig{Enabled: true},
}
}

Expand Down

0 comments on commit 1759481

Please sign in to comment.