assertions

package
v0.57.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 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) 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

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