Documentation ¶
Overview ¶
Package assertions provide custom assertions for Windows tests
Index ¶
- 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() *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsHostAssertions) HasAService(serviceName string) *RemoteWindowsServiceAssertions
- func (r *RemoteWindowsHostAssertions) HasBinary(path string) *RemoteWindowsBinaryAssertions
- 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 RemoteWindowsNamedPipeAssertions
- type RemoteWindowsRegistryKeyAssertions
- type RemoteWindowsServiceAssertions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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(assertions *require.Assertions, suite suite.TestingSuite, 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() *RemoteWindowsBinaryAssertions
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) 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) HasNamedPipe ¶
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 ¶
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 RemoteWindowsNamedPipeAssertions ¶
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 ¶
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.