utils

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package utils provides shared common functions so different E2E tests suites can use them.

Index

Constants

View Source
const (
	// WaitFor Time to wait for file tailing utils
	WaitFor = 2 * time.Minute
	// Tick how many seconds each ticket should take
	Tick = 10 * time.Second
)
View Source
const LinuxLogsFolderPath = "/var/log/e2e_test_logs"

LinuxLogsFolderPath is the folder where log files will be stored for Linux tests

View Source
const WindowsLogsFolderPath = "C:\\logs\\e2e_test_logs"

WindowsLogsFolderPath is the folder where log files will be stored for Windows tests

Variables

This section is empty.

Functions

func AppendLog

func AppendLog(ls LogsTestSuite, logFileName, content string, recurrence int)

AppendLog append log with 'content', which is then repeated 'reccurrence' times and verifies log contents.

func CheckLogFilePresence

func CheckLogFilePresence(ls LogsTestSuite, logFileName string)

CheckLogFilePresence verifies the presence or absence of a log file path

func CheckLogsExpected

func CheckLogsExpected(t *testing.T, fakeIntake *components.FakeIntake, service, content string, expectedTags ddtags)

CheckLogsExpected verifies the presence of expected logs, and verifies that there are no duplicate tags.

func CheckLogsNotExpected

func CheckLogsNotExpected(t *testing.T, fakeIntake *components.FakeIntake, service, content string)

CheckLogsNotExpected verifies the absence of unexpected logs.

func CleanUp

func CleanUp(ls LogsTestSuite)

CleanUp cleans up any existing log files (only useful when running dev mode/local runs).

func FetchAndFilterLogs

func FetchAndFilterLogs(fakeIntake *components.FakeIntake, service, content string) ([]*aggregator.Log, error)

FetchAndFilterLogs fetches logs from the fake intake server and filters them by service and content.

Types

type LogsTestSuite

type LogsTestSuite interface {
	T() *testing.T
	Env() *environments.Host
	IsDevMode() bool
}

LogsTestSuite is an interface for the log agent test suite.

Jump to

Keyboard shortcuts

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