bddtests

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomID

func GenerateRandomID() string

GenerateRandomID generates random ID

func GetByteArgs added in v0.1.2

func GetByteArgs(argsArray []string) [][]byte

GetByteArgs is a utility which converts []string to [][]bytes

func GetChannelAnchorTxPath

func GetChannelAnchorTxPath(channelID, orgName string) string

GetChannelAnchorTxPath returns path to the channel anchor tx file for the given channel

func GetChannelTxPath

func GetChannelTxPath(channelID string) string

GetChannelTxPath returns path to the channel tx file for the given channel

func HasPrimaryPeerJoinedChannel

func HasPrimaryPeerJoinedChannel(client api.FabricClient, orgUser api.User, channel api.Channel) (bool, error)

HasPrimaryPeerJoinedChannel checks whether the primary peer of a channel has already joined the channel. It returns true if it has, false otherwise, or an error

func IsChaincodeInstalled

func IsChaincodeInstalled(client api.FabricClient, peer api.Peer, name string) (bool, error)

IsChaincodeInstalled Helper function to check if chaincode has been deployed

Types

type BDDContext

type BDDContext struct {
	Client       sdkApi.FabricClient
	Channel      sdkApi.Channel
	Org1Admin    sdkApi.User
	OrdererAdmin sdkApi.User
	Org1User     sdkApi.User
	Composition  *Composition
	Sdk          *sdkFabApi.FabricSDK
}

BDDContext ...

func NewBDDContext

func NewBDDContext() (*BDDContext, error)

NewBDDContext create new BDDContext

type CommonSteps

type CommonSteps struct {
	BDDContext *BDDContext
}

CommonSteps contain BDDContext

func NewCommonSteps

func NewCommonSteps(context *BDDContext) *CommonSteps

NewCommonSteps create new CommonSteps struct

func (*CommonSteps) RegisterTxEvent added in v0.1.2

func (d *CommonSteps) RegisterTxEvent(txID apitxn.TransactionID, eventHub sdkApi.EventHub) (chan bool, chan error)

RegisterTxEvent registers on the given eventhub for the give transaction returns a boolean channel which receives true when the event is complete and an error channel for errors

type Composition

type Composition struct {
	// contains filtered or unexported fields
}

Composition represents a docker-compose execution and management

func NewComposition

func NewComposition(projectName string, composeFilesYaml string, dir string) (composition *Composition, err error)

NewComposition create a new Composition specifying the project name (for isolation) and the compose files.

func (*Composition) Decompose

func (c *Composition) Decompose(dir string) (output string, err error)

Decompose decompose the composition. Will also remove any containers with the same projectName prefix (eg. chaincode containers)

func (*Composition) GenerateLogs

func (c *Composition) GenerateLogs(dir string) error

GenerateLogs to file

func (*Composition) GetAPIContainerForComposeService

func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)

GetAPIContainerForComposeService return the docker.APIContainers with the supplied composeService name.

func (*Composition) GetContainerIDs

func (c *Composition) GetContainerIDs(dir string) (containerIDs []string, err error)

GetContainerIDs returns the container IDs for the composition (NOTE: does NOT include those defined outside composition, eg. chaincode containers)

func (*Composition) GetIPAddressForComposeService

func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)

GetIPAddressForComposeService returns the IPAddress of the container with the supplied composeService name.

type DockerHelper

type DockerHelper interface {
	GetIPAddress(containerID string) (string, error)
	RemoveContainersWithNamePrefix(namePrefix string) error
}

DockerHelper helper for docker specific functions

func NewDockerCmdlineHelper

func NewDockerCmdlineHelper() (DockerHelper, error)

NewDockerCmdlineHelper returns a new command line DockerHelper instance

type EventSnapSteps added in v0.1.2

type EventSnapSteps struct {
	BDDContext *BDDContext
}

EventSnapSteps ...

func NewEventSnapSteps added in v0.1.2

func NewEventSnapSteps(context *BDDContext) *EventSnapSteps

NewEventSnapSteps ...

type SnapTransactionRequest

type SnapTransactionRequest struct {
	ChannelID           string            // required channel ID
	ChaincodeID         string            // required chaincode ID
	TransientMap        map[string][]byte // optional transient Map
	EndorserArgs        [][]byte          // optional args for endorsement
	CCIDsForEndorsement []string          // optional ccIDs For endorsement selection
	RegisterTxEvent     bool              // optional args for register Tx event (default is false)
}

SnapTransactionRequest type will be passed as argument to a transaction snap ChannelID and ChaincodeID are mandatory fields

type TxnSnapSteps

type TxnSnapSteps struct {
	BDDContext *BDDContext
}

TxnSnapSteps ...

func NewTxnSnapSteps

func NewTxnSnapSteps(context *BDDContext) *TxnSnapSteps

NewTxnSnapSteps ...

Jump to

Keyboard shortcuts

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