testutils

package
v0.0.0-...-14051cb Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2016 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptancePolicy

func AcceptancePolicy(worker, manager bool, secret string) api.AcceptancePolicy

AcceptancePolicy is a policy that returns a valid Acceptance policy

Types

type TestCA

type TestCA struct {
	RootCA                ca.RootCA
	MemoryStore           *store.MemoryStore
	TempDir, Organization string
	Paths                 *ca.SecurityConfigPaths
	Server                grpc.Server
	CAServer              *ca.Server
	Context               context.Context
	NodeCAClients         []api.NodeCAClient
	CAClients             []api.CAClient
	Conns                 []*grpc.ClientConn
	Picker                *picker.Picker
}

TestCA is a structure that encapsulates everything needed to test a CA Server

func NewTestCA

func NewTestCA(t *testing.T, policy api.AcceptancePolicy) *TestCA

NewTestCA is a helper method that creates a TestCA and a bunch of default connections and security configs

func (*TestCA) NewNodeConfig

func (tc *TestCA) NewNodeConfig(role string) (*ca.SecurityConfig, error)

NewNodeConfig returns security config for a new node, given a role

func (*TestCA) NewNodeConfigOrg

func (tc *TestCA) NewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)

NewNodeConfigOrg returns security config for a new node, given a role and an org

func (*TestCA) Stop

func (tc *TestCA) Stop()

Stop cleansup after TestCA

func (*TestCA) WriteNewNodeConfig

func (tc *TestCA) WriteNewNodeConfig(role string) (*ca.SecurityConfig, error)

WriteNewNodeConfig returns security config for a new node, given a role saving the generated key and certificates to disk

func (*TestCA) WriteNewNodeConfigOrg

func (tc *TestCA) WriteNewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)

WriteNewNodeConfigOrg returns security config for a new node, given a role and an org saving the generated key and certificates to disk

Jump to

Keyboard shortcuts

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