integrationtest

package
v7.5.33 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package integrationtest provides support for integration style tests that need a local web server and proxy server.

Index

Constants

View Source
const (
	Content  = "THIS IS SOME STATIC CONTENT FROM THE WEB SERVER"
	Token    = "AF325DF3432FDS"
	KeyFile  = "./proxykey.pem"
	CertFile = "./proxycert.pem"

	Etag        = "X-Lantern-Etag"
	IfNoneMatch = "X-Lantern-If-None-Match"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

type Helper struct {
	ConfigDir                     string
	HTTPSProxyServerAddr          string
	HTTPSUTPAddr                  string
	OBFS4ProxyServerAddr          string
	OBFS4UTPProxyServerAddr       string
	LampshadeProxyServerAddr      string
	LampshadeUTPProxyServerAddr   string
	QUICIETFProxyServerAddr       string
	WSSProxyServerAddr            string
	ShadowsocksProxyServerAddr    string
	ShadowsocksmuxProxyServerAddr string
	TLSMasqProxyServerAddr        string
	HTTPSSmuxProxyServerAddr      string
	HTTPSPsmuxProxyServerAddr     string
	HTTPServerAddr                string
	HTTPSServerAddr               string
	ConfigServerAddr              string
	// contains filtered or unexported fields
}

Helper is a helper for running integration tests that provides its own web, proxy and config servers.

func NewHelper

func NewHelper(t *testing.T, basePort int) (*Helper, error)

NewHelper prepares a new integration test helper including a web server for content, a proxy server and a config server that ties it all together. It also enables ForceProxying on the client package to make sure even localhost origins are served through the proxy. Make sure to close the Helper with Close() when finished with the test.

func (*Helper) Close

func (helper *Helper) Close()

Close closes the integration test helper and cleans up. TODO: actually stop the proxy (not currently supported by API)

func (*Helper) SetProtocol

func (helper *Helper) SetProtocol(protocol string)

SetProtocol sets the protocol to use when connecting to the test proxy (updates the config served by the config server). In the case that the platform is android or linux, remove utp testing until it is supported by the build scripts

Jump to

Keyboard shortcuts

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