nettests

package
v0.3.0-rc.2.0...-51e5094 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var All = map[string]Group{
	"websites": {
		Label: "Websites",
		Nettests: []Nettest{
			WebConnectivity{},
		},
		UnattendedOK: true,
	},
	"performance": {
		Label: "Performance",
		Nettests: []Nettest{
			Dash{},
			NDT{},
		},
	},
	"middlebox": {
		Label: "Middleboxes",
		Nettests: []Nettest{
			HTTPInvalidRequestLine{},
			HTTPHeaderFieldManipulation{},
		},
		UnattendedOK: true,
	},
	"im": {
		Label: "Instant Messaging",
		Nettests: []Nettest{
			FacebookMessenger{},
			Telegram{},
			WhatsApp{},
		},
		UnattendedOK: true,
	},
	"circumvention": {
		Label: "Circumvention Tools",
		Nettests: []Nettest{
			Psiphon{},
			RiseupVPN{},
			Tor{},
		},
		UnattendedOK: true,
	},
}

All contains all the nettests that can be run by the user

Functions

func RunGroup

func RunGroup(config RunGroupConfig) error

RunGroup runs a group of nettests according to the specified config.

Types

type Controller

type Controller struct {
	Probe   *ooni.Probe
	Session *engine.Session

	// InputFiles optionally contains the names of the input
	// files to read inputs from (only for nettests that take
	// inputs, of course)
	InputFiles []string

	// Inputs contains inputs to be tested. These are specified
	// using the command line using the --input flag.
	Inputs []string
	// contains filtered or unexported fields
}

Controller is passed to the run method of every Nettest each nettest instance has one controller

func NewController

func NewController(
	nt Nettest, probe *ooni.Probe, res *database.Result, sess *engine.Session) *Controller

NewController creates a nettest controller

func (*Controller) OnProgress

func (c *Controller) OnProgress(perc float64, msg string)

OnProgress should be called when a new progress event is available.

func (*Controller) Run

func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) error

Run runs the selected nettest using the related experiment with the specified inputs.

This function will continue to run in most cases but will immediately halt if something's wrong with the file system.

func (*Controller) SetInputIdxMap

func (c *Controller) SetInputIdxMap(inputIdxMap map[int64]int64) error

SetInputIdxMap is used to set the mapping of index into input. This mapping is used to reference, for example, a particular URL based on the index inside of the input list and the index of it in the database.

func (*Controller) SetNettestIndex

func (c *Controller) SetNettestIndex(i, n int)

SetNettestIndex is used to set the current nettest index and total nettest count to compute a different progress percentage.

type Dash

type Dash struct {
}

Dash test implementation

func (Dash) Run

func (d Dash) Run(ctl *Controller) error

Run starts the test

type FacebookMessenger

type FacebookMessenger struct {
}

FacebookMessenger test implementation

func (FacebookMessenger) Run

func (h FacebookMessenger) Run(ctl *Controller) error

Run starts the test

type Group

type Group struct {
	Label        string
	Nettests     []Nettest
	UnattendedOK bool
}

Group is a group of nettests

type HTTPHeaderFieldManipulation

type HTTPHeaderFieldManipulation struct {
}

HTTPHeaderFieldManipulation test implementation

func (HTTPHeaderFieldManipulation) Run

Run starts the test

type HTTPInvalidRequestLine

type HTTPInvalidRequestLine struct {
}

HTTPInvalidRequestLine test implementation

func (HTTPInvalidRequestLine) Run

Run starts the test

type NDT

type NDT struct {
}

NDT test implementation. We use v7 of NDT since 2020-03-12.

func (NDT) Run

func (n NDT) Run(ctl *Controller) error

Run starts the test

type Nettest

type Nettest interface {
	Run(*Controller) error
}

Nettest interface. Every Nettest should implement this.

type Psiphon

type Psiphon struct {
}

Psiphon test implementation

func (Psiphon) Run

func (h Psiphon) Run(ctl *Controller) error

Run starts the test

type RiseupVPN

type RiseupVPN struct {
}

RiseupVPN test implementation

func (RiseupVPN) Run

func (h RiseupVPN) Run(ctl *Controller) error

Run starts the test

type RunGroupConfig

type RunGroupConfig struct {
	GroupName  string
	Probe      *ooni.Probe
	InputFiles []string
	Inputs     []string
}

RunGroupConfig contains the settings for running a nettest group.

type Telegram

type Telegram struct {
}

Telegram test implementation

func (Telegram) Run

func (h Telegram) Run(ctl *Controller) error

Run starts the test

type Tor

type Tor struct {
}

Tor test implementation

func (Tor) Run

func (h Tor) Run(ctl *Controller) error

Run starts the test

type WebConnectivity

type WebConnectivity struct {
}

WebConnectivity test implementation

func (WebConnectivity) Run

func (n WebConnectivity) Run(ctl *Controller) error

Run starts the test

type WhatsApp

type WhatsApp struct {
}

WhatsApp test implementation

func (WhatsApp) Run

func (h WhatsApp) Run(ctl *Controller) error

Run starts the test

Jump to

Keyboard shortcuts

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