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) HasNoDatadogAgentService() *RemoteWindowsBinaryAssertions
- func (r *RemoteWindowsHostAssertions) HasNoService(serviceName string) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) NoDirExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- func (r *RemoteWindowsHostAssertions) NoFileExists(path string, msgAndArgs ...interface{}) *RemoteWindowsHostAssertions
- 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) HasNoDatadogAgentService ¶
func (r *RemoteWindowsHostAssertions) HasNoDatadogAgentService() *RemoteWindowsBinaryAssertions
HasNoDatadogAgentService checks if the remote host doesn't have a Datadog Agent installed.
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) 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 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.