installtest

package
v0.58.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package installtest contains e2e tests for the Windows agent installer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAgentUserGroupMembership added in v0.53.0

func AssertAgentUserGroupMembership(t *testing.T, host *components.RemoteHost, username string) bool

AssertAgentUserGroupMembership checks the agent user is a member of the expected groups

func AssertDoesNotChangePathPermissions added in v0.56.0

func AssertDoesNotChangePathPermissions(t *testing.T, host *components.RemoteHost, beforeInstall map[string]string)

AssertDoesNotChangePathPermissions checks that the permissions on the paths in the snapshot are not changed by comparing their SDDL strings

func AssertDoesNotRemoveSystemFiles added in v0.53.0

func AssertDoesNotRemoveSystemFiles(t *testing.T, host *components.RemoteHost, beforeInstall *windowsCommon.FileSystemSnapshot)

AssertDoesNotRemoveSystemFiles checks that the paths in the snapshot still exist

func AssertGroupMembership added in v0.53.0

func AssertGroupMembership(t *testing.T, host *components.RemoteHost, user string, expectedGroups []string) bool

AssertGroupMembership asserts that the user is a member of the expected groups

func AssertInstalledUserInRegistry added in v0.53.0

func AssertInstalledUserInRegistry(t *testing.T, host *components.RemoteHost, expecteddomain string, expectedusername string) bool

AssertInstalledUserInRegistry checks the registry for the installed user and domain

func AssertUserRights added in v0.53.0

func AssertUserRights(t *testing.T, host *components.RemoteHost, username string) bool

AssertUserRights checks the user has the expected user rights

func ExpectPython2Installed added in v0.53.0

func ExpectPython2Installed(majorVersion string) bool

ExpectPython2Installed returns true if the provided agent major version is expected to contain an embedded Python2.

func RequireAgentRunningWithNoErrors added in v0.53.0

func RequireAgentRunningWithNoErrors(t *testing.T, client *common.TestClient)

RequireAgentRunningWithNoErrors checks the agent is running with no errors

func RequireAgentVersionRunningWithNoErrors added in v0.56.0

func RequireAgentVersionRunningWithNoErrors(t *testing.T, client *common.TestClient, version string)

RequireAgentVersionRunningWithNoErrors checks the agent is running the expected version with no errors

func SnapshotPermissionsForPaths added in v0.56.0

func SnapshotPermissionsForPaths(host *components.RemoteHost, paths []string) (map[string]string, error)

SnapshotPermissionsForPaths returns a map of paths to their SDDL permissions

func SystemPaths added in v0.53.0

func SystemPaths() []string

SystemPaths returns a list of paths that are known to frequently change and should be ignored when collecting the list of files

func SystemPathsForPermissionsValidation added in v0.56.0

func SystemPathsForPermissionsValidation() []string

SystemPathsForPermissionsValidation returns paths that we should ensure permissions are not changed on by our installer.

Paths were chosen because they are in the directory tree of our installed files.

This test is a result of a bug in Windows MSI.DLL (reported, fix in progress). See https://github.com/oleg-shilo/wixsharp/issues/1336

Types

type Tester

type Tester struct {
	InstallTestClient *common.TestClient
	// contains filtered or unexported fields
}

Tester is a test helper for testing agent installations

func NewTester

func NewTester(context e2e.Context, host *components.RemoteHost, opts ...TesterOption) (*Tester, error)

NewTester creates a new Tester

func (*Tester) ExpectAPM

func (t *Tester) ExpectAPM() bool

ExpectAPM returns true if the agent is expected to install APM

func (*Tester) ExpectCWS

func (t *Tester) ExpectCWS() bool

ExpectCWS returns true if the agent is expected to install CWS

func (*Tester) ExpectPython2Installed

func (t *Tester) ExpectPython2Installed() bool

ExpectPython2Installed returns true if the agent is expected to install Python2

func (*Tester) TestInstallExpectations added in v0.53.0

func (t *Tester) TestInstallExpectations(tt *testing.T) bool

TestInstallExpectations tests the current agent installation meets the expectations provided to the Tester

func (*Tester) TestUninstallExpectations added in v0.53.0

func (t *Tester) TestUninstallExpectations(tt *testing.T)

TestUninstallExpectations verifies the agent uninstalled correctly.

type TesterOption

type TesterOption func(*Tester)

TesterOption is a function that can be used to configure a Tester

func WithAgentPackage

func WithAgentPackage(agentPackage *windowsAgent.Package) TesterOption

WithAgentPackage sets the agent package to be installed

func WithExpectedAgentUser added in v0.53.0

func WithExpectedAgentUser(domain string, user string) TesterOption

WithExpectedAgentUser sets the expected user the agent should run as

func WithExpectedAgentUserName added in v0.56.0

func WithExpectedAgentUserName(user string) TesterOption

WithExpectedAgentUserName sets the expected user name the agent should run as the domain remains the default for the host.

func WithExpectedConfigRoot added in v0.54.0

func WithExpectedConfigRoot(path string) TesterOption

WithExpectedConfigRoot sets the expected config root for the agent

func WithExpectedInstallPath added in v0.54.0

func WithExpectedInstallPath(path string) TesterOption

WithExpectedInstallPath sets the expected install path for the agent

Directories

Path Synopsis
Package servicetest provides tests for the services installed by the Windows Agent
Package servicetest provides tests for the services installed by the Windows Agent

Jump to

Keyboard shortcuts

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