Documentation
¶
Overview ¶
Package assertions provide custom assertions for Windows tests
Index ¶
- type RemoteWindowsAgentAssertions
- type RemoteWindowsAgentConfigAssertions
- type RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsBinaryAssertions) WithSignature(expectedSignatures map[string]struct{}) *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsBinaryAssertions) WithVersionEqual(expected string) *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsBinaryAssertions) WithVersionMatchPredicate(predicate func(version string)) *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsBinaryAssertions) WithVersionNotEqual(expected string) *RemoteWindowsBinaryAssertions
- type RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) DirExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) FileExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) HasARunningDatadogAgentService() *RemoteWindowsAgentAssertions
- func (r *RemoteWindowsHostAssertions) HasARunningDatadogInstallerService() *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) HasAService(serviceName string) *RemoteWindowsServiceAssertions
- func (r *RemoteWindowsHostAssertions) HasBinary(path string) *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsHostAssertions) HasDatadogInstaller() *RemoteWindowsInstallerAssertions
- func (r *RemoteWindowsHostAssertions) HasNamedPipe(pipeName string) *RemoteWindowsNamedPipeAssertions
- func (r *RemoteWindowsHostAssertions) HasNoDatadogAgentService() *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsHostAssertions) HasNoNamedPipe(pipeName string) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) HasNoRegistryKey(key string) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) HasNoService(serviceName string) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) HasRegistryKey(key string) *RemoteWindowsRegistryKeyAssertions
- func (r *RemoteWindowsHostAssertions) NoDirExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) NoFileExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- type RemoteWindowsInstallerAssertions
- type RemoteWindowsInstallerConfigStateAssertions
- type RemoteWindowsInstallerPackageAssertions
- func (d *RemoteWindowsInstallerPackageAssertions) WithExperimentVersionEqual(version string) *RemoteWindowsInstallerPackageAssertions
- func (d *RemoteWindowsInstallerPackageAssertions) WithExperimentVersionMatchPredicate(predicate func(version string)) *RemoteWindowsInstallerPackageAssertions
- func (d *RemoteWindowsInstallerPackageAssertions) WithStableVersionEqual(version string) *RemoteWindowsInstallerPackageAssertions
- func (d *RemoteWindowsInstallerPackageAssertions) WithStableVersionMatchPredicate(predicate func(version string)) *RemoteWindowsInstallerPackageAssertions
- type RemoteWindowsInstallerStatusAssertions
- type RemoteWindowsNamedPipeAssertions
- type RemoteWindowsRegistryKeyAssertions
- type RemoteWindowsServiceAssertions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteWindowsAgentAssertions ¶ added in v0.69.0
type RemoteWindowsAgentAssertions struct {
*RemoteWindowsBinaryAssertions
// contains filtered or unexported fields
}
RemoteWindowsAgentAssertions is a type that extends the SuiteAssertions to add assertions executing on a RemoteHost's Agent.
func (*RemoteWindowsAgentAssertions) RuntimeConfig ¶ added in v0.69.0
func (r *RemoteWindowsAgentAssertions) RuntimeConfig() *RemoteWindowsAgentConfigAssertions
RuntimeConfig gets the Agent runtime config and returns a config assertions helper
The `config get` subcommand only supports a small set of keys, so this method fetches the full config and unmarshals it into a map.
type RemoteWindowsAgentConfigAssertions ¶ added in v0.69.0
type RemoteWindowsAgentConfigAssertions struct {
*RemoteWindowsAgentAssertions
// contains filtered or unexported fields
}
RemoteWindowsAgentConfigAssertions provides assertions for Agent configuration
func (*RemoteWindowsAgentConfigAssertions) WithValueEqual ¶ added in v0.69.0
func (c *RemoteWindowsAgentConfigAssertions) WithValueEqual(key string, expectedValue interface{}) *RemoteWindowsAgentConfigAssertions
WithValueEqual checks if a config key has the expected value
type RemoteWindowsBinaryAssertions ¶
type RemoteWindowsBinaryAssertions struct {
*RemoteWindowsHostAssertions
// contains filtered or unexported fields
}
RemoteWindowsBinaryAssertions is a type that extends the RemoteWindowsHostAssertions to add assertions specific to a Windows binary.
func (*RemoteWindowsBinaryAssertions) WithSignature ¶
func (r *RemoteWindowsBinaryAssertions) WithSignature(expectedSignatures map[string]struct{}) *RemoteWindowsBinaryAssertions
WithSignature verifies the authenticode signature of the binary. This test does not call `FailNow` in case the signature does not match.
func (*RemoteWindowsBinaryAssertions) WithVersionEqual ¶
func (r *RemoteWindowsBinaryAssertions) WithVersionEqual(expected string) *RemoteWindowsBinaryAssertions
WithVersionEqual verifies the version of a binary matches what's expected by calling "version" on it. Obviously the binary must support the "version" command, which is normally the case for most Agent binaries.
func (*RemoteWindowsBinaryAssertions) WithVersionMatchPredicate ¶
func (r *RemoteWindowsBinaryAssertions) WithVersionMatchPredicate(predicate func(version string)) *RemoteWindowsBinaryAssertions
WithVersionMatchPredicate obtains the binary version by calling "version" and uses the predicate to verify if the version match the expectations.
func (*RemoteWindowsBinaryAssertions) WithVersionNotEqual ¶
func (r *RemoteWindowsBinaryAssertions) WithVersionNotEqual(expected string) *RemoteWindowsBinaryAssertions
WithVersionNotEqual verifies the version of a binary NOT match the expected by calling "version" on it. Obviously the binary must support the "version" command, which is normally the case for most Agent binaries.
type RemoteWindowsHostAssertions ¶
type RemoteWindowsHostAssertions struct {
// contains filtered or unexported fields
}
RemoteWindowsHostAssertions is a type that extends the SuiteAssertions to add assertions executing on a RemoteHost.
func New ¶
func New(context e2ecommon.Context, assertions *require.Assertions, remoteHost *components.RemoteHost) *RemoteWindowsHostAssertions
New returns a new RemoteWindowsHostAssertions
func (*RemoteWindowsHostAssertions) DirExists ¶
func (r *RemoteWindowsHostAssertions) DirExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
DirExists checks whether a directory exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
func (*RemoteWindowsHostAssertions) FileExists ¶
func (r *RemoteWindowsHostAssertions) FileExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
func (*RemoteWindowsHostAssertions) HasARunningDatadogAgentService ¶
func (r *RemoteWindowsHostAssertions) HasARunningDatadogAgentService() *RemoteWindowsAgentAssertions
HasARunningDatadogAgentService checks if the remote host has a Datadog Agent installed & running. It does not run a full test suite on it, but merely checks if it has the required service running.
func (*RemoteWindowsHostAssertions) HasARunningDatadogInstallerService ¶ added in v0.64.0
func (r *RemoteWindowsHostAssertions) HasARunningDatadogInstallerService() *RemoteWindowsHostAssertions
HasARunningDatadogInstallerService verifies that the Datadog Installer service is installed and correctly configured.
func (*RemoteWindowsHostAssertions) HasAService ¶
func (r *RemoteWindowsHostAssertions) HasAService(serviceName string) *RemoteWindowsServiceAssertions
HasAService returns an assertion object that can be used to assert things about a given Windows service. If the service doesn't exist, it fails.
func (*RemoteWindowsHostAssertions) HasBinary ¶
func (r *RemoteWindowsHostAssertions) HasBinary(path string) *RemoteWindowsBinaryAssertions
HasBinary checks if a binary exists on the remote host and returns a more specific assertion allowing to run further tests on the binary.
func (*RemoteWindowsHostAssertions) HasDatadogInstaller ¶ added in v0.65.0
func (r *RemoteWindowsHostAssertions) HasDatadogInstaller() *RemoteWindowsInstallerAssertions
HasDatadogInstaller verifies that the Datadog Installer is installed on the remote host.
func (*RemoteWindowsHostAssertions) HasNamedPipe ¶ added in v0.60.0
func (r *RemoteWindowsHostAssertions) HasNamedPipe(pipeName string) *RemoteWindowsNamedPipeAssertions
HasNamedPipe checks if a named pipe exists on the remote host
func (*RemoteWindowsHostAssertions) HasNoDatadogAgentService ¶
func (r *RemoteWindowsHostAssertions) HasNoDatadogAgentService() *RemoteWindowsBinaryAssertions
HasNoDatadogAgentService checks if the remote host doesn't have a Datadog Agent installed.
func (*RemoteWindowsHostAssertions) HasNoNamedPipe ¶ added in v0.60.0
func (r *RemoteWindowsHostAssertions) HasNoNamedPipe(pipeName string) *RemoteWindowsHostAssertions
HasNoNamedPipe checks if a named pipe does not exist on the remote host
func (*RemoteWindowsHostAssertions) HasNoRegistryKey ¶ added in v0.58.0
func (r *RemoteWindowsHostAssertions) HasNoRegistryKey(key string) *RemoteWindowsHostAssertions
HasNoRegistryKey checks if a registry key does not exist on the remote host.
func (*RemoteWindowsHostAssertions) HasNoService ¶
func (r *RemoteWindowsHostAssertions) HasNoService(serviceName string) *RemoteWindowsHostAssertions
HasNoService returns an assertion object that can be used to assert things about a given Windows service. If the service doesn't exist, it fails.
func (*RemoteWindowsHostAssertions) HasRegistryKey ¶ added in v0.58.0
func (r *RemoteWindowsHostAssertions) HasRegistryKey(key string) *RemoteWindowsRegistryKeyAssertions
HasRegistryKey checks if a registry key exists on the remote host.
func (*RemoteWindowsHostAssertions) NoDirExists ¶
func (r *RemoteWindowsHostAssertions) NoDirExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
NoDirExists checks whether a directory does not exist in the given path.
func (*RemoteWindowsHostAssertions) NoFileExists ¶
func (r *RemoteWindowsHostAssertions) NoFileExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
NoFileExists checks whether a file does not exist in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
type RemoteWindowsInstallerAssertions ¶ added in v0.65.0
type RemoteWindowsInstallerAssertions struct {
*RemoteWindowsBinaryAssertions
}
RemoteWindowsInstallerAssertions provides assertions for the Datadog Installer on Windows.
func (*RemoteWindowsInstallerAssertions) Status ¶ added in v0.65.0
func (d *RemoteWindowsInstallerAssertions) Status() *RemoteWindowsInstallerStatusAssertions
Status provides assertions on the status output of the Datadog Installer.
type RemoteWindowsInstallerConfigStateAssertions ¶ added in v0.68.0
type RemoteWindowsInstallerConfigStateAssertions struct {
*RemoteWindowsInstallerStatusAssertions
// contains filtered or unexported fields
}
RemoteWindowsInstallerConfigStateAssertions provides assertions on a package's config state in the status output.
func (*RemoteWindowsInstallerConfigStateAssertions) WithExperimentConfigEqual ¶ added in v0.68.0
func (d *RemoteWindowsInstallerConfigStateAssertions) WithExperimentConfigEqual(config string) *RemoteWindowsInstallerConfigStateAssertions
WithExperimentConfigEqual asserts the experiment config of a package matches
func (*RemoteWindowsInstallerConfigStateAssertions) WithStableConfigEqual ¶ added in v0.68.0
func (d *RemoteWindowsInstallerConfigStateAssertions) WithStableConfigEqual(config string) *RemoteWindowsInstallerConfigStateAssertions
WithStableConfigEqual asserts the stable config of a package matches what's expected.
type RemoteWindowsInstallerPackageAssertions ¶ added in v0.65.0
type RemoteWindowsInstallerPackageAssertions struct {
*RemoteWindowsInstallerStatusAssertions
// contains filtered or unexported fields
}
RemoteWindowsInstallerPackageAssertions provides assertions on a package in the status output of the Datadog Installer.
func (*RemoteWindowsInstallerPackageAssertions) WithExperimentVersionEqual ¶ added in v0.65.0
func (d *RemoteWindowsInstallerPackageAssertions) WithExperimentVersionEqual(version string) *RemoteWindowsInstallerPackageAssertions
WithExperimentVersionEqual verifies the experiment version of a package matches what's expected.
func (*RemoteWindowsInstallerPackageAssertions) WithExperimentVersionMatchPredicate ¶ added in v0.65.0
func (d *RemoteWindowsInstallerPackageAssertions) WithExperimentVersionMatchPredicate(predicate func(version string)) *RemoteWindowsInstallerPackageAssertions
WithExperimentVersionMatchPredicate verifies the experiment version of a package by using a predicate function.
func (*RemoteWindowsInstallerPackageAssertions) WithStableVersionEqual ¶ added in v0.65.0
func (d *RemoteWindowsInstallerPackageAssertions) WithStableVersionEqual(version string) *RemoteWindowsInstallerPackageAssertions
WithStableVersionEqual verifies the stable version of a package matches what's expected.
func (*RemoteWindowsInstallerPackageAssertions) WithStableVersionMatchPredicate ¶ added in v0.65.0
func (d *RemoteWindowsInstallerPackageAssertions) WithStableVersionMatchPredicate(predicate func(version string)) *RemoteWindowsInstallerPackageAssertions
WithStableVersionMatchPredicate verifies the stable version of a package by using a predicate function.
type RemoteWindowsInstallerStatusAssertions ¶ added in v0.65.0
type RemoteWindowsInstallerStatusAssertions struct {
*RemoteWindowsInstallerAssertions
// contains filtered or unexported fields
}
RemoteWindowsInstallerStatusAssertions provides assertions on the status output of the Datadog Installer.
func (*RemoteWindowsInstallerStatusAssertions) HasConfigState ¶ added in v0.68.0
func (d *RemoteWindowsInstallerStatusAssertions) HasConfigState(name string) *RemoteWindowsInstallerConfigStateAssertions
HasConfigState asserts that a package config is present in the status output.
func (*RemoteWindowsInstallerStatusAssertions) HasPackage ¶ added in v0.65.0
func (d *RemoteWindowsInstallerStatusAssertions) HasPackage(name string) *RemoteWindowsInstallerPackageAssertions
HasPackage verifies that a package is present in the status output.
type RemoteWindowsNamedPipeAssertions ¶ added in v0.60.0
type RemoteWindowsNamedPipeAssertions struct {
*RemoteWindowsHostAssertions
// contains filtered or unexported fields
}
RemoteWindowsNamedPipeAssertions is a type that extends the RemoteWindowsHostAssertions to add assertions specific to a named pipe.
func (*RemoteWindowsNamedPipeAssertions) WithSecurity ¶ added in v0.60.0
func (r *RemoteWindowsNamedPipeAssertions) WithSecurity(expected common.ObjectSecurity) *RemoteWindowsNamedPipeAssertions
WithSecurity asserts that the named pipe has the given security descriptor.
type RemoteWindowsRegistryKeyAssertions ¶ added in v0.58.0
type RemoteWindowsRegistryKeyAssertions struct {
*RemoteWindowsHostAssertions
// contains filtered or unexported fields
}
RemoteWindowsRegistryKeyAssertions is a type that extends the RemoteWindowsHostAssertions to add assertions specific to a Windows registry.
func (*RemoteWindowsRegistryKeyAssertions) WithValueEqual ¶ added in v0.58.0
func (r *RemoteWindowsRegistryKeyAssertions) WithValueEqual(value, expected string) *RemoteWindowsRegistryKeyAssertions
WithValueEqual verifies the value of a registry key matches what's expected.
type RemoteWindowsServiceAssertions ¶
type RemoteWindowsServiceAssertions struct {
*RemoteWindowsHostAssertions
// contains filtered or unexported fields
}
RemoteWindowsServiceAssertions is a type that extends the RemoteWindowsHostAssertions to add assertions specific to a Windows service.
func (*RemoteWindowsServiceAssertions) WithIdentity ¶
func (r *RemoteWindowsServiceAssertions) WithIdentity(userIdentity common.Identity) *RemoteWindowsServiceAssertions
WithIdentity asserts that the service runs under the given identity.
func (*RemoteWindowsServiceAssertions) WithStatus ¶
func (r *RemoteWindowsServiceAssertions) WithStatus(expectedStatus string) *RemoteWindowsServiceAssertions
WithStatus asserts that the service has the given status.