runner

package
v0.0.0-...-226beff Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ValidTestAccountID is a valid test account that should be recognized
	// by the system
	ValidTestAccountID = "testacct-0000-0000-0000-000000000000"

	// ValidTestUserID is a valid test user id that should be recognized by the system
	ValidTestUserID = "testuser-0000-0000-0000-000000000000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Client is a configured client
	Client *client.Client
}

Config is a runner configuration

type Runner

type Runner struct {
	// Config is a device configuration
	Config
	*log.Entry
}

Runner is Fake IOT device runner

func New

func New(config Config) *Runner

New returns a new instance of runner

func (*Runner) RunSimulation

func (r *Runner) RunSimulation(ctx context.Context, sim Simulation) error

RunSimulation runs test simulation

func (*Runner) RunTests

func (r *Runner) RunTests(ctx context.Context) error

RunTests runs a series of compliance tests to make sure that server performs as expected

func (*Runner) SendBogusAuth

func (r *Runner) SendBogusAuth(ctx context.Context, bearerToken string) error

SendBogusAuth sends a request with bogus authentication and expects to fail

func (*Runner) SendCorruptedMetric

func (r *Runner) SendCorruptedMetric(ctx context.Context) error

SendCorruptedMetric sends corrupted metric

func (*Runner) SendEmptyMetric

func (r *Runner) SendEmptyMetric(ctx context.Context) error

SendEmptyMetric sends empty metric and expects an error

func (*Runner) SendOK

func (r *Runner) SendOK(ctx context.Context) error

SendOK sends OK metric and expects the metric to succeed

type Simulation

type Simulation struct {
	// Period is a period to run simulation for
	Period time.Duration
	// Freq is a frequency of activity
	Freq time.Duration
	// AccountID is an account ID to emit
	AccountID string
	// Users is a total amount of different users to simulate accross
	// all accounts. Simulation will generate distinct user IDs
	// and emit them in a rotating loop
	Users int
}

Simulation is a IOT device simulation

Jump to

Keyboard shortcuts

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