Documentation ¶
Index ¶
- Constants
- func ExecuteT(t *testing.T, cmd, input string) (stdout, stderr string)
- func ExtractPortFromAddress(listenAddress string) string
- func NewTestCaseDir(t *testing.T) (string, func())
- func StatusOK(statusCode int) bool
- func WaitForHeight(height int64, port string)
- func WaitForHeightTM(height int64, port string)
- func WaitForLCDStart(port string)
- func WaitForNextHeightTM(port string)
- func WaitForNextNBlocksTM(n int64, port string)
- func WaitForRPC(laddr string)
- func WaitForStart(url string)
- func WaitForTMStart(port string)
- type Process
Constants ¶
const (
// Tests expect a ledger device initialized to the following mnemonic
TestMnemonic = "equip will roof matter pink blind book anxiety banner elbow sun young"
)
Variables ¶
This section is empty.
Functions ¶
func ExecuteT ¶ added in v0.17.1
ExecuteT executes the command, pipes any input to STDIN and return STDOUT, logging STDOUT/STDERR to t. nolint: errcheck
func ExtractPortFromAddress ¶ added in v0.26.0
ExtractPortFromAddress extract port from listenAddress The listenAddress must be some strings like tcp://0.0.0.0:12345
func NewTestCaseDir ¶ added in v0.31.2
NewTestCaseDir creates a new temporary directory for a test case. Returns the directory path and a cleanup function. nolint: errcheck
func StatusOK ¶ added in v0.26.0
Whether or not an HTTP status code was "successful"
func WaitForHeight ¶ added in v0.17.1
Wait for height from the LCD API on localhost
func WaitForHeightTM ¶ added in v0.26.0
Wait for the given height from the Tendermint RPC on localhost
func WaitForLCDStart ¶ added in v0.26.0
func WaitForLCDStart(port string)
wait for tendermint to start by querying the LCD
func WaitForNextHeightTM ¶ added in v0.26.0
func WaitForNextHeightTM(port string)
Wait for the next tendermint block from the Tendermint RPC on localhost
func WaitForNextNBlocksTM ¶ added in v0.26.0
Wait for N tendermint blocks to pass using the Tendermint RPC on localhost
func WaitForRPC ¶ added in v0.17.1
func WaitForRPC(laddr string)
Wait for the RPC server to respond to /status
Types ¶
type Process ¶ added in v0.19.0
type Process struct { ExecPath string Args []string Pid int StartTime time.Time EndTime time.Time Cmd *exec.Cmd `json:"-"` ExitState *os.ProcessState `json:"-"` StdinPipe io.WriteCloser `json:"-"` StdoutPipe io.ReadCloser `json:"-"` StderrPipe io.ReadCloser `json:"-"` }
execution process
func CreateProcess ¶ added in v0.26.0
Same as StartProcess but doesn't start the process
func GoExecuteT ¶ added in v0.17.1
Execute the command, launch goroutines to log stdout/err to t. Caller should wait for .Wait() or .Stop() to terminate.
func GoExecuteTWithStdout ¶ added in v0.26.0
Same as GoExecuteT but spawns a go routine to ReadAll off stdout.
func StartProcess ¶ added in v0.19.0
dir: The working directory. If "", os.Getwd() is used. name: Command name args: Args to command. (should not include name)
func (*Process) ReadAll ¶ added in v0.26.0
ReadAll calls ioutil.ReadAll on the StdoutPipe and StderrPipe.