Documentation ¶
Index ¶
- Variables
- func FindPKCS11Lib(configuredLib string) string
- func GenerateRandomID() string
- func GetByteArgs(argsArray []string) [][]byte
- func GetChannelAnchorTxPath(channelID, orgName string) string
- func GetChannelTxPath(channelID string) string
- func HasPrimaryPeerJoinedChannel(channelID string, client *resmgmt.Client, orgUser mspApi.Identity, ...) (bool, error)
- func IsChaincodeInstalled(client *resmgmt.Client, peer fabApi.Peer, name string) (bool, error)
- func NewCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64, ...) *common.CollectionConfig
- type BDDContext
- func (b *BDDContext) AddPeerConfigToChannel(pconfig *PeerConfig, channelID string)
- func (b *BDDContext) AfterScenario(interface{}, error)
- func (b *BDDContext) BeforeScenario(scenarioOrScenarioOutline interface{})
- func (b *BDDContext) ChannelCreated(channelID string) bool
- func (b *BDDContext) ClientConfig() fabApi.EndpointConfig
- func (b *BDDContext) CollectionConfig(coll string) *CollectionConfig
- func (b *BDDContext) DefineCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32, ...) *CollectionConfig
- func (b *BDDContext) OrdererOrgID() string
- func (b *BDDContext) OrgChannelClient(org, userType, channelID string) (*channel.Client, error)
- func (b *BDDContext) OrgIDForChannel(channelID string) (string, error)
- func (b *BDDContext) OrgUserContext(org, userType string) contextApi.Client
- func (b *BDDContext) Orgs() []string
- func (b *BDDContext) OrgsByChannel(channelID string) []string
- func (b *BDDContext) PeerConfigForChannel(channelID string) *PeerConfig
- func (b *BDDContext) PeerConfigForChannelAndMsp(channelID string, mspID string) *PeerConfig
- func (b *BDDContext) PeerConfigForURL(url string) *PeerConfig
- func (b *BDDContext) PeersByChannel(channelID string) []*PeerConfig
- func (b *BDDContext) ResMgmtClient(org, userType string) *resmgmt.Client
- func (b *BDDContext) Sdk() *fabsdk.FabricSDK
- func (b *BDDContext) SetServiceProviderFactory(factory sdkApi.ServiceProviderFactory)
- type CollectionConfig
- type CommonSteps
- func (d *CommonSteps) InvokeCCWithArgs(ccID, channelID string, targets []*PeerConfig, args []string, ...) (channel.Response, error)
- func (d *CommonSteps) InvokeCCWithArgsAsAdmin(ccID, channelID string, targets []*PeerConfig, args []string, ...) (channel.Response, error)
- func (d *CommonSteps) InvokeCConOrg(ccID, args, orgIDs, channelID string) error
- func (d *CommonSteps) OrgPeers(orgIDs, channelID string) []*PeerConfig
- func (d *CommonSteps) QueryCCWithArgs(systemCC bool, ccID, channelID string, args []string, ...) (string, error)
- func (d *CommonSteps) QueryCCWithOpts(systemCC bool, ccID, channelID string, args []string, timeout time.Duration, ...) (string, error)
- func (d *CommonSteps) RegisterSteps(s *godog.Suite)
- type Composition
- func (c *Composition) Decompose(dir string) (output string, err error)
- func (c *Composition) GenerateLogs(dir string) error
- func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)
- func (c *Composition) GetContainerIDs(dir string) (containerIDs []string, err error)
- func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)
- type ConfigCLI
- type ConfigCLISteps
- type ConfigurationsSnapSteps
- type CustomEndorsementHandler
- type DockerHelper
- type EventSnapSteps
- type FabCLI
- type PeerConfig
- type StaticSelectionProviderFactory
- type UnsafeQuerySteps
Constants ¶
This section is empty.
Variables ¶
var ADMIN = "admin"
ADMIN type
var USER = "user"
USER type
Functions ¶
func FindPKCS11Lib ¶ added in v0.1.9
FindPKCS11Lib find lib based on configuration
func GetByteArgs ¶ added in v0.1.2
GetByteArgs is a utility which converts []string to [][]bytes
func GetChannelAnchorTxPath ¶
GetChannelAnchorTxPath returns path to the channel anchor tx file for the given channel
func GetChannelTxPath ¶
GetChannelTxPath returns path to the channel tx file for the given channel
func HasPrimaryPeerJoinedChannel ¶
func HasPrimaryPeerJoinedChannel(channelID string, client *resmgmt.Client, orgUser mspApi.Identity, peer fabApi.Peer) (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 ¶
IsChaincodeInstalled Helper function to check if chaincode has been deployed
func NewCollectionConfig ¶ added in v0.1.9
func NewCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64, policy *common.SignaturePolicyEnvelope) *common.CollectionConfig
NewCollectionConfig return CollectionConfig
Types ¶
type BDDContext ¶
type BDDContext struct {
// contains filtered or unexported fields
}
BDDContext ...
func NewBDDContext ¶
func NewBDDContext(orgs []string, ordererOrgID string, clientConfigFilePath string, clientConfigFileName string, snapsConfigFilePath string, peersMspID map[string]string, testCCPath string, cliPath string) (*BDDContext, error)
NewBDDContext create new BDDContext
func (*BDDContext) AddPeerConfigToChannel ¶ added in v0.1.9
func (b *BDDContext) AddPeerConfigToChannel(pconfig *PeerConfig, channelID string)
AddPeerConfigToChannel adds a peer to a channel
func (*BDDContext) AfterScenario ¶ added in v0.1.9
func (b *BDDContext) AfterScenario(interface{}, error)
AfterScenario execute code after bdd scenario
func (*BDDContext) BeforeScenario ¶ added in v0.1.9
func (b *BDDContext) BeforeScenario(scenarioOrScenarioOutline interface{})
BeforeScenario execute code before bdd scenario
func (*BDDContext) ChannelCreated ¶ added in v0.1.11
func (b *BDDContext) ChannelCreated(channelID string) bool
ChannelCreated returns true if channel already created
func (*BDDContext) ClientConfig ¶ added in v0.1.9
func (b *BDDContext) ClientConfig() fabApi.EndpointConfig
ClientConfig returns client config
func (*BDDContext) CollectionConfig ¶ added in v0.1.9
func (b *BDDContext) CollectionConfig(coll string) *CollectionConfig
CollectionConfig returns the private data collection configuration for the given collection name. If the collection configuration does not exist then nil is returned.
func (*BDDContext) DefineCollectionConfig ¶ added in v0.1.9
func (b *BDDContext) DefineCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64) *CollectionConfig
DefineCollectionConfig defines a new private data collection configuration
func (*BDDContext) OrdererOrgID ¶ added in v0.1.10
func (b *BDDContext) OrdererOrgID() string
OrdererOrgID returns orderer org id
func (*BDDContext) OrgChannelClient ¶ added in v0.1.11
func (b *BDDContext) OrgChannelClient(org, userType, channelID string) (*channel.Client, error)
OrgChannelClient returns the org channel client
func (*BDDContext) OrgIDForChannel ¶ added in v0.1.10
func (b *BDDContext) OrgIDForChannel(channelID string) (string, error)
OrgIDForChannel returns a single org ID for the given channel or an error if no orgs are configured for the channel
func (*BDDContext) OrgUserContext ¶ added in v0.1.11
func (b *BDDContext) OrgUserContext(org, userType string) contextApi.Client
OrgUserContext returns the org user context
func (*BDDContext) Orgs ¶ added in v0.1.9
func (b *BDDContext) Orgs() []string
Orgs returns the orgs
func (*BDDContext) OrgsByChannel ¶ added in v0.1.9
func (b *BDDContext) OrgsByChannel(channelID string) []string
OrgsByChannel returns the orgs for the given channel
func (*BDDContext) PeerConfigForChannel ¶ added in v0.1.10
func (b *BDDContext) PeerConfigForChannel(channelID string) *PeerConfig
PeerConfigForChannel returns a single peer for the given channel or nil if no peers are configured for the channel
func (*BDDContext) PeerConfigForChannelAndMsp ¶ added in v0.2.0
func (b *BDDContext) PeerConfigForChannelAndMsp(channelID string, mspID string) *PeerConfig
PeerConfigForChannelAndMsp returns a single peer for the given channel and msp or nil if no peers are configured for the channel and msp
func (*BDDContext) PeerConfigForURL ¶ added in v0.2.0
func (b *BDDContext) PeerConfigForURL(url string) *PeerConfig
PeerConfigForURL returns the peer config for the given URL or nil if not found
func (*BDDContext) PeersByChannel ¶ added in v0.1.9
func (b *BDDContext) PeersByChannel(channelID string) []*PeerConfig
PeersByChannel returns the peers for the given channel
func (*BDDContext) ResMgmtClient ¶ added in v0.1.11
func (b *BDDContext) ResMgmtClient(org, userType string) *resmgmt.Client
ResMgmtClient returns the res mgmt client
func (*BDDContext) SetServiceProviderFactory ¶ added in v0.2.0
func (b *BDDContext) SetServiceProviderFactory(factory sdkApi.ServiceProviderFactory)
SetServiceProviderFactory sets the service provider factory for the test
type CollectionConfig ¶ added in v0.1.9
type CollectionConfig struct { Name string Policy string RequiredPeerCount int32 MaxPeerCount int32 BlocksToLive uint64 }
CollectionConfig contains the private data collection config
type CommonSteps ¶
type CommonSteps struct {
BDDContext *BDDContext
}
CommonSteps contain BDDContext
func NewCommonSteps ¶
func NewCommonSteps(context *BDDContext) *CommonSteps
NewCommonSteps create new CommonSteps struct
func (*CommonSteps) InvokeCCWithArgs ¶ added in v0.1.9
func (d *CommonSteps) InvokeCCWithArgs(ccID, channelID string, targets []*PeerConfig, args []string, transientData map[string][]byte) (channel.Response, error)
InvokeCCWithArgs invoke cc with args as regular user
func (*CommonSteps) InvokeCCWithArgsAsAdmin ¶ added in v0.2.5
func (d *CommonSteps) InvokeCCWithArgsAsAdmin(ccID, channelID string, targets []*PeerConfig, args []string, transientData map[string][]byte) (channel.Response, error)
InvokeCCWithArgsAsAdmin invoke cc with args as admin user type
func (*CommonSteps) InvokeCConOrg ¶ added in v0.1.9
func (d *CommonSteps) InvokeCConOrg(ccID, args, orgIDs, channelID string) error
InvokeCConOrg invoke cc on org
func (*CommonSteps) OrgPeers ¶ added in v0.1.9
func (d *CommonSteps) OrgPeers(orgIDs, channelID string) []*PeerConfig
OrgPeers return array of PeerConfig
func (*CommonSteps) QueryCCWithArgs ¶ added in v0.1.9
func (d *CommonSteps) QueryCCWithArgs(systemCC bool, ccID, channelID string, args []string, transientData map[string][]byte, targets ...*PeerConfig) (string, error)
QueryCCWithArgs ...
func (*CommonSteps) QueryCCWithOpts ¶ added in v0.1.11
func (d *CommonSteps) QueryCCWithOpts(systemCC bool, ccID, channelID string, args []string, timeout time.Duration, concurrent bool, interval time.Duration, transientData map[string][]byte, targets ...*PeerConfig) (string, error)
QueryCCWithOpts ...
func (*CommonSteps) RegisterSteps ¶ added in v0.1.9
func (d *CommonSteps) RegisterSteps(s *godog.Suite)
RegisterSteps register steps
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 ConfigCLI ¶ added in v0.2.0
type ConfigCLI struct {
// contains filtered or unexported fields
}
ConfigCLI is used to invoke the Config CLI command-line tool
func NewConfigCLI ¶ added in v0.2.0
NewConfigCLI returns a new NewConfigCLI
type ConfigCLISteps ¶ added in v0.2.0
type ConfigCLISteps struct {
BDDContext *BDDContext
}
ConfigCLISteps config cli BDD test steps
func NewConfigCLISteps ¶ added in v0.2.0
func NewConfigCLISteps(context *BDDContext) *ConfigCLISteps
NewConfigCLISteps new config cli steps
func (*ConfigCLISteps) RegisterSteps ¶ added in v0.2.0
func (c *ConfigCLISteps) RegisterSteps(s *godog.Suite)
RegisterSteps register steps
func (*ConfigCLISteps) UpdateConfig ¶ added in v0.2.0
func (c *ConfigCLISteps) UpdateConfig(configFile, mspID, orgID, channelID string) error
UpdateConfig update config using config cli
func (*ConfigCLISteps) UpdateConfigWithExceptions ¶ added in v0.4.3
func (c *ConfigCLISteps) UpdateConfigWithExceptions(configFile, mspID, orgID, channelID, blackListRegex string) error
UpdateConfigWithExceptions updates config using config cli
type ConfigurationsSnapSteps ¶ added in v0.1.9
type ConfigurationsSnapSteps struct {
BDDContext *BDDContext
}
ConfigurationsSnapSteps ...
func NewConfigurationsSnapSteps ¶ added in v0.1.9
func NewConfigurationsSnapSteps(context *BDDContext) *ConfigurationsSnapSteps
NewConfigurationsSnapSteps ...
type CustomEndorsementHandler ¶ added in v0.1.11
type CustomEndorsementHandler struct {
// contains filtered or unexported fields
}
CustomEndorsementHandler ignores the channel in the ClientContext and instead sends the proposal to the given channel
func NewCustomEndorsementHandler ¶ added in v0.1.11
func NewCustomEndorsementHandler(context contextApi.Client, next invoke.Handler) *CustomEndorsementHandler
NewCustomEndorsementHandler creates a new instance of CustomEndorsementHandler
func (*CustomEndorsementHandler) Handle ¶ added in v0.1.11
func (h *CustomEndorsementHandler) Handle(requestContext *invoke.RequestContext, clientContext *invoke.ClientContext)
Handle handles an endorsement proposal
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 FabCLI ¶ added in v0.1.10
type FabCLI struct { }
FabCLI is used to invoke the Fabric CLI command-line tool
type PeerConfig ¶ added in v0.1.9
type PeerConfig struct { OrgID string Config fabApi.PeerConfig MspID string PeerID string }
PeerConfig holds the peer configuration and org ID
type StaticSelectionProviderFactory ¶ added in v0.2.0
type StaticSelectionProviderFactory struct {
defsvc.ProviderFactory
}
StaticSelectionProviderFactory uses a static selection service that doesn't use CC policies. (Required for System CC invocations.)
func (*StaticSelectionProviderFactory) CreateChannelProvider ¶ added in v0.2.0
func (f *StaticSelectionProviderFactory) CreateChannelProvider(config fabApi.EndpointConfig) (fabApi.ChannelProvider, error)
CreateChannelProvider creates a mock ChannelProvider
type UnsafeQuerySteps ¶ added in v0.1.11
type UnsafeQuerySteps struct {
BDDContext *BDDContext
}
UnsafeQuerySteps unsafe query BDD test steps
func NewUnsafeQuerySteps ¶ added in v0.1.11
func NewUnsafeQuerySteps(context *BDDContext) *UnsafeQuerySteps
NewUnsafeQuerySteps new unsafe query steps
func (*UnsafeQuerySteps) InvokeCCVerifyResponse ¶ added in v0.1.11
func (u *UnsafeQuerySteps) InvokeCCVerifyResponse(ccID, userArgs, orgIDs, channelID, expectedResponse string) error
InvokeCCVerifyResponse invoke CC and verify unsafe query operation