Documentation
¶
Overview ¶
Package flare provides helpers for testing the agent flare subcommand.
Index ¶
- Variables
- func AssertEtcFolderOnlyContainsConfigFile(t *testing.T, flare flare.Flare)
- func AssertEventlogFolderOnlyContainsWindowsEventLog(t *testing.T, flare flare.Flare)
- func AssertFileContains(t *testing.T, flare flare.Flare, filename string, expectedContents ...string)
- func AssertFileNotContains(t *testing.T, flare flare.Flare, filename string, expectedContents ...string)
- func AssertFilesExist(t *testing.T, flare flare.Flare, filenames []string)
- func AssertFoldersExist(t *testing.T, flare flare.Flare, filenames []string)
- func AssertLogsFolderOnlyContainsLogFile(t *testing.T, flare flare.Flare)
Constants ¶
This section is empty.
Variables ¶
var AllConfigFiles = []string{
"etc/datadog.yaml",
"etc/security-agent.yaml",
"etc/system-probe.yaml",
}
AllConfigFiles contains all the config files we can create to configure the Agents
var AllLogFiles = []string{
"logs/agent.log",
"logs/process-agent.log",
"logs/security-agent.log",
"logs/system-probe.log",
"logs/trace-agent.log",
}
AllLogFiles contains all the log files that are created when enabling all products TODO: add these files
- "logs/dogstatsd_info/dogstatsd-stats.log", // need to enable DSD
- "logs/jmxfetch.log", // need to enable JMX Fetch
var DefaultConfigFiles = []string{"etc/datadog.yaml"}
DefaultConfigFiles contains the config file created with a default installation
var DefaultFlareFiles = []string{
"config-check.log",
"diagnose.log",
"docker_ps.log",
"envvars.log",
"go-routine-dump.log",
"install_info.log",
"permissions.log",
"process_agent_runtime_config_dump.yaml",
"runtime_config_dump.yaml",
"secrets.log",
"status.log",
"system_probe_runtime_config_dump.yaml",
"version-history.json",
}
DefaultFlareFiles contains all the files that are included in the flare archive by default (no need for a specific configuration option)
var DefaultFlareFolders = []string{
"etc/confd/",
"expvar",
"logs",
}
DefaultFlareFolders contains all the folders included by default in the flare
var DefaultLogFiles = []string{
"logs/agent.log",
"logs/process-agent.log",
"logs/trace-agent.log",
}
DefaultLogFiles contains all the log files that are created with a default installation
var DefaultMetadataFlareFiles = []string{
"metadata/host.json",
"metadata/inventory/host.json",
"metadata/inventory/agent.json",
}
DefaultMetadataFlareFiles contains the metadata files included by default
var LinuxFiles = []string{}
LinuxFiles contains files that are specific to Linux
var NonLocalFlareFiles = []string{
"health.yaml",
"tagger-list.json",
"workload-list.log",
"agent_open_files.txt",
}
NonLocalFlareFiles contains files only available in non-local flare mode
var NonLocalMetadataFlareFiles = []string{
"metadata/inventory/checks.json",
}
NonLocalMetadataFlareFiles contains metadata files only available in non-local flare mode
var ProfilingFiles = []string{
"profiles/core-1st-heap.pprof",
"profiles/core-2nd-heap.pprof",
"profiles/core-block.pprof",
"profiles/core-cpu.pprof",
"profiles/core-mutex.pprof",
"profiles/trace-1st-heap.pprof",
"profiles/trace-2nd-heap.pprof",
"profiles/trace-block.pprof",
"profiles/trace-cpu.pprof",
"profiles/trace-mutex.pprof",
}
ProfilingFiles contains the profiling files included in a flare with profiling enabled
var ProfilingNonLinuxFiles = []string{
"profiles/process-1st-heap.pprof",
"profiles/process-2nd-heap.pprof",
"profiles/process-block.pprof",
"profiles/process-cpu.pprof",
"profiles/process-mutex.pprof",
}
ProfilingNonLinuxFiles contains profiling files only available on non-Linux platforms
var UntestedFiles = []string{
"docker_inspect.log",
"local",
"profiles/*",
"remote-config-state.log",
}
UntestedFiles contains some untested files that needs specific scenario which should be added later.
var WindowsFiles = []string{
"typeperf.txt",
"lodctr.txt",
"counter_strings.txt",
"servicestatus.json",
"datadog.reg",
}
WindowsFiles contains files that are specific to Windows
Functions ¶
func AssertEtcFolderOnlyContainsConfigFile ¶
AssertEtcFolderOnlyContainsConfigFile verifies that all files in "etc" folder are configuration file (filename containing ".yaml" / ".yml") or folders
func AssertEventlogFolderOnlyContainsWindowsEventLog ¶
AssertEventlogFolderOnlyContainsWindowsEventLog verifies that all files in "eventlog" (windows) folder are Windows Event log file (name ends with .evtx) or folders
func AssertFileContains ¶
func AssertFileContains(t *testing.T, flare flare.Flare, filename string, expectedContents ...string)
AssertFileContains verifies that `filename` contains every string in `expectedContents`
func AssertFileNotContains ¶
func AssertFileNotContains(t *testing.T, flare flare.Flare, filename string, expectedContents ...string)
AssertFileNotContains verifies that `filename` does not contain any string in `expectedContents`
func AssertFilesExist ¶
AssertFilesExist verifies that all files in filenames exist in the flare archive
func AssertFoldersExist ¶
AssertFoldersExist verifies that all files in filenames exist in the flare archive and are folders
Types ¶
This section is empty.