testutil

package
v0.0.0-...-ae3a0a2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MPL-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertStreamingRPCError

func AssertStreamingRPCError(t *testing.T, s StreamingRPC, tc StreamingRPCErrorTestCase)

AssertStreamingRPCError asserts a streaming RPC's error matches the given assertion in the test case.

func CgroupsCompatible

func CgroupsCompatible(t *testing.T) bool

CgroupsCompatible returns true if either cgroups.v1 or cgroups.v2 is supported.

func CgroupsCompatibleV1

func CgroupsCompatibleV1(t *testing.T)

CgroupsCompatibleV1 skips tests unless: - cgroup.v1 mount point is detected

func CgroupsCompatibleV2

func CgroupsCompatibleV2(t *testing.T)

CgroupsCompatibleV2 skips tests unless: - cgroup.v2 unified mode is detected

func DockerCompatible

func DockerCompatible(t *testing.T)

DockerCompatible skips tests if docker is not present

func DockerIsConnected

func DockerIsConnected(t *testing.T) bool

DockerIsConnected checks to see if a docker daemon is available (local or remote)

func ExecCompatible

func ExecCompatible(t *testing.T)

ExecCompatible skips tests unless: - running as root - running on Linux

func JavaCompatible

func JavaCompatible(t *testing.T)

JavaCompatible skips tests unless: - "java" executable is detected on $PATH - running as root - running on Linux

func MinimumCores

func MinimumCores(t *testing.T, cores int)

MinimumCores skips tests unless: - system has at least cores available CPU cores

func MountCompatible

func MountCompatible(t *testing.T)

MountCompatible skips tests unless: - not running as windows - running as root

func QemuCompatible

func QemuCompatible(t *testing.T)

QemuCompatible skips tests unless: - "qemu-system-x86_64" executable is detected on $PATH (!windows) - "qemu-img" executable is detected on on $PATH (windows)

func RequireConsul

func RequireConsul(t *testing.T)

RequireConsul skips tests unless: - "consul" executable is detected on $PATH

func RequireLinux

func RequireLinux(t *testing.T)

RequireLinux skips tests unless: - running on Linux

func RequireRoot

func RequireRoot(t *testing.T)

RequireRoot skips tests unless: - running as root

func RequireVault

func RequireVault(t *testing.T)

RequireVault skips tests unless: - "vault" executable is detected on $PATH

Types

type StreamingRPC

type StreamingRPC interface {
	StreamingRpcHandler(method string) (structs.StreamingRpcHandler, error)
}

StreamingRPC may be satisfied by client.Client or server.Server.

type StreamingRPCErrorTestCase

type StreamingRPCErrorTestCase struct {
	Name   string
	RPC    string
	Req    interface{}
	Assert func(error) bool
}

StreamingRPCErrorTestCase is a test case to be passed to the assertStreamingRPCError func.

Jump to

Keyboard shortcuts

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