Documentation
¶
Index ¶
- func AddContentsToLog(fileName string, rootDir string, msgToAdd string) error
- func BuildBucketID() string
- func FindFile(fileName string, rootDir string) (string, error)
- func IsCriticalPullCrash(code int) bool
- func JsonPbUnmarshaler() jsonpb.Unmarshaler
- func Poll(ctx context.Context, f func(context.Context) error, opts *PollOptions) error
- func PollBreak(err error) error
- func PrintToLog(cmd string, stdout string, stderr string)
- func RunWithTimeout(ctx context.Context, cmd *exec.Cmd, timeout time.Duration, block bool) (stdout string, stderr string, err error)
- func RunWithTimeoutSpecialLog(ctx context.Context, cmd *exec.Cmd, timeout time.Duration, block bool, ...) (stdout string, stderr string, err error)
- func SetUpLog() error
- func StreamScanner(stream io.Reader, logtag string)
- type PollOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContentsToLog ¶
AddContentsToLog adds contents of the file of fileName to log
func BuildBucketID ¶
func BuildBucketID() string
func IsCriticalPullCrash ¶
func JsonPbUnmarshaler ¶
func JsonPbUnmarshaler() jsonpb.Unmarshaler
JsonPbUnMarshaler returns the unmarshaler which should be used across CTR.
func PrintToLog ¶
PrintToLog prints cmd, stdout, stderr to log
func RunWithTimeout ¶
func RunWithTimeout(ctx context.Context, cmd *exec.Cmd, timeout time.Duration, block bool) (stdout string, stderr string, err error)
RunWithTimeout runs command with timeout limit.
func RunWithTimeoutSpecialLog ¶
func RunWithTimeoutSpecialLog(ctx context.Context, cmd *exec.Cmd, timeout time.Duration, block bool, logstr string) (stdout string, stderr string, err error)
RunWithTimeoutRedacted runs command with timeout limit, however only will log whats provided in the logstr input. Useful when running cmds with private info, like oath tokens.
func SetUpLog ¶
func SetUpLog() error
SetUpLog sets up the logging for CTR within /var/tmp/bbid/ctrlog.txt
func StreamScanner ¶
StreamScanner makes a scanner to read from test streams.
Types ¶
type PollOptions ¶
type PollOptions struct { // Timeout specifies the maximum time to poll. // Non-positive values indicate no timeout (although context deadlines will still be honored). Timeout time.Duration // Interval specifies how long to sleep between polling. // Non-positive values indicate that a reasonable default should be used. Interval time.Duration }
PollOptions provides testing.PollOptions.
Click to show internal directories.
Click to hide internal directories.