test

package
v0.0.0-...-96b8469 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BrainSpec = swarm.ServiceSpec{
	Annotations: swarm.Annotations{
		Name: "rethinkdb",
	},
	TaskTemplate: swarm.TaskSpec{
		ContainerSpec: swarm.ContainerSpec{
			DNSConfig: &swarm.DNSConfig{},
			Image:     GetImage("ramrodpcp/database-brain"),
		},
		RestartPolicy: &swarm.RestartPolicy{
			Condition: "on-failure",
		},
	},
	EndpointSpec: &swarm.EndpointSpec{
		Mode: swarm.ResolutionModeVIP,
		Ports: []swarm.PortConfig{swarm.PortConfig{
			Protocol:      swarm.PortConfigProtocolTCP,
			TargetPort:    28015,
			PublishedPort: 28015,
			PublishMode:   swarm.PortConfigPublishModeIngress,
		}},
	},
}
View Source
var GenericPluginConfig = swarm.ServiceSpec{
	Annotations: swarm.Annotations{
		Name: "Harness-5000tcp",
		Labels: map[string]string{
			"os": "posix",
		},
	},
	TaskTemplate: swarm.TaskSpec{
		ContainerSpec: swarm.ContainerSpec{
			Env: []string{
				"PLUGIN=Harness",
				"PORT=5000",
				"LOGLEVEL=DEBUG",
				"STAGE=DEV",
				"PLUGIN_NAME=Harness-5000tcp",
			},
			Image: "ramrodpcp/interpreter-plugin:" + getTagFromEnv(),
		},
		RestartPolicy: &swarm.RestartPolicy{
			Condition: "on-failure",
		},
	},
	UpdateConfig: &swarm.UpdateConfig{
		Parallelism: 0,
		Delay:       0,
	},
	EndpointSpec: &swarm.EndpointSpec{
		Mode: swarm.ResolutionModeVIP,
		Ports: []swarm.PortConfig{
			swarm.PortConfig{
				Protocol:      swarm.PortConfigProtocolTCP,
				PublishedPort: 5000,
				TargetPort:    5000,
				PublishMode:   swarm.PortConfigPublishModeHost,
			},
		},
	},
}

Functions

func CheckCreateNet

func CheckCreateNet(net string) (string, error)

CheckCreateNet checks to see if the given network is created and creates it if it is not

func DockerCleanUp

func DockerCleanUp(ctx context.Context, dockerClient *client.Client, net string) error

DockerCleanUp removes all services and containers

func GetImage

func GetImage(image string) string

GetImage gets the image name with its tag

func GetServiceID

func GetServiceID(ctx context.Context, dockerClient *client.Client, name string) string

GetServiceID Gets the service ID of a service given the name of the service

func KillService

func KillService(ctx context.Context, dockerClient *client.Client, svcID string)

KillService Kills a docker service

func StartBrain

func StartBrain(ctx context.Context, t *testing.T, dockerClient *client.Client, spec swarm.ServiceSpec) (*r.Session, string, error)

StartBrain starts an instance of the Brain module and returns a connection (*Session) to it

func StartIntegrationTestService

func StartIntegrationTestService(ctx context.Context, dockerClient *client.Client, spec swarm.ServiceSpec) (string, error)

StartIntegrationTestService starts a service for the integration test

Types

This section is empty.

Jump to

Keyboard shortcuts

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