Documentation ¶
Index ¶
- Constants
- type ImageConfig
- type Manager
- func (m *Manager) ClearResources() error
- func (m *Manager) ExecCmd(t *testing.T, containerName string, command []string, success string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecHermesCmd(t *testing.T, command []string, hermesContainerName string, success string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecTxCmd(t *testing.T, chainID string, containerName string, command []string) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) ExecTxCmdWithSuccessString(t *testing.T, chainID string, containerName string, command []string, ...) (bytes.Buffer, bytes.Buffer, error)
- func (m *Manager) GetHostPort(containerName string, portID string) (string, error)
- func (m *Manager) GetNodeResource(containerName string) (*dockertest.Resource, error)
- func (m *Manager) PurgeResource(resource *dockertest.Resource) error
- func (m *Manager) RemoveNodeResource(containerName string) error
- func (m *Manager) RunChainInitResource(chainID string, chainVotingPeriod, chainExpeditedVotingPeriod int, ...) (*dockertest.Resource, error)
- func (m *Manager) RunHermesResource(chainAID, terraARelayerNodeName, terraAValMnemonic, chainBID, ... string, ...) (*dockertest.Resource, error)
- func (m *Manager) RunNodeResource(containerName, valCondifDir string) (*dockertest.Resource, error)
Constants ¶
const ( // Current Git branch Terra repo/version. It is meant to be built locally. // This image should be pre-built with `make docker-build-debug` either in CI or locally. CurrentBranchTerraRepository = "terra" CurrentBranchTerraTag = "debug" )
const ( HermesContainerName1 = "hermes-relayer" HermesContainerName2 = "hermes-relayer2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageConfig ¶
type ImageConfig struct { InitRepository string InitTag string TerraRepository string TerraTag string RelayerRepository string RelayerTag string }
ImageConfig contains all images and their respective tags needed for running e2e tests.
func NewImageConfig ¶
func NewImageConfig() ImageConfig
Returns ImageConfig needed for running e2e test.
type Manager ¶
type Manager struct { ImageConfig // contains filtered or unexported fields }
Manager is a wrapper around all Docker instances, and the Docker API. It provides utilities to run and interact with all Docker containers used within e2e testing.
func NewManager ¶
NewManager creates a new Manager instance and initializes all Docker specific utilies. Returns an error if initialiation fails.
func (*Manager) ClearResources ¶
ClearResources removes all outstanding Docker resources created by the Manager.
func (*Manager) ExecHermesCmd ¶
func (m *Manager) ExecHermesCmd(t *testing.T, command []string, hermesContainerName string, success string) (bytes.Buffer, bytes.Buffer, error)
ExecHermesCmd executes command on the hermes relayer 1 container.
func (*Manager) ExecTxCmd ¶
func (m *Manager) ExecTxCmd(t *testing.T, chainID string, containerName string, command []string) (bytes.Buffer, bytes.Buffer, error)
ExecTxCmd Runs ExecTxCmdWithSuccessString searching for `code: 0`
func (*Manager) ExecTxCmdWithSuccessString ¶
func (m *Manager) ExecTxCmdWithSuccessString(t *testing.T, chainID string, containerName string, command []string, successStr string) (bytes.Buffer, bytes.Buffer, error)
ExecTxCmdWithSuccessString Runs ExecCmd, with flags for txs added. namely adding flags `--chain-id={chain-id} -b=block --yes --keyring-backend=test "--log_format=json"`, and searching for `successStr`
func (*Manager) GetHostPort ¶
GetHostPort returns the port-forwarding address of the running host necessary to connect to the portId exposed inside the container. The container is determined by containerName. Returns the host-port or error if any.
func (*Manager) GetNodeResource ¶
GetNodeResource returns the node resource for containerName.
func (*Manager) PurgeResource ¶
PurgeResource purges the container resource and returns an error if any.
func (*Manager) RemoveNodeResource ¶
RemoveNodeResource removes a node container specified by containerName. Returns error if any.
func (*Manager) RunChainInitResource ¶
func (m *Manager) RunChainInitResource(chainID string, chainVotingPeriod, chainExpeditedVotingPeriod int, validatorConfigBytes []byte, mountDir string, forkHeight int) (*dockertest.Resource, error)
RunChainInitResource runs a chain init container to initialize genesis and configs for a chain with chainID. The chain is to be configured with chainVotingPeriod and validators deserialized from validatorConfigBytes. The genesis and configs are to be mounted on the init container as volume on mountDir path. Returns the container resource and error if any. This method does not Purge the container. The caller must deal with removing the resource.
func (*Manager) RunHermesResource ¶
func (m *Manager) RunHermesResource(chainAID, terraARelayerNodeName, terraAValMnemonic, chainBID, terraBRelayerNodeName, terraBValMnemonic string, hermesContainerName string, hermesCfgPath string) (*dockertest.Resource, error)
RunHermesResource runs a Hermes container. Returns the container resource and error if any. the name of the hermes container is "<chain A id>-<chain B id>-relayer"
func (*Manager) RunNodeResource ¶
RunNodeResource runs a node container. Assings containerName to the container. Mounts the container on valConfigDir volume on the running host. Returns the container resource and error if any.