testutil

package
v0.0.0-...-087575d Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBalance

func AddBalance(t *testing.T, c *Container, addr string, amount string) error

AddBalance adds balance to a OBADA node account.

func DumpContainerLogs

func DumpContainerLogs(id string) []byte

DumpContainerLogs outputs logs from the running docker container.

func ExecInContainer

func ExecInContainer(id string, args ...string) ([]byte, error)

ExecInContainer executes a command in the specified container.

func ExtractIPPort

func ExtractIPPort(id, port string) (hostIP, hostPort string, err error)

ExtractIPPort extracts container real port binded to docker application port.

func NewTestLoger

func NewTestLoger() (*zap.SugaredLogger, func())

NewTestLoger creates a new logger for testing. nolint:gocritic

func StopBlockchain

func StopBlockchain(t *testing.T, c *Container)

StopBlockchain stops a running OBADA node instance.

func StopContainer

func StopContainer(id string) error

StopContainer stops and removes the specified container.

Types

type Container

type Container struct {
	ID    string
	Host  string
	Ports map[string]int
}

Container tracks information about the docker container started for tests.

func StartBlockchain

func StartBlockchain(tag string) (*Container, error)

StartBlockchain starts OBADA blockchain node instance

func StartContainer

func StartContainer(image string, ports []string, args ...string) (*Container, error)

StartContainer starts the specified container for running tests.

Jump to

Keyboard shortcuts

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