tests

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Clients      []*minio.Client
	Bucket       string
	Logger       utils.Logger
	ObjectsCount int
	Concurrency  int
}

Config represents the test config

type PutGetTest

type PutGetTest struct {
	// contains filtered or unexported fields
}

PutGetTest uploads the objects using a random client and then Gets the objects from each node to verify if the get output is consistent accross nodes.

func (*PutGetTest) Init

func (t *PutGetTest) Init(ctx context.Context, config Config, stats *Stats) error

Init initialized the test.

func (*PutGetTest) Name

func (t *PutGetTest) Name() string

Name - name of the test.

func (*PutGetTest) Run

func (t *PutGetTest) Run(ctx context.Context) error

Run executes the test by verifying if the get output is consistent accross the nodes.

func (*PutGetTest) Setup

func (t *PutGetTest) Setup(ctx context.Context) error

Setup prepares the test by uploading the objects to the test bucket.

func (*PutGetTest) TearDown

func (t *PutGetTest) TearDown(ctx context.Context) error

TearDown removes the uploaded objects from the test bucket.

type PutListTest

type PutListTest struct {
	// contains filtered or unexported fields
}

PutListTest uploads the objects using a random client and then Lists the objects from each node to verify if the list output is consistent accross nodes.

func (*PutListTest) Init

func (t *PutListTest) Init(ctx context.Context, config Config, stats *Stats) error

Init initialized the test.

func (*PutListTest) Name

func (t *PutListTest) Name() string

Name - name of the test.

func (*PutListTest) Run

func (t *PutListTest) Run(ctx context.Context) error

Run executes the test by verifying if the list output is consistent accross the nodes.

func (*PutListTest) Setup

func (t *PutListTest) Setup(ctx context.Context) error

Setup prepares the test by uploading the objects to the test bucket.

func (*PutListTest) TearDown

func (t *PutListTest) TearDown(ctx context.Context) error

TearDown removes the uploaded objects from the test bucket.

type PutStatTest

type PutStatTest struct {
	// contains filtered or unexported fields
}

PutStatTest uploads the objects using a random client and then Stats the objects from each node to verify if the stat output is consistent accross nodes.

func (*PutStatTest) Init

func (t *PutStatTest) Init(ctx context.Context, config Config, stats *Stats) error

Init initialized the test.

func (*PutStatTest) Name

func (t *PutStatTest) Name() string

Name - name of the test.

func (*PutStatTest) Run

func (t *PutStatTest) Run(ctx context.Context) error

Run executes the test by verifying if the stat output is consistent accross the nodes.

func (*PutStatTest) Setup

func (t *PutStatTest) Setup(ctx context.Context) error

Setup prepares the test by uploading the objects to the test bucket.

func (*PutStatTest) TearDown

func (t *PutStatTest) TearDown(ctx context.Context) error

TearDown removes the uploaded objects from the test bucket.

type Stat

type Stat struct {
	Total  atomic.Int64
	Failed atomic.Int64
}

Stat denotes the total and success stat info.

type Stats

type Stats struct {
	APIStat  *Stat
	TestStat *Stat
}

Stats denotes the statistical information on the API requests made.

func NewStats

func NewStats() *Stats

NewStats creates an instance of Stats.

func (*Stats) APIInfo

func (stats *Stats) APIInfo() (total, failed int64)

APIInfo returns the API stats.

func (*Stats) String

func (stats *Stats) String() string

func (*Stats) TestInfo

func (stats *Stats) TestInfo() (total, failed int64)

TestInfo returns the Test stats.

type Test

type Test interface {
	Name() string
	Init(ctx context.Context, config Config, stats *Stats) error
	Setup(ctx context.Context) error
	Run(ctx context.Context) error
	TearDown(ctx context.Context) error
}

Test interface defines the test.

Jump to

Keyboard shortcuts

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