fixture

package
v0.0.0-...-3a937ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUnitBody

func CheckUnitBody(path, source string, env map[string]interface{}) (err error)

CheckUnitBody compares file contents with template

func CheckUnitHashes

func CheckUnitHashes(names []string, states map[string]uint64) (err error)

func CreateUnit

func CreateUnit(path, source string, env map[string]interface{}) (err error)

CreateUnit creates unit with given body template

func DestroyUnits

func DestroyUnits(patterns ...string) (err error)

DestroyUnits disables and destroys units with given patterns

func GetLocalIP

func GetLocalIP(t *testing.T) string

func RandomPort

func RandomPort(t *testing.T) int

func RandomPorts

func RandomPorts(t *testing.T, count int) (res []int)

func TestName

func TestName(t *testing.T) (res string)

func UnitStatesFn

func UnitStatesFn(patterns []string, expect map[string]string) func() error

UnitStatesFn returns function to check all states for units founded by patterns. Expect should be "unit.service":"systemd-state"

func WaitNoError

func WaitNoError(config WaitConfig, fn func() error) (err error)

func WaitNoError10

func WaitNoError10(fn func() error) (err error)

func WaitNoErrorT

func WaitNoErrorT(t *testing.T, config WaitConfig, fn func() error)

Poll while provided fn return no error

func WaitNoErrorT10

func WaitNoErrorT10(t *testing.T, fn func() error)

func WriteTemplate

func WriteTemplate(w io.Writer, source string, env map[string]interface{}) (err error)

Types

type ConsulServer

type ConsulServer struct {
	Config *ConsulServerConfig
	// contains filtered or unexported fields
}

func NewConsulServer

func NewConsulServer(t *testing.T, configFn func(config *ConsulServerConfig)) (s *ConsulServer)

func (*ConsulServer) Address

func (s *ConsulServer) Address() (res string)

func (*ConsulServer) Clean

func (s *ConsulServer) Clean()

func (*ConsulServer) Down

func (s *ConsulServer) Down()

func (*ConsulServer) Pause

func (s *ConsulServer) Pause()

func (*ConsulServer) Unpause

func (s *ConsulServer) Unpause()

func (*ConsulServer) Up

func (s *ConsulServer) Up()

func (*ConsulServer) WaitAlive

func (s *ConsulServer) WaitAlive()

func (*ConsulServer) WaitLeader

func (s *ConsulServer) WaitLeader()

type ConsulServerConfig

type ConsulServerConfig struct {
	RepoTag       string `json:"-"`
	NodeName      string `json:"node_name"`
	NodeID        string `json:"node_id"`
	AdvertiseAddr string `json:"advertise_addr"`
	ClientAddr    string `json:"client_addr"`
	Bootstrap     bool   `json:"bootstrap"`
	Server        bool   `json:"server"`
	UI            bool   `json:"ui"`
	Performance   struct {
		RaftMultiplier int `json:"raft_multiplier"`
	} `json:"performance"`
	SessionTTLMin string `json:"session_ttl_min"`
	Ports         struct {
		HTTP int
	}
}

type WaitConfig

type WaitConfig struct {
	Retry   time.Duration
	Retries int
}

func DefaultWaitConfig

func DefaultWaitConfig() (c WaitConfig)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL