Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentRestart

func AgentRestart(client *api.Client, nodeID string) (string, error)

AgentRestart is a test helper function that restarts a client node running under systemd using a raw_exec job. Returns the job ID of the restart job so that callers can clean it up.

func AllocIDsFromAllocationListStubs

func AllocIDsFromAllocationListStubs(allocs []*api.AllocationListStub) []string

func DeploymentsForJob

func DeploymentsForJob(t *testing.T, nomadClient *api.Client, jobID string) []*api.Deployment

func ListLinuxClientNodes

func ListLinuxClientNodes(client *api.Client) ([]string, error)

ListLinuxClientNodes returns a list of Linux client IDs, so that tests can skip operating-specific tests if there are no Linux clients available Returns an error only on client errors.

func ListWindowsClientNodes

func ListWindowsClientNodes(client *api.Client) ([]string, error)

ListWindowsClientNodes returns a list of Windows client IDs, so that tests can skip operating-specific tests if there are no Windows clients available. Returns an error only on client errors.

func RegisterAllocs

func RegisterAllocs(t *testing.T, nomadClient *api.Client, jobFile, jobID, cToken string) []*api.AllocationListStub

func RegisterAndWaitForAllocs

func RegisterAndWaitForAllocs(t *testing.T, nomadClient *api.Client, jobFile, jobID, cToken string) []*api.AllocationListStub

func RequireConsulDeregistered

func RequireConsulDeregistered(require *require.Assertions,
	client *capi.Client, serviceName string)

RequireConsulDeregistered asserts that the service eventually is deregistered from Consul

func RequireConsulStatus

func RequireConsulStatus(require *require.Assertions,
	client *capi.Client, serviceName, expectedStatus string)

RequireConsulStatus asserts the aggregate health of the service converges to the expected status

func WaitForAllocNotPending

func WaitForAllocNotPending(t *testing.T, nomadClient *api.Client, allocID string)

func WaitForAllocRunning

func WaitForAllocRunning(t *testing.T, nomadClient *api.Client, allocID string)

func WaitForAllocStopped

func WaitForAllocStopped(t *testing.T, nomadClient *api.Client, allocID string)

func WaitForAllocsNotPending

func WaitForAllocsNotPending(t *testing.T, nomadClient *api.Client, allocIDs []string)

func WaitForAllocsRunning

func WaitForAllocsRunning(t *testing.T, nomadClient *api.Client, allocIDs []string)

func WaitForDeployment

func WaitForDeployment(t *testing.T, nomadClient *api.Client, deployID string, status string, statusDesc string)

func WaitForLeader

func WaitForLeader(t *testing.T, nomadClient *api.Client)

func WaitForNodesReady

func WaitForNodesReady(t *testing.T, nomadClient *api.Client, nodes int)

WaitForNodesReady waits until at least `nodes` number of nodes are ready or fails the test.

Types

This section is empty.