Documentation ¶
Index ¶
- Constants
- Variables
- func Carrier(netns, ifname string) error
- func Comment(t *testing.T, args ...interface{})
- func Commentf(t *testing.T, format string, args ...interface{})
- func IpFamily(prefix string) (family string)
- func IsIPv6(prefix string) (is_ip6 bool)
- func Log() *log.Logger
- func Run(args ...string)
- func SkipIfDryRun(t *testing.T)
- type Assert
- func (assert Assert) Background(options ...interface{}) *Program
- func (assert Assert) Comment(args ...interface{})
- func (assert Assert) Commentf(format string, args ...interface{})
- func (assert Assert) Dir(name string)
- func (assert Assert) Equal(s, expect string)
- func (assert Assert) Error(err error, v interface{})
- func (assert Assert) False(t bool)
- func (assert Assert) Match(s, pattern string)
- func (assert Assert) MatchNonFatal(s, pattern string) bool
- func (assert Assert) Nil(err error)
- func (assert Assert) NoListener(atsockname string)
- func (assert Assert) NonNil(err error)
- func (assert Assert) Ping(netns, addr string)
- func (assert Assert) PingNonFatal(netns, addr string) bool
- func (assert Assert) Program(options ...interface{})
- func (assert Assert) ProgramErr(v interface{}, options ...interface{})
- func (assert Assert) ProgramNonFatal(options ...interface{}) bool
- func (assert Assert) ProgramRetry(tries int, options ...interface{})
- func (assert Assert) RetryPing6(xargs []string)
- func (assert Assert) True(t bool)
- type Cleanup
- type Daemon
- type Program
- type Quiet
- type Suite
- type Tester
- type Tests
Constants ¶
const ( Ip4 = "-4" Ip6 = "-6" )
FIXMEIP6: use Stringer or Format?
const License = `` /* 15871-byte string literal not displayed */
const Timeout = 3 * time.Second
Timeout is the default duration on the Program Wait timer.
Variables ¶
var ( DryRun = flag.Bool("test.dryrun", false, "don't run, just print test names") VV = flag.Bool("test.vv", false, "log program output") VVV = flag.Bool("test.vvv", false, "log program execution") NoGoes = flag.Bool("test.nogoes", false, "linux ip commands") NoExec = flag.Bool("test.noexec", false, "stub/echo linux ip commands") NoBmc = flag.Bool("test.nobmc", false, "no redis-cli to bmc") )
var ( Pause = prompt{ flag.Bool("test.pause", false, "enable program pauses"), "pause", } )
Functions ¶
func SkipIfDryRun ¶
Types ¶
type Assert ¶
Assert wraps a testing.Test or Benchmark with several assertions.
func (Assert) Background ¶
Background Program after asserting that it starts without error. Usage:
defer Assert{t}.Background(...).Quit()
func (Assert) Error ¶
Error asserts that an error matches the given error, string, regex, or bool If v is true, asserts err isn't nil; otherwise, if false, asserts that it's nil.
func (Assert) MatchNonFatal ¶
Match asserts string pattern match.
func (Assert) NoListener ¶
Verifiy that there is no listener on named Unix socket.
func (Assert) PingNonFatal ¶
func (Assert) Program ¶
func (assert Assert) Program(options ...interface{})
Program asserts that the Program runs without error.
func (Assert) ProgramErr ¶
func (assert Assert) ProgramErr(v interface{}, options ...interface{})
ProgramErr asserts that the Program returns matches (v) error (see Error).
func (Assert) ProgramNonFatal ¶
func (Assert) ProgramRetry ¶
func (Assert) RetryPing6 ¶
FIXMEIP6: ping6 seems to require retry for validation
type Cleanup ¶
Cleanup wraps a testing.Test or Benchmark with Program
func (Cleanup) Program ¶
func (cleanup Cleanup) Program(options ...interface{})
Program runs a cleanup task to its End
func (Cleanup) ProgramRetry ¶ added in v1.8.6
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
A Daemon is a background program started and defer stopped from a TestMain.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is an exec.Cmd wrapper
func Begin ¶
Begin a Program; type options:
Quiet don't log output even if err is !nil io.Reader use reader as Stdin instead of the default, /dev/null *regexp.Regexp match Stdout with compiled regex pattern time.Duration wait up to the given duration for the program to finish instead of the default Timeout
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ethtool parses testdata/ethtool.yaml and testdata/ethtool_priv_flags.yaml; then issues the respective commands.
|
Package ethtool parses testdata/ethtool.yaml and testdata/ethtool_priv_flags.yaml; then issues the respective commands. |
Package netport parses testdata/netport.yaml for interface assingments along with utilities to build and test virtual networks configured from these assignments.
|
Package netport parses testdata/netport.yaml for interface assingments along with utilities to build and test virtual networks configured from these assignments. |