Documentation
¶
Index ¶
- Constants
- Variables
- func Carrier(netns, ifname string) error
- func NoAdjacency(t *testing.T) (err error)
- func Pause(args ...interface{})
- func PauseQuit(t *testing.T)
- func Ping(netns, addr string) error
- 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) Main(main func())
- 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) Program(options ...interface{})
- func (assert Assert) ProgramErr(v interface{}, options ...interface{})
- func (assert Assert) True(t bool)
- func (assert Assert) YoureRoot()
- type Cleanup
- type Program
- type Quiet
- type Self
- type Suite
- type Tester
- type Tests
- type Unit
Constants ¶
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") MustPause = flag.Bool("test.pause", false, "pause before and after suite") IsMain = flag.Bool("test.main", false, "runs main() instead of test(s)") VV = flag.Bool("test.vv", false, "log test.Program output") VVV = flag.Bool("test.vvv", false, "log test.Program execution") )
Functions ¶
func NoAdjacency ¶
after vlan interface removed, containers deleted, there should be no adjacency rewrites leftover
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) Main ¶
func (assert Assert) Main(main func())
Main runs the main function if given the "-test.main" flag. With said flag, this strip os.Args[0] and any leading -test.* options and os.Exit(0) if the main returns. Otherwise, Main changes CWD to "-test.cd", if necessary, and returns.
func (Assert) MatchNonFatal ¶
Match asserts string pattern match.
func (Assert) NoListener ¶
Verifiy that there is no listener on named Unix socket.
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).
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is an exec.Cmd wrapper
func Begin ¶
Begin a Program; type options:
Self inserts []string{os.Args[0], "-test.main}" into Program args; the Test should run it's own main if said flag is set, e.g.: func Test(t *testing.T) { test.Main(main) test.Suite{ {"Test1", func(t *testing.T) { ... }}, ... }.Run(t) } 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