acceptancetest

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(
	ctx context.Context,
) (tearDown func(), dockerPool *dockertest.Pool, err error)

Setup does a bit of setup so acceptance tests can run:

  1. Connect to a running docker daemon.
  2. Build and tag the image for acceptance tests.

The tearDown function must be called after tests are finished.

func TerraformSteps added in v0.0.5

func TerraformSteps(
	t *testing.T,
	testStep resource.TestStep,
	testSteps ...resource.TestStep,
)

TerraformSteps removes a bit of boilerplate around setting up the [resource.TestStep]s.

Types

type OpenWrtServer added in v0.0.12

type OpenWrtServer struct {
	Hostname string
	HTTPPort uint16
	Password string
	Scheme   string
	SSHPort  uint16
	Username string
}

OpenWrtServer groups all the information needed to connect to the running OpenWrt server.

func RunOpenWrtServer

func RunOpenWrtServer(
	ctx context.Context,
	dockerPool dockertest.Pool,
	t *testing.T,
) OpenWrtServer

RunOpenWrtServer constructs a running OpenWrt server. The hostname and port can be arbitrary, so they are returned to make it easier to interact with the OpenWrt server.

func (OpenWrtServer) LuCIRPCClient added in v0.0.13

func (s OpenWrtServer) LuCIRPCClient(
	ctx context.Context,
	t *testing.T,
) *lucirpc.Client

LuCIRPCClient returns a *lucirpc.Client to interact with the OpenWrtServer.

func (OpenWrtServer) ProviderBlock added in v0.0.12

func (s OpenWrtServer) ProviderBlock() string

ProviderBlock creates a stringified provider block for the OpenWrt provider.

Jump to

Keyboard shortcuts

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