assertions

package
v0.61.0-rc.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package assertions provide custom assertions for Windows tests

Index

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

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

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

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

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

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

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

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

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

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

WithIdentity asserts that the service runs under the given identity.

func (*RemoteWindowsServiceAssertions) WithStatus

WithStatus asserts that the service has the given status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL