Documentation
¶
Overview ¶
Package utils provides shared common functions so different E2E tests suites can use them.
Index ¶
- Constants
- func AppendLog(ls LogsTestSuite, logFileName, content string, recurrence int)
- func AssertAgentTailerError(ls LogsTestSuite, logFileName string)
- func AssertAgentTailerOK(ls LogsTestSuite, logFileName string)
- func AssertAgentTailerStarted(ls LogsTestSuite, logFileName string)
- func AssertAgentTailerState(ls LogsTestSuite, logFileName string, expectedState TailerState)
- func CheckLogFilePresence(ls LogsTestSuite, logFileName string)
- func CheckLogsExpected(t *testing.T, fakeIntake *components.FakeIntake, service, content string, ...)
- func CheckLogsNotExpected(t *testing.T, fakeIntake *components.FakeIntake, service, content string)
- func CleanUp(ls LogsTestSuite)
- func FetchAndFilterLogs(fakeIntake *components.FakeIntake, service, content string) ([]*aggregator.Log, error)
- type AgentStatus
- type Integration
- type LogsStats
- type LogsTestSuite
- type Source
- type TailerState
Constants ¶
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 )
const LinuxLogsFolderPath = "/var/log/e2e_test_logs"
LinuxLogsFolderPath is the folder where log files will be stored for Linux tests
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 AssertAgentTailerError ¶ added in v0.74.0
func AssertAgentTailerError(ls LogsTestSuite, logFileName string)
AssertAgentTailerError asserts that a tailer for the given log file is in Error state.
func AssertAgentTailerOK ¶ added in v0.74.0
func AssertAgentTailerOK(ls LogsTestSuite, logFileName string)
AssertAgentTailerOK asserts that a tailer for the given log file is in OK state.
func AssertAgentTailerStarted ¶ added in v0.74.0
func AssertAgentTailerStarted(ls LogsTestSuite, logFileName string)
AssertAgentTailerStarted asserts that a tailer for the given log file exists in the agent status.
func AssertAgentTailerState ¶ added in v0.74.0
func AssertAgentTailerState(ls LogsTestSuite, logFileName string, expectedState TailerState)
AssertAgentTailerState asserts that a tailer for the given log file is in the expected state. expectedState can be TailerStateOK or TailerStateError.
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 AgentStatus ¶ added in v0.74.0
type AgentStatus struct {
LogsStats LogsStats `json:"logsStats"`
}
AgentStatus represents the agent status JSON structure
type Integration ¶ added in v0.74.0
Integration represents a log integration
type LogsStats ¶ added in v0.74.0
type LogsStats struct {
Integrations []Integration `json:"integrations"`
}
LogsStats represents the logs statistics section
type LogsTestSuite ¶
type LogsTestSuite interface {
T() *testing.T
Env() *environments.Host
IsDevMode() bool
}
LogsTestSuite is an interface for the log agent test suite.
type Source ¶ added in v0.74.0
type Source struct {
Type string `json:"type"`
Configuration map[string]interface{} `json:"configuration"`
Status string `json:"status"`
Inputs []string `json:"inputs"`
}
Source represents a log source
type TailerState ¶ added in v0.74.0
type TailerState string
TailerState represents the state of a log tailer
const ( // TailerStateOK indicates the tailer is running without errors TailerStateOK TailerState = "OK" // TailerStateError indicates the tailer is in an error state TailerStateError TailerState = "Error" )